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

CNC pendant encoder skipping step

Scheduled Pinned Locked Moved
CNC
2
4
516
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
    morgoth90
    last edited by morgoth90 18 Oct 2024, 17:04

    I was trying the firmware on an Arduino nano: https://github.com/Duet3D/CNC-Pendant-Firmware/tree/master
    After a few fast encoder rotations the detected pulses disalign resulting in two stray pulses after each detected movement:

    pulse1
    pulse2
    pulse3
    pulse4
    MOVEMENT +1
    ... after some fast movements...
    pulse3
    pulse4
    MOVEMENT +1
    pulse 1
    pulse 2
    

    This behaviour is probably caused by some missed pulse but as result will ignore the first movement in the opposite direction.

    After some tests I fixed the issue rewriting the encoder code using the arduino Encoder library:
    RotaryEncoder.cpp
    RotaryEncoder.h

    undefined 2 Replies Last reply 5 Nov 2024, 14:31 Reply Quote 1
    • undefined
      droftarts administrators @morgoth90
      last edited by 5 Nov 2024, 14:31

      @morgoth90 Thanks for your 'input'! I've added a note on the Pendant wiki instructions referencing this thread, here: https://docs.duet3d.com/en/User_manual/Connecting_hardware/IO_CNC_Pendant#programming-the-arduino-pro-micro

      Ian

      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

      1 Reply Last reply Reply Quote 1
      • undefined droftarts referenced this topic 5 Nov 2024, 15:09
      • undefined
        droftarts administrators @morgoth90
        last edited by 6 Nov 2024, 13:27

        @morgoth90 Your RotaryEncoder.h file has:

        #include <Arduino.h>
        #include <Encoder.h>
        

        Can you link to the source of these files? I think Arduino.h is okay (I think it's included in the Arduino IDE), but a link to the correct Encoder.h file is needed.

        See the post in this thread: https://forum.duet3d.com/post/346952

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        undefined 1 Reply Last reply 14 Nov 2024, 21:57 Reply Quote 0
        • undefined
          morgoth90 @droftarts
          last edited by 14 Nov 2024, 21:57

          @droftarts
          Right, probably was included in the available libraries because time ago i was sperimenting with a teensy controller.
          The encoder library is from here:
          https://github.com/PaulStoffregen/Encoder

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