How to setup and configure a servo
-
I don't have a Duex, but I'll take a shot:
According to THIS image, you are going to use PWM1 which is pin E2_PWM
I tried the obvious pin names of E2_PWM and PWM1 which were both wrong, so I googled for duex5 pin names and after looking at some dead-end pages, I found THIS page which lists the pin names in RRF3.
So I see this is the way to configure your pin:
M950 S1 C"duex.pwm1"
And, going to THIS page, this is the way to control the servo:
M280 P1 S80
I don't have one of these boards and I don't know which version of firmware you are running, so some of this might not work, but the links should allow you to make some more progress.
-
I am running RR2.....does the following make sense?
Add to the config.g file to configure the port for PWM1 running RR2.
M42 P3 S1500;
P3 is the pin for RR3, but I couldn't find any RR2 pin numbers, S1500 move the servo to the center.For my gcode commands:
M280 P3 S1000 to move to one extreme
M280 P3 S1500 to move the middle
M280 P3 S2000 to move to the other extremeLooking for someone who understands this before I try it.
I have also seen where the pin # might be 8
Scroll down to PWM1 pins for heaters
https://docs.duet3d.com/Duet3D_hardware/Duet_2_family/Duet_2_WiFi_Ethernet_Hardware_Overview -
@dmc456 pin names (RRF3) and numbers (RRF2) are here:
https://docs.duet3d.com/Duet3D_hardware/Duet_2_family/DueX2_and_DueX5#inputoutput
Pwm outputs are shared with heaters, and pwm1 is heater 3 so you can’t connect a heater there if using the PWM pin. PIN number is 3. AddM307 H3 A-1 C-1 D-1
before M280 to free it up.Edit: no need to use M42, just use M280. You may need to invert output with I0.
Ian
-
@droftarts thanks for the help!
-
@dmc456 see my edit, only use M280!
Ian
-
Please confirm
The M307 and M42 go in the config.g file to assign the pin?
The M42 is the gcode command used to move the servo which I can use in my slicer software.
-
@dmc456 M307 to free up the pin in config.g. You don’t need M42 or M280 in config.g in RRF2, unless you want the servo powered up when the machine starts.
M42 accepts S parameter values 0 to 255. See You will have to experiment carefully what values work for your servo, if you can’t output M280 commands from the slicer, or use a post processing script to replace M42 with M280.
Ian
-
-
I'm measuring 3.3 V at P3. How do I change it to 5V.
-