Repository with mainly educational level projects to show how to use GNU/Linux in control applications.
Real-time task require controlled (limited) operating system responses latencies. Standard Linux kernel does not guarantee bounded latencies. That is why kernel with fully-preemptive patches is requited. Real-time Linux support is tested and developed under OSADL.org organization coordination.
Raspberry Pi kernel sources with RT patches and Aufs patches applied can be cloned from linux-rpi repository.
The repository content:
- rpi_gpio_irc_module - kernel driver implementation of quadrature/IRC sensor interface software only decoder. Sensor outputs are connected to GPIO pins.
- rpi_simple_dc_servo - userspace DC motor control application which uses IRC driver and direct access to PWM and GPIO for direction output.
- rpi_dc_motor_control - the same application but implemented as Simulink model which uses C S-function implementation for PWM output and IRC driver read. More at lintarget.
- rpi_pmsm_motor_control - Simulink model for 3-phase BLDC/PMSM motor control which uses small Microsemi AGL125V5-VQ100 chip connected over SPI to implement IRC counter, 3x PWM modulation and current ADC conversion from HAL effect based current sensors on power stage board. More at lintarget.
- rpi_simple_dc_servo ported to RTEMS RTOS - it is the same DC motor control demo where IRC processing is ported as RTEMS driver. PWM and GPIO are accessed directly from controller sources.
More information about project can be found in InstallFest 2015 presentation slides and LinuxDays 2016 slides. Lintarget project the real RT-aware Simulink ERT target is used for Simulink based experiment. The article Usable Simulink Embedded Coder Target for Linux about Linux ERT has been presented at 16th Real Time Linux Workshop. Its use on Raspberry Pi platform is documented on next page.
Other related Raspberry Pi real-time demostration is control of CAN/CANopen stepper motors equipped two joints arm from Simulink model. Simulink SocketCAN support is described on Lintarget page as well.