Much better results, but I'm guessing I can go even further. Thanks for the tip.
I just tried this with some manual gcode entry.
Starting at X-11
G1 X-50 F50
waited a few seconds until it was about a 1/4 done with the move
G4 P0 M5
Spindle stopped immediately.
Think I'm gonna go back to a single GCode file per tool until this is working.
I want to believe that the M3/4/5 command is synchronized, but I don't see it reflected on my Duet running 2.02 when actually running.
I saw it again even when not going outside machine limits. A final chamfering pass on the inside of a rectangle. Just before finishing the last edge the spindle stopped, as it was only three or four commands away at that point.
Spindle stopped when executing either line N35310 or N35315 (unsure exactly).
N35305 G1 Y-38.979
N35310 G1 X-11.005 Y-40.978 Z-1.819
N35315 G1 X-13.004 Y-38.979 Z-3.818
N35320 G1 X-74.22
N35325 G0 Z15
N35345 G0 Z100
N35350 M291 P"chamfer mill, D=22mm, S=6mm, F=2, A=60, hss" R"Tool Change" S3
N35360 M98 P"/macros/Tool Probe Auto"
The machine continued with the G commands for the final edge (N35315, N35320 N35325) and just scraped the bit along the whole way with it not spinning.
I hadn't tried the G4 P0 M5 for that run so I will update with the new results after I make that change to my post-processor.
I just did a little test with manual GCode entry as well and while running a slow G1 straight line pass I am able to start and stop the spindle with M3/4/5 at will at any point during the move, is this supposed to behave the same as from a file? Because if it is, I shouldn't be able to send an M5 in the middle of a G1 move. Is it possible there is something in my config.g that is allowing this?
For G0/1/2/3 commands that go outside axis limits I would agree that aborting the SD job is the best strategy. With CNC re-running the code over and over again should do nothing because we take material away while 3D printers add material making resuming/restarting much harder.
And yes I think the same solution for G0/1 will work for G2/3 intermediates.
4 P0 M5 i
Hey just got back from a vacation...
Thanks, cool trick with the dwell spindle stop. Will try it out next run.
If that works no need to modify the M3/4/5's. Cool beans.
Hate to be posting so many requests, but I know you're trying to improve the CNC side of the firmware so this should help.
I noticed an issue today. I had my workpiece centered in the vise on my CNC table, but my vise is not centered. When I went to cut it, there was a layer on a chamfer around the outside that hit my machine x axis limit and triggered a stop. All good and dandy. I actually had it set too small anyway.
The issue became apparent after reviewing the recording of the cut on webcam. (And here's my guess as to how it went down inside the firmware)
The moment the command buffer loaded the command to move outside the machine limits the spindle stopped. However, the move commands continued up until the command just before going outside the limits.
This could have been very bad (especially on machines far more powerful than mine and metal stock). Thankfully this occurred on a fine roughing pass so the bit didn't really make much contact, but had this occurred during the initial roughing pass bits could have broken, or worse.
I suggest when a command is received that is outside an axis limit, the spindle should be kept on until the buffer is emptied.
Side note, does this trigger a pause/cancel/stop g script because I can't tell, but it seems it just stops in position. I would also think it should trigger cancel.g if not already doing so.
I'm working on getting better at CNC routing and I've noticed a possible need for a fourth type of stop. Interrupted stepper and spindle stop for CNC mode.
I feel the need in a situation where a cut may be going not as expected and you want to stop it immediately without going through the hassle of re-probing the work-piece. It's very difficult to line it up perfectly and I never have yet.
Waiting longer in these situations could lead to the need for an emergency stop and cut all power before the bit goes through the table and rips itself apart. So that's already covered, in both firmware and physically.
I had this situation tonight. I made a rookie mistake and forgot to torque down the bit in the holder and 2 mins into a rough cut the bit started being pulled out of the holder and going deeper into the material. It was a straight line cut so a pause wouldn't have had an effect until the pass was finished and the machine was in pieces. The bit made it entirely through the work-piece and a few mm into my waste mdf only seconds from hitting the aluminum bed before I triggered an emergency stop and had to re-zero the work-piece, which was inevitably a few fractions of a mm off from before.
I'm imagining a "Halt" button that could run M0 S1 for an interrupted immediate stop using the normal cancel.g or stop.g M0 normally does.
Is it not possible to interrupt these buffered moves that have been stored without cutting power the Duet or M112?
Is there some other solution that would work?
Or do I just need to learn how to setup (and purchase) a proper probing bit that can hook up to the Duet (anyone know options)?
I still don't get how that would get all three axes in every situation, especially if you mill out the point you first referenced.
I switched my Duet3D powered 3D printer to a CNC router, which is working great for the most part.
My only gripe is the inability to have an axis move slower than 0.5mm/s
In CNC mode I find this a major limitation.
It's kind of ridiculous because I could just halve my steps per mm to get 0.25mm/s and then just double my z output from the CAM but that's annoying and somewhat dangerous.
If there is no technical reason to limit the speed and to save me from rapidly tapping Z-0.05 when drilling into 1/8 inch aluminum....
I suggest the limit be based on the number of steps per second and not mm.
It should be something like 10 steps/s, which with a 2mm per rev leadscrew would give 0.1mm/s.
But really it should be configurable in CNC mode, since I think it is most needed on the Z, so if it could be a command like "M### Z5" for 5steps/s on the z axis that'd be amazing.
M566 X54 Y54
That's very very low for jerk. Remember, it's mm/min not mm/s.
Try a value of 500 or so.
You're right, I was thinking per second. Printing the bunny again at 540.
I went ahead and added an order of magnitude to all the values I had for jerk.
I'll update with the results.
Now that I am thinking about it I know you'll want to know my speed settings as I am starting to think I may have my instantaneous accel (jerk) too low. Here is my config with password redacted obviously.
; Configuration file for Duet Ethernet (firmware version 1.17 to 1.19)
; executed by the firmware on start-up
; generated by RepRapFirmware Configuration Tool on Sat Apr 21 2018 08:39:01 GMT-0400 (Eastern Daylight Time)
; General preferences
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M550 PJP-440 ; Set machine name
M551 Phahahahnoway ; Set password
M540 PIN:VA:LI:DE ; Set MAC address
M552 P0.0.0.0 S1 ; Enable network and acquire dynamic address via DHCP
M586 P0 S1 ; Enable HTTP
M586 P1 S1 ; Enable FTP
M586 P2 S1 ; Enable Telnet
M569 P0 S1 ; Drive 0 goes forwards
M569 P1 S0 ; Drive 1 goes backwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S0 ; Drive 3 goes forwards
M569 P4 S1 ; Drive 4 goes backwards
M350 X16 Y16 Z16 E16:16 I1 ; Configure microstepping with interpolation
M92 X79.635 Y80.2 Z395 E164.4:164.4 ; Set steps per mm
M566 X54 Y54 Z100 E180:180 ; Set maximum instantaneous speed changes (mm/min)
M203 X6000 Y6000 Z400 E4800:4800 ; Set maximum speeds (mm/min)
M201 X300 Y300 Z1900 E1080:1080 ; Set accelerations (mm/s^2)
M906 X1200 Y1360 Z1200 E1100:1100 I30 ; Set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout
; Axis Limits
M208 X-63 Y-8 Z.25 S1 ; Set axis minima
M208 X352 Y377 Z385 S0 ; Set axis maxima
M574 X1 Y1 Z1 S0 ; Set active low endstops
M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
M143 H0 S120 ; Set temperature limit for heater 0 to 120C
M305 P1 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1
M143 H1 S280 ; Set temperature limit for heater 1 to 280C
M305 P2 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 2
M143 H2 S280 ; Set temperature limit for heater 2 to 280C
M106 P0 S0 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
M106 P1 S0 I0 F500 H-1 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned off
M106 P2 S0 I0 F500 H-1 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned off
M563 P0 D0 H1 F1:2 S"Left Extruder" ; Define tool 0
G10 P0 X28.5 Y0 Z0 ; Set tool 0 axis offsets
G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
M563 P1 D1 H2 F1:2 S"Right Extruder" ; Define tool 1
G10 P1 X59.15 Y0.46 Z0 ; Set tool 1 axis offsets
G10 P1 R0 S0 ; Set initial tool 1 active and standby temperatures to 0C
; Custom settings are not configured