Missing spindles in M408 response?
-
I'm experimenting with controlling a spindle from Duet. I've switched the machine to CNC mode with
M453 P22 R24000 F100
, and the PWM output works as it should when I sendM3
commands. Cool.However, I'm not seeing spindle info in the reply from
M408
. The source code indicates that there should be a "spindles" entry in the JSON data, but I'm not seeing it.M450
confirms that the mode isPrinterMode:CNC
.The other condition the firmware checks for is that the spindle tool number isn't
-1
. This is difficult for me to verify, but it doesn't work even if I explicitly pass a T parameter toM453
.What am I missing? How do I get spindles included in M408?
FWIW, here's my config.g (no actual steppers or anything are actually connected, so this is mostly from RRF Config Tool):
; General preferences G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves ; Network M550 P"My CNC" ; Set machine name M552 S1 ; Enable network M586 P0 S1 ; Enable HTTP M586 P1 S0 ; Disable FTP M586 P2 S0 ; Disable Telnet ; Drives M569 P0 S1 ; Drive 0 goes forwards M569 P1 S1 ; Drive 1 goes forwards M569 P2 S1 ; Drive 2 goes forwards M569 P3 S1 ; Drive 3 goes forwards M350 X16 Y16 Z16 E16 I1 ; Configure microstepping with interpolation M92 X80.00 Y80.00 Z4000.00 E420.00 ; Set steps per mm M566 X900.00 Y900.00 Z12.00 E120.00 ; Set maximum instantaneous speed changes (mm/min) M203 X6000.00 Y6000.00 Z180.00 E1200.00 ; Set maximum speeds (mm/min) M201 X500.00 Y500.00 Z20.00 E250.00 ; Set accelerations (mm/s^2) M906 X800.00 Y800.00 Z800.00 E800.00 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 X230 Y210 Z200 S0 ; Set axis maxima ; Endstops M574 X1 Y1 S1 ; Set active high endstops ; Z-Probe M574 Z1 S2 ; Set endstops controlled by probe M558 P1 H5 F120 T6000 ; Set Z probe type to unmodulated and the dive height + speeds G31 P500 X0 Y0 Z2.5 ; Set Z probe trigger value, offset and trigger height M557 X15:195 Y15:195 S20 ; Define mesh grid ; Heaters M140 H-1 ; Disable heated bed ; Tools M563 P0 D0 H ; Define tool 0 G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C ; CNC M106 P2 I-1 M453 P22 R24000 F100
And here's the output from
M408 S2
:{ "status":"O", "coords":{ "axesHomed":[ 0, 0, 0 ], "xyz":[ 0.000, 0.000, 0.000 ], "machine":[ 0.000, 0.000, 0.000 ], "extr":[ 0.0 ] }, "speeds":{ "requested":0.0, "top":0.0 }, "currentTool":-1, "params":{ "atxPower":0, "fanPercent":[ 0, 100, 0, 0, 0, 0, 0, 0, 0 ], "speedFactor":100.0, "extrFactors":[ 100.0 ], "babystep":0.000 }, "sensors":{ "probeValue":205, "fanRPM":0 }, "temps":{ "current":[ 2000.0, 2000.0, 2000.0, 2000.0, 2000.0, 2000.0, 2000.0, 2000.0 ], "state":[ 0, 0, 0, 0, 0, 0, 0, 0 ], "tools":{ "active":[ [ 0.0 ] ], "standby":[ [ 0.0 ] ] }, "extra":[ { "name":"*MCU", "temp":41.2 } ] }, "time":1697.0 }
-
Which firmware version are you using?
-
@dc42 said in Missing spindles in M408 response?:
Which firmware version are you using?
2.02(RTOS) (2018-12-24b1)
-
Any troubleshooting tips for this? Since the PWM output works, it seems to me that it should be set up properly and M408 should include the spindle data.
I'd like to poll M408 and get the RPM from there (and set my VFD frequency over Modbus accordingly) instead of relying on PWM. I got an Arduino to measure the PWM with interrupts, but it wasn't as precise as I'd like.
-
Please can you upgrade to 2.03beta2 and try again.
-
@dc42 said in Missing spindles in M408 response?:
Please can you upgrade to 2.03beta2 and try again.
@dc42 Okay, done. It's still the same. PWM output works, but no "spindles" entry in M403 response.
{"status":"O","coords":{"axesHomed":[0,0,0],"xyz":[0.000,0.000,0.000],"machine":[0.000,0.000,0.000],"extr":[0.0]},"speeds":{"requested":0.0,"top":0.0},"currentTool":-1,"params":{"atxPower":0,"fanPercent":[0,100,0,0,0,0,0,0,0],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"sensors":{"probeValue":205,"fanRPM":0},"temps":{"current":[2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[0,0,0,0,0,0,0,0],"tools":{"active":[[0.0]],"standby":[[0.0]]},"extra":[{"name":"*MCU","temp":41.2}]},"time":196.0}
-
Hey, if I pass a T value to M453, it actually works now. That's nice, but not exactly obvious, especially since the T parameter isn't even documented (afaik).
Oh well, I'm happy for now. Thanks for your help!
-
I didn't write the extension that allows different tools to have different spindles. It looks like S is the spindle number (default 0) and T is the tool number to assign the spindle to, default -1. Only spindles assigned to tools are listed in the M408 response.