Hi all,
This is my first post and am reaching out for assistance setting up my spindle motor via an SSR 40 DA relay, with speed control & ON/OFF via Heaters 4 & 5 in the Expansion Header. I would appreciate any assistance in setting this up, especially with the config.g file.
I am getting the following error with my setup below:
Error: M3: No P parameter and no active tool with spindle
When the spindle is connected directly to the PSU I have control over the speed via a manual potentiometer adjusting the voltage, however, once the relay is connected from the Duet 2 wifi I am unable to even turn ON/OFF.
I believe my issue is in the code, as I am confused about what items I need to create and activate. I.e. Drive, Pin, Tools etc and assigning the spindle to which and how to make active. The issue could also be with the Duet 2 board pins I have used being PWM when I need Analogue 5v outputs.
I have connected the spindle as follows, please note I am yet to connect the speed control wiring as yet because I don't have on/off capability:
Current Relay Wiring:
Expansion Header Pin 18 (Heater 5) to + DC Input Terminal
Expansion Header Pin 42 (GND) to - DC Input Terminal
Note: LED is not illuminated on relay at any point and DC input range 3-32VDC & AC input range 24-380VAC
AC Live to 1 AC Terminal
2 AC Terminal to AC Live on PSU
AC Neutral to AC Neutral on PSU
Earth to AC Earth on PSU
Current Duet 2 Wiring:
Expansion Header Pins 1,2 & 8 (Heater 3) control BLTouch, which works.
X,Y & Z stepper motors, which all work
X,Y end stops, which all work
Input power is 12v - I have a 24v PSU to replace 12v if required.
Proposed Duet 2 Wiring for PWM speed control:
Expansion Header Pin 13 (Heater 4) to Centre Pin PSU Potentiometer connector
Expansion Header Pin 30 (GND) to GND PSU Potentiometer connector
Youtube:
Video showing connection of relay and speed control to a random grbl board.
https://www.youtube.com/watch?v=012_TzJL6GI
Config.g
; Configuration file for Duet WiFi (firmware version 3)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.3.14 on Sun Nov 20 2022 11:58:49 GMT+1000 (Australian Eastern Standard Time)
; General preferences
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves
M550 P"WolfCNC" ; set printer name
; Network
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet
; Drives
M569 P0 S1 ; Physical drive 0 goes forwards
M569 P1 S0 ; Physical drive 1 goes backwards
M569 P2 S0 ; Physical drive 2 goes backwards
;M569 P3 S1 ; physical drive 3 goes forwards
M584 X0 Y1 Z2 E3 ; set drive mapping
M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
M92 X800.00 Y800.00 Z800.00 E420.00 ; set steps per mm
M566 X900.00 Y900.00 Z60.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 X2380 Y2380 Z2380 E800 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 X350 Y180 Z50 S0 ; set axis maxima
; Endstops
M574 X1 S1 P"xstop" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin xstop
M574 Y1 S1 P"ystop" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin ystop
M574 Z1 S2 ; configure Z-probe endstop for low end on Z
; Z-Probe
M950 S0 C"exp.heater3" ; create servo pin 0 for BLTouch
M558 P9 C"^zprobe.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds
G31 P500 X0 Y0 Z2.5 ; set Z probe trigger value, offset and trigger height
M557 X5:215 Y5:180 S20 ; define mesh grid
; Heaters
M140 H-1 ; Disable heated bed
;M308 S0 P"bedtemp" Y"thermistor" T100000 B4138; configure sensor 0 as thermistor on pin bedtemp
;M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0
;M307 H0 B1 S1.00 ; enable bang-bang mode for the bed heater and set PWM limit
;M140 H0 ; map heated bed to heater 0
;M143 H0 S120 ; set temperature limit for heater 0 to 120C
;M308 S1 P"e0temp" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin e0temp
;M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1
;M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit
;M143 H1 S280 ; set temperature limit for heater 1 to 280C
; Fans
;M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency
;M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off
;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 P0 C"exp.heater4" ; create output/servo port 0 attached to heater 4 pin on expansion connector
M950 P1 C"exp.heater5" ; create output/servo port 1 attached to heater 5 pin on expansion connector
M950 R0 C"exp.heater4+exp.heater5" Q1000 L0:12000 ; spindle PWM on Heater 4 pin, on/off on Heater 5 pin, PWM frequency 100Hz
M563 P0 S"Spindle 0" R0 ; Create tool 0 with spindle 0 on Heater 5 and call it "Spindle 0"
M453
;M563 P0 D0 H5 F0 ; 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
; Custom settings are not defined