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

    1HCL Closed Loop Joint Shaft Encoder (not motor shaft)

    Scheduled Pinned Locked Moved
    General Discussion
    1hcl closed loop encoder
    2
    3
    386
    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.
    • tomsundefined
      toms
      last edited by

      Hi!

      The background
      I have a 1HCL expansion board driving a Nema17 stepper motor. I also have a CUI AMT102-V 2048 PPR (8192 CPR) encoder hooked up to the output shaft of the mechanism the Nema17 motor is driving. The encoder is NOT attached directly to the stepper motor shaft, but further down the mechanical linkage at the output. The output shaft only rotates through 180 degrees of motion.

      The reason the encoder is mounted on the output shaft and not on the motor shaft is that there's a significant amount of backlash in the mechanical system that is hard to compensate for (the amount of backlash varies with the load and orientation of the end effector).

      Efforts
      But due to the backlash in the system I can't seem to get the motor into closed loop mode. When trying to perform a Quadrature Shaft Encoder Calibration move M569.6 P##.# V1 , it fails due to inconsistent movement (I'm assuming this is because the backlash present in the system makes it seem like the encoder is faulty). I tried to bump the E param of the 569.1 command up to fairly large values to try and 'bypass' the backlash but it didn't seem to work.

      Setup
      6XD & 1HCL running 3.5.0-rc.1
      Encoder is configured to use 2048 PPR (or 8192 CPR)
      I have the A and B lines from the encoder hooked up to A and B on the 1HCL along with 5v and GND
      Stepper Motor is 1.8 deg/step, with a mechanical reduction that results in 0.1930 degs/step at the wrist
      The driver is configured with M569.1 P54.0 T2 C2048 R100 I0 D0

      • Note:
        • I'm fairly certain C is incorrect here, but I've tried many different values with no luck
        • It won't accept anything less than C400 (throws Error counts/rev must be at least 2 times steps/rev)

      The mechanism has a full-steps / deg value of M92 V5.1812500

      Then placed into closed loop mode with M569 P54.0 D4

      A Potential Solution
      I was wondering if there is a closed loop mode of operation that essentially maps encoder values to rotational angles and will just blindly drive the motor in the direction necessary until the encoder position/value is reached. Or if there is a way to trick an existing drive mode into behaving this way?

      Any help / suggestions would be greatly appreciated!

      Photos

      I've linked some photos of the robot arm & mechanism in question if you happen to be curious.

      The mechanical linkage / mechanism in question (J5 - driven by a Nema17 ballscrew at the rear of the forearm)
      Overview.png
      This picture shows the Nema17 ballscrew driving a mechanism that pulls a belt
      BallScrewToBelt.png
      The belt drives a toothed pulley further down the forearm at the wrist of the robot
      BeltToOutputShaft.png
      The encoder is mounted to the wrists shaft directly so the actual/real position can be measured
      j5_cover.jpg

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @toms
        last edited by

        @toms a closed loop contfoller such as the 1HCL needs an accurate low backlash encoder on the motor shaft to perform commutation, in other words so that it knows how to apply current to the motor phases in order to apply torque in the required direction. So a setup such as yours requires two encoders to be used.

        The firmware on the 1HCL does support two encoders if you select the quadrature linear axis encoder configuration. The motor shaft encoder has to be a Duet3D magnetic shaft encoder, because the 1HCL can only read one quadrature encoder.

        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

        tomsundefined 1 Reply Last reply Reply Quote 0
        • tomsundefined
          toms @dc42
          last edited by

          @dc42 Thanks for the info!

          The quadrature linear axis encoder configuration sounds like what I need! The only issue it that I'm limited on the number of wires I can string back to the control board and the 10 pin SPI header is quite a bit of cable, also the path back to the control board is further than the recommended 200mm 😞

          Also, I just realized that this setup is basically a servo, just replacing a potentiometer with an encoder. Is there a mode in RRF that allows you to drive a stepper motor in open loop mode targeting a potentiometer / encoder value? Essentially turning a stepper motor into a servo?

          Thanks again for the help!

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