I have a 4 wire stepper motor. What type of Timings need to rotate stepwise? I want to turn the motor at different speeds. Is this ok? Or is this High pulse (mark time) is too much for each periods?
I'm feeding this 5V microcontroller pulse to the TB6600 stepper motor driver.
View attachment 146064
To interface with this controller, you use fixed pulse width negative step pulses, say 40 us, then choose when to send these step pulses according to distance using your calculations using an optimum acceleration in both polarities, with a max velocity due to friction with the max. frequency of step pulses around 20 kHz.
This will travel a certain linear distance with a belt around a given diameter pulley and most steppers are 200 full steps per revolution.
Acceleration= start ++++0000 - - - - stop for example.
Velocity = 0 1 2 4 4 4 4 2 1 0 stop
Position = moves number of steps / N for N = 1 to 16
Full Steps N=1, have the most torque, acceleration and noise. Half steps may be a good compromise.
Bigger fractional steps are just the opposite but allow fractional step position control.
It is not as you have shown with divide by two square waves.
The algorithm for acceleration and velocity is critical to performance and depends on torque, friction and inertia.
BTW this is the hard way to seek on a stepper.
I have seen this method perfected 4 decades ago in floppy disk controllers in the Apple ][ and 5.25" HDD's from NPL/Hitachi. A more modern hobbiest way is to use a CNC shield on an Arduino Uno with GRBL microcode and a number of free software tools. I liked GRBL Panel for Windows. No updates and it doesn't need any.