lefish - 2021-11-29

Hi there,

I am developing a control system on a Raspberry Pi, consisting of two main blocks in codesyscontrol runtime:

(1) MAIN TASK: "Soft realtime" tasks for controlling actors and reading digital inputs via EtherCAT (EK1100). Cycle time 100 ms.
(2) Asynchronous system commands for checking various system properties. Cycle time of multiple seconds are perfectly fine.

At first I put the realtime and asynchronous tasks into the MAIN TASK, as I thought the state machine implementation of asynchronous tasks would take care of their asynchronous nature.

Despite this approach I had the problem, that the asynchronous system commands led to very high jitter in MAIN TASK causing the EtherCAT bus to malfunction -> EtherCAT stopped working at random times -> NOT usable

To fix this issue I created a freewheeling TASK for the asynchronous system commands with a priority value of 31. Lets call it SLOW TASK.

Now I have jitter values of < 10 ms in MAIN TASK and cycle times of up to 5 s on SLOW TASK.

As far as I can tell everything is working fine.

Nevertheless I would like to check, if my approach is correct.

Please send me your optinions on my approach.




Last edit: lefish 2021-11-29