• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

[Solved] StepTimer::GetInterruptClocks isn't incrementing

Scheduled Pinned Locked Moved
Firmware installation
2
6
888
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    iratecrayons
    last edited by iratecrayons 22 Dec 2018, 23:19

    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.

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by dc42 23 Dec 2018, 08:31

      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.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators
        last edited by 23 Dec 2018, 08:54

        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.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • undefined
          dc42 administrators
          last edited by dc42 23 Dec 2018, 11:10

          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!

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • undefined
            iratecrayons
            last edited by iratecrayons 23 Dec 2018, 13:51

            @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.

            1 Reply Last reply Reply Quote 0
            • undefined
              iratecrayons
              last edited by 23 Dec 2018, 15:31

              @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.

              1 Reply Last reply Reply Quote 0
              1 out of 6
              • First post
                1/6
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA