[Solved] StepTimer::GetInterruptClocks isn't incrementing



  • Trying to add some debug code to track hiccup issues in another post (https://forum.duet3d.com/topic/8250/hiccups-causing-layer-shifts) and I've noticed that subsequent calls to StepTimer :: GetInterruptClocks is occasionally returning non incrementing values.

    I printed the slow loop calculation from reprap.cpp

    SlowLoop was wrong 4581228.500000, dt 4294901859, end 355467264, start 355532701
    SlowLoop was wrong 4581228.500000, dt 4294901864, end 373620736, start 373686168
    SlowLoop was wrong 4581228.500000, dt 4294901859, end 479657984, start 479723421
    SlowLoop was wrong 4581228.500000, dt 4294901861, end 507248640, start 507314075
    SlowLoop was wrong 4581229.000000, dt 4294901908, end 563609600, start 563674988
    

    On a duet maestro, is that expected?

    I wonder if this might be causing my rare hiccups.


  • administrators

    No, it isn't expected. Can you confirm that you are calling GetInterruptClocks, not GetInterruptClocksInterruptsDisabled?

    Please modify your debug to print start and end in hex, because that may make it easier to see if the problem occurs when the 16-bit timer wraps around.


  • administrators

    I've just added similar debug to my build, and I can see that there is a problem. I'll have a fix later today. And yes, this will cause spurious hiccups to be reported and actioned.


  • administrators

    I've just committed a fix to StepTimer.cpp. I'll leave it running with debug enabled on my Maestro-equipped machine for several more hours before I do a release.

    Thanks for reporting this!



  • @dc42 said in StepTimer::GetInterruptClocks isn't incrementing:

    ease modify your debug to print start and end in hex, because that may make it easier to see if the problem occurs when the 16-bit timer wraps around.

    Thanks! I'll grab the change and test this morning too.



  • @dc42 I looked at your commit and I agree that I think it will resolve the problem on the basis that it's similar to what I was going to try myself.

    I've been running a couple of hours now with the change and all of the statistics, including custom debug code that I added which caused me to find the bug, all seem to be reporting correctly now.

    I'll need to run longer to check if this resolve my other issues with layer shifting, I'll post in that thread if it works.

    Thanks for your help.


Log in to reply