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)
This picture shows the Nema17 ballscrew driving a mechanism that pulls a belt
The belt drives a toothed pulley further down the forearm at the wrist of the robot
The encoder is mounted to the wrists shaft directly so the actual/real position can be measured