Description
Discussed in #308
Originally posted by gpstone November 18, 2022
Hello. I am stuck and need some help on a strange issue where GRBL is ignoring axis acceleration value only on certain sequential G0/G1 commands. When this happens at full speed/acceleration, the stepper motors physically skip steps (usually just on one axis) and in severe cases the machine jams if one of the cloned axis skips and the other tries to continue. The problem started after upgrading my machine to GRBL Mega from GRBL 1.1f (Uno). I have a gantry CNC with dual X axis motors and limit switches for gantry squaring.
Originally I thought the problem was due to acceleration or axis speed being set too high. However, I was able to rule this out by slowing down the acceleration to an extremely slow speed (i.e. 5mm/s^2) and with things slowed down I could clearly see and hear the missed deceleration/acceleration curves on the G0 commands. The steppers made a 'hard' stop/start 'clunk' instead of a gradual decel/accel.
I have ruled out hardware issues by disabling axis cloning in config.h and physically wiring both X axis controllers to the same step/dir pins. When I do this, the problem goes away (Although I lose self-squaring). Also, what points me to a config or software issue is even when I physically have the axis wired to the same X outputs but then re-enable cloning of the X axis in config.h (nothing is physically connected to those pins), the issue with missed acceleration comes back.
Everything else seems to be setup and working fine. Homing works for all 4 axis. Everything is moving in the right direction. I can run Gcode programs (Except for occasional skipped steps due to this issue). What's very frustrating is the issue only happens on certain types of G commands. It is very repeatable with the same command, but some other combinations will work just fine.
Example gcode where acceleration is ignored
G21G0X25Y25 //Misses decel/accel between this line and next
G21G0X755Y25
G21G0X-153.968Y93.316
G21G0X-124.362Y40.107 //Misses decel/accel between this line and next
G21G0X-41.833Y-17.287
Troubleshooting I have tried:
- $RST=* command (several times)
- Various $ machine settings: Step pulse timing, Arc tolerance, Junction deviation, verified all the Accel and step setting match for cloned axis, etc.
- Various config.h settings: moving the cloned 'X' axis to AXIS 4/5/6, trying different homing cycles, etc
- Downloading and using the latest edge build of Mega-5X. (Note: This issue was also happening with prior build when I first upgraded to Mega around March 2022, so it's not an edge issue)
- Full EEPROM wipe of Mega controller
- Replacing/Upgrading from a generic mega board to a genuine Arduino Mega
- Downloading latest build of UGS Sender
Any ideas on what I can try next would be greatly appreciated. Thank you in advance!
$I
[VER:1.2g.20220917:]
[AXS:4:XYZ]
[OPT:VNMGH,35,255,48]
$$
$0 = 10 (Step pulse time, microseconds)
$1 = 255 (Step idle delay, milliseconds)
$2 = 0 (Step pulse invert, mask)
$3 = 0 (Step direction invert, mask)
$4 = 0 (Invert step enable pin, boolean)
$5 = 0 (Invert limit pins, boolean)
$6 = 0 (Invert probe pin, boolean)
$10 = 1 (Status report options, mask)
$11 = 0.010 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
$13 = 0 (Report in inches, boolean)
$20 = 1 (Soft limits enable, boolean)
$21 = 0 (Hard limits enable, boolean)
$22 = 1 (Homing cycle enable, boolean)
$23 = 11 (Homing direction invert, mask)
$24 = 25.000 (Homing locate feed rate, mm/min)
$25 = 4000.000 (Homing search seek rate, mm/min)
$26 = 250 (Homing switch debounce delay, milliseconds)
$27 = 2.000 (Homing switch pull-off distance, millimeters)
$30 = 24000 (Maximum spindle speed, RPM)
$31 = 7200 (Minimum spindle speed, RPM)
$32 = 0 (Laser-mode enable, boolean)
$100 = 80.120 (X-axis travel resolution, step/mm)
$101 = 80.120 (Y-axis travel resolution, step/mm)
$102 = 161.900 (Z-axis travel resolution, step/mm)
$103 = 80.120
$110 = 6000.000 (X-axis maximum rate, mm/min)
$111 = 6000.000 (Y-axis maximum rate, mm/min)
$112 = 3000.000 (Z-axis maximum rate, mm/min)
$113 = 6000.000
$120 = 5.000 (X-axis acceleration, mm/sec^2)
$121 = 5.000 (Y-axis acceleration, mm/sec^2)
$122 = 5.000 (Z-axis acceleration, mm/sec^2)
$123 = 5.000
$130 = 790.000 (X-axis maximum travel, millimeters)
$131 = 648.000 (Y-axis maximum travel, millimeters)
$132 = 200.000 (Z-axis maximum travel, millimeters)
$133 = 790.000
Config file:
Config.txt