I have a dc motor servo application, which calls a PID calc every 2mS (originally 1mS) from a timer.
I call gc.collect() at the end of the PID calc (which takes about 500uS) to prevent a long pause when the gc cuts in automatically every second or so.
I had to stretch my original 1mS timer to 2mS to give the GC time but it is usually finished well within the 2mS .
I'm surprised you are seeing the 10mS pause (which is the sort of pause caused by the automatic gc above).
BTW pausing gc for even a short time caused problems .
I call gc.collect() at the end of the PID calc (which takes about 500uS) to prevent a long pause when the gc cuts in automatically every second or so.
I had to stretch my original 1mS timer to 2mS to give the GC time but it is usually finished well within the 2mS .
I'm surprised you are seeing the 10mS pause (which is the sort of pause caused by the automatic gc above).
BTW pausing gc for even a short time caused problems .
Statistics: Posted by BillTodd — Thu Feb 29, 2024 7:13 pm