Usable Simulink Embedded Coder Target for LinuxMichal Sojka, Pavel PíšaCzech Technical University in PragueFaculty of Electrical EngineeringDepartment
Code generation in SimulinkIExample:Sine WaveProduct3ConstantPi n 1ErrFlagAnalog InputPi n 1 ErrFlagAnalog Outputdouble in1, out1;in1 = adc_read(1);ou
Can Simulink generate code that runs on Linux?Yes, but. . .M. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 6 / 22
Can Simulink generate code that runs on Linux?Yes, but. . .M. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 6 / 22
Problems of Simulink code generation targets for LinuxIVery good support for popular embedded boards(Raspberry Pi, BeagleBone, . . . )ICan only be ins
Problems of Simulink code generation targets for LinuxIVery good support for popular embedded boards(Raspberry Pi, BeagleBone, . . . )ICan only be ins
Problems of Simulink code generation targets for LinuxIVery good support for popular embedded boards(Raspberry Pi, BeagleBone, . . . )ICan only be ins
Problems of Simulink code generation targets for LinuxIVery good support for popular embedded boards(Raspberry Pi, BeagleBone, . . . )ICan only be ins
Problems of Simulink code generation targets for LinuxIVery good support for popular embedded boards(Raspberry Pi, BeagleBone, . . . )ICan only be ins
POSIX timers under preempt_rt LinuxIPOSIX timers use signals to notify user space about theirexpirationISignal delivery path uses sleeping locks under
Is there better code generationtarget?YesERT_LINUXM. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 9 / 22
MotivationINot everybody is a programmerIControl engineers can designcontrol algorithms but cannotprogram them in CIThey use tools like Simulink to si
ERT_LINUX code generation targetIGoal: Minimalist target which reuses as much Simulink codeas possible (not that easy)INo Eclipse needed,IUses clock_n
ERT_LINUX I/O supportIMF624: PCI data acquisition cardIDigital IO, Analog IO, PWM outICounters (can be used for PWM input!)IIncremental encoder inputI
ERT_LINUX I/O supportIMF624: PCI data acquisition cardIDigital IO, Analog IO, PWM outICounters (can be used for PWM input!)IIncremental encoder inputI
ERT_LINUX I/O supportIMF624: PCI data acquisition cardIDigital IO, Analog IO, PWM outICounters (can be used for PWM input!)IIncremental encoder inputI
Applications/demosM. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 12 / 22
PMSM motor simulationHardware-in-the-loop (HIL) simulationInfineon TriBoard running a motor control algorithmPCMotor & fault simulationMF624 I/O c
Robot with parallel kinematic structureI4 DC motors, 4 incremental encoders, other I/OsIPresented at Embedded world 2014ISampling period 1 ms but comp
Motor control on Raspberry PiIFinal task for students of our real-time course:ICreate software motor controller on an embedded PowerPCboard with VxWor
M. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 16 / 22
HardwarePWMGPIOsRaspberry Pi – P1CHBCHAIRCHI DRVLO DRVINHI DRVLO DRVINDCMOTORMotor Power SupplyDIRIAs simple as possibleIFour NOR gates (SN74HCT02)IH-
MotivationINot everybody is a programmerIControl engineers can designcontrol algorithms but cannotprogram them in CIThey use tools like Simulink to si
Incremental encoder (IRC) processingIThe most demanding partIIRC signal: 0 – 20 kHzIEvery edge generates an interrupt (up to 80 k interrupts/sec)IKern
Incremental encoder (IRC) processingIThe most demanding partIIRC signal: 0 – 20 kHzIEvery edge generates an interrupt (up to 80 k interrupts/sec)IKern
IRC processing detailsGPIOsRaspberry PiCHBCHAIRCHard IRQIRQ threadedhandlerIPosition calculation works better if derived from the order ofIRQs than fr
Demo: Raspberry Pi motor controllersfIRCInputIRC0int320IRC-displayConvertIRC int32 to RealdoubleIRC-scope-0.01ManualPWMdoublesfPWMwDirOutputPWMwDirMan
Demo: Raspberry Pi & CANM. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 21 / 22
ConclusionIERT_LINUX target worksIUsed in several applicationsIDoes not suffer from serious problems as original MathWorkscode generation targets.ILimi
ConclusionIERT_LINUX target worksIUsed in several applicationsIDoes not suffer from serious problems as original MathWorkscode generation targets.ILimi
MotivationINot everybody is a programmerIControl engineers can designcontrol algorithms but cannotprogram them in CIThey use tools like Simulink to si
MotivationINot everybody is a programmerIControl engineers can designcontrol algorithms but cannotprogram them in CIThey use tools like Simulink to si
MotivationINot everybody is a programmerIControl engineers can designcontrol algorithms but cannotprogram them in CIThey use tools like Simulink to si
What is Simulink?IWidely used tool for design and simulation of dynamic systemsICommercial, non-free program – a part of MatlabIDeveloped by MathWorks
Why people use it?M. Sojka, P. Píša Usable Simulink Embedded Coder Target for Linux RTLWS16 4 / 22
Code generation in SimulinkIExample:Sine WaveProduct3ConstantPi n 1ErrFlagAnalog InputPi n 1 ErrFlagAnalog Outputdouble in1, out1;in1 = adc_read(1);ou
Comments to this Manuals