So I am working on a research project and one of my responsibilities is to produce a stepper driver that can do any acceleration based off a given function. So desirably to any order. I have been looking over a lot of material and am stuck on a certain idea. So we use pulses to send movement into the motor, and these pulses always have the same width and you vary the distances between pulses? So my main question is in confusion if the last statement was true. I am not sure if the motion, acceleration is caused by:
1) Vary pulse distance and keep pulse width the same 2) Vary pulse width and keep pulse distance the same 3) Vary both?
The code that I am reffering to is:
digitalWrite(STEP_PIN, HIGH); delayMicroseconds((MICROSECONDS_PER_MICROSTEP * 0.9)/2); digitalWrite(STEP_PIN, LOW); delayMicroseconds((MICROSECONDS_PER_MICROSTEP * 0.9)/2);
In this code we set the same delay for both the high and low section of pulse and you change the delay for each pulse to have it change velocities. Is there a difference in just setting this to the minimum value and setting an additional delay after this? As you can see I am more confused on just how the pulsing method works. Any help would greatly be appreciated.