mjs513
Senior Member+
Been having fun learning about stepper motors but running into an issue when using the built-in encoder in the steppermotor. Will explain in great detail but first some basic info.
StepperMotor:
STEPPERONLINE Nema 17 Closed Loop Stepper Motor 23oz.in w/ Magnetic Encoder: https://www.omc-stepperonline.com/n...etic-encoder-1000ppr-4000cpr-17hs08-1004-me1k. The specs are in the attached PDF. But basically its a 200ppr stepper rated at 1amp per datasheet with a 4000 count encoder.
The motor is connected to a Teensy 4.0 using a Pololu DRV8825 (splurge and buy the real one - had issues with the knock off). The encoder is connected to a T4.1 so I can read the encoder as the motor is running.
Stepper wiring:
GNDs connected to GND on T4.
M0 - 5
M1 - 6
M2 - 7
Reset/Sleep - 3.3v
STEP - 14
Dir - 15
A1/A2/B1/B2 connected to motor through a interface board Picture below
Vref on the DRV8825 is set to 0.4v which is about 0.8 amp versus the 1.0amp rated current.
Encoder connections:
A+ - pin 2
B+ - pin 3
Z+ - pin 5
power - 5v
gnd - gnd
goes through a pololu level shifter to the T4.1
Driver library:
None. Rolled my own as a learning exercise. See attached sketch for stepper motor
Encoder sketch - using the simple_encoder example sketch.
ISSUE:
When the motor is running the encoder is showing counts that go up and down as opposed to a continuous increase as would normally be expected. The graphs below that in gory detail at least for the first bunch of pulses:
Microstep = 1/2 1/4
The interesting thing though at the end of a revolution the total counts is 4000 which is what it should be.
Decided to put a LA on the encoder pins to see whats happening and you can see where phase B goes out of synch:
No clue what the issue could be. But as a test with the motor disconnected and turning the shaft manually not seeing it to that extent only once or twice which could have been me.
I do have a Sparkfun Prodriver coming with is what the interface board was designed for (no clue where I put the original).
StepperMotor:
STEPPERONLINE Nema 17 Closed Loop Stepper Motor 23oz.in w/ Magnetic Encoder: https://www.omc-stepperonline.com/n...etic-encoder-1000ppr-4000cpr-17hs08-1004-me1k. The specs are in the attached PDF. But basically its a 200ppr stepper rated at 1amp per datasheet with a 4000 count encoder.
Motor and Encoder Connection
Motor | A+ | A- | B+ | B- |
Wire | Red | Black | Yellow | Blue |
Encoder | VCC | EGND | EA+ | EA- | EB+ | EB- | EZ+ | EZ- |
Wire | Red | Black | BRN | ORG | Blue | Green | Yellow | White |
The motor is connected to a Teensy 4.0 using a Pololu DRV8825 (splurge and buy the real one - had issues with the knock off). The encoder is connected to a T4.1 so I can read the encoder as the motor is running.
Stepper wiring:
GNDs connected to GND on T4.
M0 - 5
M1 - 6
M2 - 7
Reset/Sleep - 3.3v
STEP - 14
Dir - 15
A1/A2/B1/B2 connected to motor through a interface board Picture below
Vref on the DRV8825 is set to 0.4v which is about 0.8 amp versus the 1.0amp rated current.
Encoder connections:
A+ - pin 2
B+ - pin 3
Z+ - pin 5
power - 5v
gnd - gnd
goes through a pololu level shifter to the T4.1
Driver library:
None. Rolled my own as a learning exercise. See attached sketch for stepper motor
Encoder sketch - using the simple_encoder example sketch.
ISSUE:
When the motor is running the encoder is showing counts that go up and down as opposed to a continuous increase as would normally be expected. The graphs below that in gory detail at least for the first bunch of pulses:
Microstep = 1/2 1/4
The interesting thing though at the end of a revolution the total counts is 4000 which is what it should be.
Decided to put a LA on the encoder pins to see whats happening and you can see where phase B goes out of synch:
No clue what the issue could be. But as a test with the motor disconnected and turning the shaft manually not seeing it to that extent only once or twice which could have been me.
I do have a Sparkfun Prodriver coming with is what the interface board was designed for (no clue where I put the original).