I am very new to the Arduino world having great fun working it all out but struggling with some code issues
The project is, I wanted to is remove change gears from a metal lathe and replace it with a rotary encoder on the spindle, and put a stepper motor on the lead screw. then have the stepper motor turning at a specific speed in relation to the encoder spinning for example a 12 to 5 ratio
The products I have are a
incremental rotary encoder 600 pulses per rotation
Nema34 a stepper motor Single Shaft 8.7Nm1232oz
Micro stepper driver DQ860MA (So get 1600 steps per rotation on the moter)
Arduino uno
I have been able to find code and adapted so I can count the pulses (transitions) coming out of the encoder which gets 2400 per rotation of the encoder
But what I'm struggling with is linking that into the stepper motor the pins I'm using from the stepper driver to the Arduino are
PUL+(5v) PIN 8
PUL-(PUL) PIN 9
DIR+(+5v) PIN 10
DIR-(DIR) PIN 11
Rotary encoder pins
Channel A pin 2
Channel B pin 3
I don't know the right way of doing this but what I'm after is for every rotation of the encoder (2400 pulses). I want the stepper to rotate 0.8 of a turn constantly but as the encoder speeds Increases the stepper needs to speed be increased as well but I am unsure how to do this
I would very much appreciate if someone can play around with some code and explain what I'm after
Thank you very much for anyone who can help
Jim