Strange Servo Issue with Duet2 and Duex5
-
Hi All back again!!
This time its very odd and after reading everything I can on connecting and talking to servos via the Duet2 and Duex I am at a loss as to why its not working !
So machine spec:
Heavily modified Voron 2.4 CoreXY design to increase build volume to approx 450mm Cubed (and a few other things)
20mm Linear rails all round (yes I know thats overkill)
Duet2 Wifi & Duex5 expansion board
Paneldue 7i
4 x Nema 23 Z motors
2 x Nema 17 for A/B Drive
1 x E3D Hermes bowden extruder (now known as Hemera)
E3D V6 hotend with modified StealthburnerWill be a custom bed and heater when i get that far!
I am running :
Board: Duet 2 WiFi (2WiFi)
Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.4.6-rc.1 (2023-07-13)
Duet WiFi Server Version: 1.27
Duet Web Control 3.4.5So after the last issue I upgraded the firmware to 3.4.6-rc.1 shown above (I notice it no longer mentions the Duex5 as it did before) and it fixed my multi endstop naming issue and everything was working as expected - great news!
So Ive decided to build a servo controlled Klicky mount to bring the Klicky into position for the head, currently I have the klicky installed as the probe and it works perfectly, I have read the documentation on attaching servos to the Duet and decided to attach the servo to my Duex5 as it has the servo pwm connections shared with the heaters.
I have 3 servos to play with all of which are running from a dedicated external 5v supply the signal or pwm connection from the servo is the ONLY connection made to the Deux5 on PWM5 (duex.pwm5)
in my config.g file I have this:
;Servo config --------------------------------------------- ; Disable all heaters on Duex5 ;M307 H2 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H3 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H4 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H5 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H6 A-1 C-1 D-1 ; Disable heater (for servo control) M950 S5 C"duex.pwm5" ;Q300 ; assign GPIO port 5 to heater5/pwm5 on expansion connector, servo mode
from what ive read you dont need to disable the heaters on the Duex5 if your running above RRF3.3 but I tried it anyway and just got error messages saying heaters not found so i commented them out
if I run M98 P"config.g" I get this
M98 P"config.g" TELNET is enabled on port 23 FTP is enabled on port 21 Error: Heater 1 not switched on due to bad model Warning: Heater 0 predicted maximum temperature at full power is 225°C Warning: Heater 1 predicted maximum temperature at full power is 708°C
Heater 1 error is due to the bed not being built yet so nothing there
When I connect the servo and power on everything this is what happens:
Analog servo connected (a little Emax ES08MA) - as soon as the power comes on it starts to rotate and does not stop - totally ignores and M280 E5 Sx commandsDigital servo connected (a Diymore DM996) no movement on power up, I issue any M280 P5 Sx command and it does nothing for about 30 seconds then starts to jitter randomly for no reason then might stop for a while and start again for no reason
Am I missing something critical here ?? Digital servos seem to do random junk and analog ones just wont stop moving!!
Ive seen other people get them working so I know it will work
Ive also tried connecting them to different PWM connectors with no luck and I connected a random digital servo I had knocking around with the same results
Any thoughts?
-
Ah should of also said I tried the other pin name options too so same response if I use duex.e6heat instead
-
@Chaos3d I don't see anything wrong with those M950 and M280 commands. Note, heater5 and pwm5 are not the same pin because the heater numbers on the DueX start at 3.
Have you tried using the other PWM ports, for example duex.pwm1 (assuming that you are not using heater 3)? Some PWM ports are driven by PWM peripherals in the MCU, others are driven by TC peripherals, and they have slightly different characteristics.
-
@dc42 thanks for the help - I have tried the duex.pwm1 and had the same results, not tried 2/3/4 though, as for heaters im not using any heaters attached to the duex5 - only the z steppers and their endstops are attached to the board the hotend heater is attached to the Duet.
In case there is something wrong in my Config.g here it is:
;; system and network -------------------------------------- M111 S0 ; Debug off M550 PChaos3DFDM ; Machine name and Netbios name (can be anything you like) M551 Preprap ; Machine password (used for FTP) M552 S1 ; start network module (must have been configured first with M587) M586 P2 S1 T0 ; enable telnet M586 P1 S1 T0 ; enable ftp M555 P2 ; Set output to look like Marlin G21 ; Work in millimetres G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves ;; geometry ------------------------------------------------ M669 K1 ; corexy mode M208 X0 Y0 Z0 S1. ; S1 = set axes minima M208 X460 Y400 Z420 S0 ; S0 = set axes maxima ;; velocity, acceleration, and current settings are in these macros M98 P"/macros/drive/xy_fullcurrent.g" M98 P"/macros/drive/z_fullcurrent.g" M98 P"/macros/drive/e_fullcurrent.g" ;; firmware retraction ------------------------------------- ;; Choose one as your default: ;M98 P"/macros/retraction/quiet_nozhop.g ;M98 P"/macros/retraction/quiet_zhop.g M98 P"/macros/retraction/pa_nozhop.g" ;M98 P"/macros/retraction/pa_zhop.g" ; drive --------------------------------------------------- ; ----+---- Z-Drives ; | 6 | 7 | ; ----+---- ; | 5 | 8 | ; ----+---- ; Front M584 X0 Y1 Z5:6:7:8 E3 ; motor bindings M569 P0 S0 ; X motor direction M569 P1 S0 ; Y motor direction M569 P3 S1 ; E0 motor direction M569 P5 S0 ; Z0 motor direction M569 P6 S1 ; Z1 motor direction M569 P7 S0 ; Z2 motor direction M569 P8 S1 ; Z3 motor direction ; endstops M574 X2 S1 P"!xstop" ; X max active high endstop switch M574 Y2 S1 P"!ystop" ; Y max active high endstop switch M574 Z2 S1 P"!duex.e2stop+!duex.e3stop+!duex.e4stop+!duex.e5stop" ; Z max active high endstop switch per z motor ; Motor steps per mm M350 X16 Y16 Z16 E16 I1 ; Use 1/16 microstepping with interpolation everywhere M92 X160 Y160 Z400 ; Set XYZ steps per mm (1.8deg motors & 0.9 for x/y) ;M92 X80 Y80 Z400 ; Set XYZ steps per mm (1.8deg motors) ;M92 X160 Y160 Z800 ; Set XYZ steps per mm (0.9deg motors) M92 E390 ; Set Extruder steps per mm (Hermes) M350 Z16 I0 ; disable Z interpolation ; Drive currents M906 X1200 Y1200 Z2800 E1000 ; XYZ and E current M906 I30 ; Idle current percentage M84 S120 ; Idle timeout ; Accelerations and speed M566 X900 Y900 Z60 E8000 ; Set maximum instantaneous speed changes (mm/min) M203 X18000 Y18000 Z3000 E15000 ; Set maximum speeds (mm/min) M201 X2000 Y2000 Z250 E1800 ; Set maximum accelerations (mm/s^2) M204 P1500 T2000 ; Set printing acceleration and travel accelerations ;M84 S3600 ; motor idle timeout ; Bed leveling params M671 X-46:-46:345:345 Y9:368:368:9 S20 ; Z leadscrews positions M557 X50:410 Y50:350 S50 ; Bed mesh grid ; thermal section ---------------------------------------------- M308 S3 Y"mcu-temp" A"Board" ; Board thermal sensor M912 P0 S-8 ; MCU tempurature sensor correction (subtract 8°K) ;Bed heater single thermistor setup, not used M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 A"Bed" ; configure sensor 0 as thermistor on pin temp0 ;M308 S0 P"bedtemp" Y"thermistor" A"Bed Pad" ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"bedheat" T0 ; create bed heater output on out0 and map it to sensor 0 M140 P0 H0 ; Mark heater h0 as bed heater (for DWC) M143 H0 S120 ; set temperature limit for heater 0 to 120C ;M307 H0 B0 S0.6 ; disable bang-bang mode for the bed heater and set PWM limit ;Bed heater dual thermistor setup ;M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 A"Bed Pad" ; configure sensor 0 as thermistor on pin bedtemp (pad sensor) ;M308 S2 P"e1temp" Y"thermistor" T100000 B3950 A"Bed Plate" ; configure sensor 2 as thermistor on pin e1temp (plate sensor) ;M950 H0 C"bedheat" T2 Q10 ; create bed heater output on out0 and map it to sensor 2 (plate sensor). Set PWM frequency to 10Hz ;M140 P0 H0 ; Mark heater H0 as bed heater (for DWC) ;M143 H0 P1 T0 A2 S115 C0 ; Regulate (A2) bed heater (H0) to have pad sensor (T0) below 110°C. Use Heater monitor 1 for it ;M143 H0 P2 T0 A1 S125 C0 ; Shut off (A1) bed heater (H0) if pad sensor (T0) exceeds 120°C. Use Heater monitor 2 for it;M143 H0 S120 ; Set bed heater max temperature to 120°C, use implict monitor 0 which is implicitly configured for heater fault ;M307 H0 B1 S0.6 ; Enable Bang Bang mode and set PWM to 60% to avoid warping ;HotEnd M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"Hotend" ; configure sensor 1 as thermistor (E3D V6 standard) 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 the nozzle heater and set PWM limit M143 H1 S300 ; set temperature limit for heater 1 to 300°C ;Chamber sensor (DHT22) ;M308 S7 P"spi.cs6" Y"dht22" A"Chamber Temp" ; define DHT22 temperature sensor ;M308 S8 P"S7.1" Y"dhthumidity" A"Chamber Hum[%]" ; Attach DHT22 humidity sensor to secondary output of temperature senso ; fans ---------------------------------------------------- ; part cooler M950 F0 C"fan0" Q20 ; part cooler, set to 20Hz PWM M106 P0 C"PartCooler" ; Name it "PartCooler" ;Hot End M950 F1 C"fan1" ; hotend fan, set to 20Hz PWM M106 P1 T60 H1 C"ToolFan" ; attach hotend fan to heater 1 and set activation temperature to 60°C ; controller / electronics fan ;M950 F2 C"duex.fan5" Q20 ; electronics compartment fan on duex, set to 20Hz PWM ;M106 P2 H3 T35:50 C"ElectronicsFan" ; fan is activated when MCU reports 35°C; runs on full speed from 50°C on ; chamber Fan ;M950 F3 C"duex.fan4" Q20 ; chamber fan on duex, set to 20Hz PWM ;M106 P3 T40:45 H7 C"ChamberFan" ; Chamberfan is activated when chamber thermistor reached 40°C; runs on full speed from 45°C on ;Servo config --------------------------------------------- ; Disable all heaters on Duex5 ;M307 H2 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H3 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H4 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H5 A-1 C-1 D-1 ; Disable heater (for servo control) ;M307 H6 A-1 C-1 D-1 ; Disable heater (for servo control) M950 S5 C"duex.pwm5" ;Q300 ; assign GPIO port 5 to heater5/pwm5 on expansion connector, servo mode ; tools --------------------------------------------------- M563 P0 S"E3Dv6" D0 H1 ; bind tool 0 to drive and heater G10 P0 X0 Y0 Z0 ; tool offset G10 P0 S0 R0 ; tool active and standby temp T0 ; activate tool 0 ; paneldue -------------------------- M575 P1 S1 B57600 ; activate paneldue ; define the z-probe, unsure, might not been needed ;M558 P5 C"e1stop" H5 F120 T3000 ; Z probe connected to Duet 2 E0 endstop input ;M558 P5 C"e1stop" A5 H1.45 R0.1 F65 T7000 A5 S0.01 B1 M558 P5 C"e1stop" A5 H1.45 R0.1 F65 T7000 A5 S0.01 ; Z probe connected to Duet 2 E0 endstop input ; read config-override.g M501
Ill try the other pins to see what i get
-
So I commented out all the servo stuff but kept the servo attached (ive moved it to pwm4 now on the board) and the analog servo runs constantly even after everything is removed, so something is very odd! - looks like there is a signal on that connection no matter what!
-
Any thoughts on the Servo port behaviour anyone?
-
One thing I have noticed during my testing is that whichever port I select (and pin name I use ) the correct Heater light lights up when I request the servo to move so if is use Duex.pwm4 the corresponding Heater light for the heater that shares that channel lights up it LED - so the request is going to the right place it just does not seem to control the servo.
I have tried all the PWM / servo connections on the Duex now, each one lights up the corresponding heater without issue none of the m actually move any of my servos in the expected way, the digital ones do not immediatly respond but after 15-30 seconds they jitter to life and move randomly, the analog one just turns constantly and never stops until you reset the board.
So I'm a bit stuck to be honest - adding another stepper just to rotate the kilicky mount seems a bit of overkill
-
@Chaos3d said in Strange Servo Issue with Duet2 and Duex5:
I have 3 servos to play with all of which are running from a dedicated external 5v supply the signal or pwm connection from the servo is the ONLY connection made to the Deux5 on PWM5 (duex.pwm5)
Have you commoned the grounds of the power supplies?
-
@dc42 the servos are all using an external power supply so they are not on a common ground, but I can do that - Will give it a try later today and see if it makes a difference
-
@dc42 Well that fixed everything!! - I didnt think that would be an issue but it was ! - I have all the servos running right off the board no issues works as expected - im not going to run the 5v off the board in the end so I just need to ensure the grounds are common and its sorted!
What a weird response though without the common ground between boards and power supplys
Still all working thank you so much @dc42 Ive been scratching my head over the last few days trying to find out what it was and it never occured to me it could be a common ground issue
-
-