Implementing a Hard Real-TimeData Acquisition and ControlSystem on Linux RTAI-LXRTF.M.Klomp - 0499684DCT 2005.72Traineeship reportCoach: M.G.E. Schnei
4CHAPTER 2. IMPLEMENTATION OF SOFT- AND HARDWARE• Since the RTOS and the application are linked together in a "single" execution space, syst
2.2. SOFTWARE: EXPLANATION AND INSTALLATION52.2.2 S-function board driversThe source-code of the user space drivers and some kernel space routines for
6CHAPTER 2. IMPLEMENTATION OF SOFT- AND HARDWAREThe Acquisition Delay option in the AIn Simulink GUI has a big impact on the Ain driver functionAiGetA
2.3. GETTING STARTED7∗ The option -w makes a connection to the external mode of the Simulink model.– When -w is specified return to Simulink.∗ Choose S
8CHAPTER 2. IMPLEMENTATION OF SOFT- AND HARDWARE(a) GUI for Analog In. (b) GUI for Analog Out.Figure 2.2: GUI to set options for the Simulink blocks.•
Chapter 3Performance of the DACSTo give an idea of what the DACS is capable of, in this chapter the performance is evaluated bymeans of experiments. B
10CHAPTER 3. PERFORMANCE OF THE DACSAoutTo Workspace1AinTo WorkspaceSine Wave3Sine Wave2PowerDaq PD2 MF Analog Input0123456789101112131415PD2_MF_Seri
3.2. ACCURACY11With the Acquisition Delay set to 10000[ns], table 3.1 shows the maximal sample rates for threedifferent sets of channels. This is witho
12CHAPTER 3. PERFORMANCE OF THE DACS3.3 DiscussionOnce again it is stressed that the experiments described above are only mend to give a first im-press
Chapter 4Conclusions and RecommendationsConclusions Two Simulink S-function driver blocks for the PowerDAQ boards have been realized,which make Hard R
14CHAPTER 4. CONCLUSIONS AND RECOMMENDATIONS
Appendix AS-function C-codeA.1 Analog In file/*Analog input S-function for:United Electronic IndustriesPowerDAQ board type: PD2-MF-16-500/16HInput Fifo
16APPENDIX A. S-FUNCTION C-CODE#define SLOW (1<<8)#define CHLIST_ENT(c,g,s) (CHAN(c) | GAIN(g) | ((s) ? SLOW : 0))unsigned long AiGetAIValue(int
A.1. ANALOG IN FILE17unsigned int ChLst[scanSize];for (i = 0; i < scanSize; i++) {ChLst[i]= CHLIST_ENT((int)mxGetPr(ChannelList)[i],(int)mxGetPr(Ga
18APPENDIX A. S-FUNCTION C-CODE#ifdef MATLAB_MEX_FILE #include "simulink.c" #else #include "cg_sfun.h" #endif
A.2. ANALOG OUT FILE19A.2 Analog Out file/*Analog output S-function for:United Electronic IndustriesPowerDAQ board type: PD2-AO-16/16Output Fifo size:
20APPENDIX A. S-FUNCTION C-CODEssSetNumInputPorts(S,mxGetN(ChannelList));for (i = 0; i < mxGetN(ChannelList); i++) {ssSetInputPortWidth(S,i,1);}ssS
A.2. ANALOG OUT FILE21PdAcquireSubsystem(Handle, BoardLevel, 0);if (retVal < 0) {printf("AO: PdReleaseSubsystem error %d\n", retVal);}#en
22APPENDIX A. S-FUNCTION C-CODE11
Appendix BListings of hardware and softwareListing of hardware used:PC Dell OptiPlex GX270CPU IntelR° PentiumR° 4, 2.6 GHzRAM 512 MBHD IDE, 19.5 GBBoa
SummaryIn the Dynamics and Control Technology group of the department of Mechanical Engineering,dSPACE is a common choice for rapid control prototypin
24APPENDIX B. LISTINGS OF HARDWARE AND SOFTWARE
Appendix CInstallation of the Linux OS and extrasoftwareC.1 Linux OSThe Knoppix 3.3 distribution is used, which can be installed from CD. Put the CD i
26APPENDIX C. INSTALLATION OF THE LINUX OS AND EXTRA SOFTWAREDoing this, the listed are packages being updated and being installed. When asked, choose
Appendix DMatlab 6.1D.1 PreparationBefore we can start installing Matlab 6.1, some settings in Debian need to be changed. First of allit has to be pos
28APPENDIX D. MATLAB 6.1• Simulink• Matlab Compiler• Real-time Workshop• FLEXmCheck “Create symbolic links to Matlab and mex scripts” and choose /usr/
Appendix ERTAIIn this appendix it is assumed you are logged in as root. You will need it at least for installing thekernel and RTAI.E.1 Requirements f
30APPENDIX E. RTAI– Set version information on all module symbols, choose N• Processor type and features– Processor family, choose Pentium-Pro/Celeron
Bibliography[1] Linux COntrol and MEasurement Device Interface, "Comedi homepage", www.comedi.org.[2] dSPACE GmbH, "dSPACE homepage&quo
ivSUMMARY
ContentsSummary iii1 Introduction 12 Implementation of soft- and hardware 32.1 Real-Time OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
viCONTENTSE.4 RTAI Target Real Time Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Bibliography 31
Chapter 1IntroductionA cost-efficient alternative for the widely used but expensive dSPACE systems has to be created.The Data Acquisition and Control Sy
2CHAPTER 1. INTRODUCTIONThe third and last option is described in this report. Using I/O boards with onboard processors noextra interface and hardware
Chapter 2Implementation of soft- and hardware2.1 Real-Time OS2.1.1 Soft and Hard Real-TimeWith an ordinary Linux kernel it is not possible to handle i
Comentarios a estos manuales