4AxisCNCShield

Shop Forum Everything Else 4AxisCNCShield

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9700
    Anonymous
    Inactive

    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.

    #9701
    Dan
    Keymaster

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.