Optimizing program for minimum real cycle time, lowest possible input lag
On sidenote, I've just successfully merged my project to newest RT and IDE (2.30 and according RT).
And thanks for that, I remember 2.2.0 made my project unusable.
So I've seen people complain about the cycle time and I'm having an issue aswell.
I understood from @Martin Kudláček that NeuronOS is just a software PLC and it shares resources with various system bg processes, even though, is there something we can do except mapping only essential for our program needs I/O's to reduce the cycle time of PLC?
Hi @r3sist, what program cycle are you trying to achieve? Typically, you cannot get lower than 10ms.
Anything near real sub-200ms would be applicable.
Right now on 2.3.0 os / ide, the same program from 2.1.3 version seems to have even more input lag than before.
Machine operator states that its worse than before, and indeed, the machine is having trouble reacting to a limit switch in time, ignoring the signal and moving past it.
From button push, to relay output turning on, there is like ~1250ms total delay.
Also this :
iPressure:= REAL_TO_INT(hw.$Neuron M203_AI_1.01$); IF iPressure >= iPressure_setpoint THEN xPressureReached:= TRUE; ELSE xPressureReached:= FALSE; END_IF; IF bTableDown_button AND NOT xPressureReached THEN bTableDown_valve:=TRUE; bHighPressure_valve:= TRUE; ELSE bTableDown_valve:=FALSE; bHighPressure_valve:= FALSE; END_IF;
Seems to fail now, lets say the setpoint is a const 100, it does not close the valve and pressure goes way above setpoint. Sensor seems fine just the logic feels slow in execution.
There is a task set on freewheeling on 0%, i've tried to separate them using cycling on a 50/100ms scan but it didnt affect the outcome 1200ms+ reaction time.
I've sent you the project file and appreciate your insight.
There is something really wrong int the project @r3sist. Please send it to firstname.lastname@example.org. With my project in ST code I am able to run on 20ms.
For the record - @r3sist discovered that the corrupted SD card has been causing the delays. Everything in the program has been configured correctly.