4AxisCNCShield
- This topic has 1 reply, 2 voices, and was last updated 8 years, 7 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Shop › Forum › Everything Else › 4AxisCNCShield
Tagged: GcodeCNCDemo4AxisCNCShield
I was having a few problems getting the GcodeCNCDemo4AxisCNCShield code to work with my nema 17 motors; I was getting a high frequency noise and judder but the motors wouldn’t turn. After comparing the code with that in similar sketches I found that adding a short delay between the digitalWrite commands solved the problem.
digitalWrite(motors[motor].step_pin,HIGH);
delay(1);
digitalWrite(motors[motor].step_pin,LOW);
delay(1);
I’ve no idea if this is the correct solution but it worked for me.
In onestep() you may find a delayMicroseconds(1500) is enough. CNCShield was contributed by a fan.
Where you see
a[j].over -= maxsteps;
digitalWrite(motors[j].step_pin,HIGH);
digitalWrite(motors[j].step_pin,LOW);
You might be able to get away with
digitalWrite(motors[j].step_pin,HIGH);
a[j].over -= maxsteps;
digitalWrite(motors[j].step_pin,LOW);
instead of a delay.