Hi @jh247247, I can't get the encoder and the motor to be in sync, even on the desk. My encoder and closed loop stepper were used with a NanoELS h2 before. I have set the steps per rotation settings and with my 1mm leadscrew and selecting 1mm thread pitch I would expect the motor to do one turn for each turn of the encoder. If I turn the encoder very slow (like 10s for one rotation) it matches:

But when I turn it slightly faster I get to many pulses.

I counted all encoder and motor pulses in the following picture and while I get 60 encoder pulses the motor was sent more than 70 pulses:

I tried commit 66e751d and cfa3c95 since in the latest commit on main the motor jumps back with every rotation and on boj-position-consumption-fix the motor jumps when switching to enable after the spindle has moved.
Maybe I'm using the UI wrong? My steps are:
- Disable Lock
- Switch from feed to thread mode
- Switch to 1mm thread pitch
- Press ELS_ENABLE_BUTTON to enable the motor
Now the encoder and motor should be in sync, or am I missing something?
I made also a quick video:
https://youtu.be/MrAN45gUym8
I just added a debug variable counting every time if(sendPulse()) is entered:
// attempt to keep in sync with the leadscrew
// if sendPulse returns true, we've actually sent a pulse
if (sendPulse()) {
test_pulse_count++;
Printing test_pulse_count along with m_currentPosition shows the same discrepancy:
See "Leadscrew pulses total" vs "Leadscrew position" in this screen recording: https://github.com/user-attachments/assets/02613b07-38ff-4bee-a65e-542bac010dfe
Hi @jh247247, I can't get the encoder and the motor to be in sync, even on the desk. My encoder and closed loop stepper were used with a NanoELS h2 before. I have set the steps per rotation settings and with my 1mm leadscrew and selecting 1mm thread pitch I would expect the motor to do one turn for each turn of the encoder. If I turn the encoder very slow (like 10s for one rotation) it matches:
But when I turn it slightly faster I get to many pulses.
I counted all encoder and motor pulses in the following picture and while I get 60 encoder pulses the motor was sent more than 70 pulses:
I tried commit 66e751d and cfa3c95 since in the latest commit on main the motor jumps back with every rotation and on boj-position-consumption-fix the motor jumps when switching to enable after the spindle has moved.
Maybe I'm using the UI wrong? My steps are:
Now the encoder and motor should be in sync, or am I missing something?
I made also a quick video:
https://youtu.be/MrAN45gUym8
I just added a debug variable counting every time if(sendPulse()) is entered:
// attempt to keep in sync with the leadscrew// if sendPulse returns true, we've actually sent a pulseif (sendPulse()) {test_pulse_count++;Printing test_pulse_count along with m_currentPosition shows the same discrepancy:
See "Leadscrew pulses total" vs "Leadscrew position" in this screen recording: https://github.com/user-attachments/assets/02613b07-38ff-4bee-a65e-542bac010dfe