Hey, thanks for your answer, I’m most pleased with some code example from you guys.
Unfortunately, I can’t show the photos, because the whole system is already assembled and the secret of this project covers me.
The system works, but according to the documentation, the times should be very short (between high and low at the CLK input of the controller)
At the moment my code looks like this
for (int i = 0; i < stepsPerRevolution; i ++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);
}
And the code you proposed uses such ‘times’
for(int i = 0; i < 50; i++)
{
// Trigger the motor to take one step.
digitalWrite(STEP_PIN, HIGH);
delay(250);
digitalWrite(STEP_PIN, LOW);
delay(250);
}
All VREFs are adjusted according to the documentation. The connection is also made correctly (I designed and constructed the PCB for all electronics) only the motor coils are wired.
I have the impression that something is wrong in the program, these CLK activation times. It’s just that when I set more time between logical states, the motor does not work well. I will test it on what I have in the company (I will be in the company from the new week)
SPACE
might be missing steps
How can I lose steps?
Can the driver with the motor work unstable due to the wrong program?
The control code is uploaded to the Atmega328/8A with a 16MHz oscillator.
your motor cannot handle the load you are putting on it
The load is not large, barely 50 grams
you are trying to step the motor faster than it can handle
I don’t even know how to achieve it, shortening the control time of logical values on CLK only causes the rotor to spin with a hum
your current limit isn’t set appropriately
The current is well selected, according to the formula in the documentation
Regards
Bartosz Kossowski