G0 speed not as expected
-
Hello, Has anyone else experienced this, or is this a software glitch? I have my max speeds on my CNC router set to 24000mm/min which is 400mm/s and the documentation for the duet G code says that in CNC mode the G0 command uses the maximum speed available set by the M203 command. I however seem to have a limit of 300mm/s when using the G0 command, and no that isn't the actual vs the desired speed , they are both 300mm/s. I can send a G1 command with an F24000 parameter and make those moves at 400mm/s.
Is there some software glitch that could be ignoring values higher than 18000mm/min when setting the default G0 speeds?
I just upgraded to the 3.4.1 stable version and the issue is still present. I previously was using the 3.4.0RC1 version.
-
Can you share your config.g?
Can you send M203 by itself and see what limits are actually set?
Can you share the exact gcode commands used to trigger the behaviour?
Which Duet board? -
@phaedrux
Sure thing, here is the config.g; Configuration file for Duet WiFi (firmware version 3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.0 on Thu Aug 19 2021 13:14:05 GMT-0600 (Central Standard Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"CNCRouter" ; set printer name M453 ; Make CNC board ; Network M552 S1 ; enable network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; External Drives M569 P5 S0 R1 T5:2.5:5:7.5 ; external drive 5 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P6 S1 R1 T5:2.5:5:7.5 ; external drive 6 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P7 S1 R1 T5:2.5:5:7.5 ; external drive 7 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P8 S1 R1 T5:2.5:5:7.5 ; external drive 8 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P9 S1 R1 T5:2.5:5:7.5 ; external drive 9 goes forward requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time ; Disable internal drives ;M569 P1 R-1 ; disable physical drive ;M569 P2 R-1 ; disable physical drive 2 ;M569 P3 R-1 ; disable physical drive 3 ;M569 P4 R-1 ; disable physical drive 4 ;M569 P5 R-1 ; disable physical drive 5 ; Map axis drives M584 X7 Y5:6 Z8 A9 ; set drive mapping ;M350 X64 Y64 Z16 E16 I0 ; configure microstepping with interpolation ; Set drive speeds M92 X394.09 Y394.09 Z1280.00 A420.00 ; set steps per mm M566 X300.00 Y300.00 Z300.00 A120.00 ; set maximum instantaneous speed changes (mm/min) M203 X24000.00 Y24000.00 Z3600.00 A1200.00 ; set maximum speeds (mm/min) M201 X400.00 Y400.00 Z400.00 A250.00 ; set accelerations (mm/s^2) M906 X800 Y800 Z800 A800 I30 ; set motor currents (mA) and motor idle factor in per cent ;M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X1238 Y2480 Z225 S0 ; set axis maxima ; Endstops M574 X1 S1 P"^exp.e4stop" ; configure active-high endstop for low end on X via pin xstop M574 Y2 S1 P"^exp.e2stop+^exp.e3stop" ; configure active-high endstop for high end on Y via pin ystop and on e0stop M574 Z2 S1 P"^exp.e5stop" ; configure active-high endstop for high end on Z via pin zstop ; Z-Probe M558 P5 C"^!zstop" H45.2 F1500 T24000 ; set Z probe type to unmodulated and the dive height + speeds G31 P500 X0 Y0 Z42 ; set Z probe trigger value, offset and trigger height M557 X50:1150 Y70:2470 S100:100 ; define mesh grid ; Driver error inputs M950 J0 C"e1stop" ;Input 0 uses Zstop M950 J1 C"xstop" ;Input 1 uses xstop M950 J2 C"ystop" ;Input 2 uses ystop M950 J3 C"e0stop" ;Input 3 uses e0stop M581 T2 P0:1:2:3 R0 S0 ;Configure the trigger T0 is emergency stop T1 is pause T#>2 calls sys/trigger#.g ; Temperature sensors M308 S0 Y"mcu-temp" A"MCU" ; create mcu temperature M308 S1 Y"drivers" A"Stepper driver" ; create driver temperature ;M308 S2 P"TC0" Y"thermocouple-max31856" A"box" ; create enclosure temperature type K sensor ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin bedheat and set its frequency M106 P0 L20 T30:45 H0 ; set fan 0 to minimum of 50 value. Thermostatic control is turned on based on MCU temp ;M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency ;M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on ; Tools ;M950 R0 C"bedheat+e0heat+e1heat" Q250 L3000:18000 ; spindle 0 uses bedheat for RPM pwm, e1heat for forward, fan2 for reverse M950 R0 C"bedheat+e0heat" Q250 L3000:18000 ; spindle 0 uses bedheat for RPM pwm, e0heat for forward M563 P0 S"Spindle 1" R0 ; define tool 0 as Spindle 1 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets ;Miscelaneouis M950 P1 C"e1heat" Q500 ; Create P1 for the air and coolant solenoid M950 J4 C"^zprobe.in" ; Create Input 4 to use zprobein M581 T4 P4 R0 S0 ; input 4 calls sys/trigger4.g ; Custom settings M669 K0 S1 T1 ; Set Cartesian kinematics and small segment values for quick pauses.
When I send the M203 to see what values are being used, I get the correct values
M203 Max speeds (mm/min)): X: 24000.0, Y: 24000.0, Z: 3600.0, A: 1200.0, E:, min. speed 30.00
Here is an example of the macro I use, but really any G0 X** Y** will only run at 300mm/s
M290 R0 S0 G53 G0 Z224 ; Rapid lift Z out of the way G53 G1 X500 Y150 F24000 ; Rapid XY to end of table
I'm using a duet 2 wifi with the external drivers.
-
I don't mean to be an idiot here, but your "Rapid XY to end of the table" is a G1 not a G0
Is that going to make a difference?
-
@baird1fa I'm still new to this but recently woke up my own slow motors with 2 steps. One was my max was too low. You've already fixed that. The other was raising the motor current. I started low based on the guide's advice. I brought it closer to 75-80% of the rated amount and it's doing much better.
-
@baird1fa your saying you can program a G1 simultaneous XY move at 24kmm/m and not the same move for a G0 rapid?
Your step rate seems pretty high. You may be hitting the limit with those timings and step pulse output if it will run 24k on one axis but not 2 together. Also I dont use microstepping with external drives. I didnt think it worked as I thought the last time I tried it. If it does 64 is quite high -
@baird1fa said in G0 speed not as expected:
M569 P5 S0 R1 T5:2.5:5:7.5
M92 X394.09 Y394.09 Z1280.00 A420.00
Here is an example of the macro I use, but really any G0 X** Y** will only run at 300mm/sIf I'm doing the math right:
- 300 mm/s times 394 steps-per-mm = 118,200 steps-per-second
- 5microseconds step pulse + 2.5 microseconds step rate = 7.5 microseconds
- 1/7.5 microseconds = 133,333 steps-per second
Sp it seems like 300mm/seconds might be hitting the maximum rate you said your stepper motor drivers can accept.
Is my math right here?
-
@alankilian Thanks for pointing that out. I changed it after I discovered the issue, then blindly posted it in response to phaedrux. It was a G0 command but would only travel at 18000mm/min, so I changed it to a G1 command to get it moving at 24000mm/min. It's a work around in this case but when I run jobs, I just use G0 from the post processor and there really isn't a good work around because even if I add a feed rate to G0 it is ignored when in CNC mode.
-
@3dpmicro That is correct. I can move at 24000mm/min with G1 command, but when I use a G0 it will only run at 18000mm/min.
-
@alankilian Forgive me but I didn't actually do the math, I just blindly punched in the numbers. your calculations look sound, and then the max would actually be 338mm/s
If your math is correct and that is the issue I'm facing then there is another issue in the firmware where it reports that it is running faster than it actually is. When I use a G1 command, say G1 X1000 Y2200 F24000, the DWC shows that the requested speed is 400mm/s and the actual is 400mm/s.
-
I don't think this is the issue. I just took your advice and changed the maximum speed to 330mm/s (by the math I should be able to hit 338mm/s as an absolute max) and I still get 300mm/s for the G0 and if I use G1 X** F24000 It maxes out at 330mm/s.
I changed the M203 to 19800mm/min in my config.
So regardless there still seems to be some type of issue where G0 maxes out at 300mm/s on my application.
-
Hello Everyone,
Thank you for your replies, based on what was said/suggested I tried a couple of things.
I looked back to the manual of the stepper driver and found that I can run the pulses at 2.5us so I made that change which should allow for upto 507mm/s, based on the math provided by alankilian. it does sound like the machine moves faster now at 300mm/s so maybe there is some issue where the pulses are a limiting factor and the display isn't showing that correctly. Even with that new pulse speed the G0 still maxes out at 300mm/s
Here is the relevant changes in the config.g
; External Drives M569 P5 S0 R1 T2.5:2.5:5:7.5 ; external drive 5 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P6 S1 R1 T2.5:2.5:5:7.5 ; external drive 6 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P7 S1 R1 T2.5:2.5:5:7.5 ; external drive 7 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P8 S1 R1 T2.5:2.5:5:7.5 ; external drive 8 goes forwards requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time M569 P9 S1 R1 T2.5:2.5:5:7.5 ; external drive 9 goes forward requires an active high enable, 5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup, and 7.5us hold time ; Disable internal drives ;M569 P1 R-1 ; disable physical drive ;M569 P2 R-1 ; disable physical drive 2 ;M569 P3 R-1 ; disable physical drive 3 ;M569 P4 R-1 ; disable physical drive 4 ;M569 P5 R-1 ; disable physical drive 5 ; Map axis drives M584 X7 Y5:6 Z8 A9 ; set drive mapping ;M350 X64 Y64 Z16 E16 I0 ; configure microstepping with interpolation ; Set drive speeds M92 X394.09 Y394.09 Z1280.00 A420.00 ; set steps per mm M566 X300.00 Y300.00 Z300.00 A120.00 ; set maximum instantaneous speed changes (mm/min) M203 X24000.00 Y24000.00 Z3600.00 A1200.00 ; set maximum speeds (mm/min) M201 X400.00 Y400.00 Z400.00 A250.00 ; set accelerations (mm/s^2) M906 X800 Y800 Z800 A800 I30 ; set motor currents (mA) and motor idle factor in per cent ;M84 S30
I also did try changing the maximum speed to 19800 for x and Y and that also had no effect
-
@baird1fa Looking at the source code it would seem that the maximum feedrate for a G0 move is indeed fixed at 18000mm/min. See the code here:https://github.com/Duet3D/RepRapFirmware/blob/3.4-dev/src/GCodes/GCodes.cpp#L1497
// Set up the extrusion and feed rate of a move for the Move class // 'moveBuffer.moveType' and 'moveBuffer.isCoordinated' must be set up before calling this // 'isPrintingMove' is true if there is any axis movement // Returns nullptr if this gcode is valid so far, or an error message if it should be discarded const char * GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, bool isPrintingMove) THROWS(GCodeException) { // Deal with feed rate, also determine whether M220 and M221 speed and extrusion factors apply to this move if (moveState.isCoordinated || machineType == MachineType::fff) { moveState.applyM220M221 = (moveState.moveType == 0 && isPrintingMove && !gb.IsDoingFileMacro()); if (gb.Seen(feedrateLetter)) { gb.LatestMachineState().feedRate = gb.GetSpeed(); // update requested speed, not allowing for speed factor } moveState.feedRate = (moveState.applyM220M221) ? speedFactor * gb.LatestMachineState().feedRate : gb.LatestMachineState().feedRate; moveState.usingStandardFeedrate = true; } else { moveState.applyM220M221 = false; moveState.feedRate = ConvertSpeedFromMmPerMin(DefaultG0FeedRate); // use maximum feed rate, the M203 parameters will limit it moveState.usingStandardFeedrate = false; }
and here:https://github.com/Duet3D/RepRapFirmware/blob/3.4-dev/src/Config/Configuration.h#L221
constexpr float DefaultG0FeedRate = 18000.0; // The initial feed rate for G0 commands after resetting the printer, in mm/min
I'm not sure where that default/maximum value comes from though. Perhaps @dc42 could comment?
-
@baird1fa, @gloomyandy is correct. I will fix this in RRF 3.4.2rc2.