RRF3 and servo
I'm trying to drive a servo with RRF3, on a Duet2Wifi. I configured the servo output as following:
M950 S0 C"!fan0" ; Servo 0 connected to 'fan0' pin (inverted)
and I drive it using :
M280 P0 S1500
but I does not work. I triple checked my wiring, and it is correct (I'm using an external power supply, and ground are common). I inverted the output, as I used I1 in the M280 comand under RRF2.
What am I doing wrong?
deckingman last edited by
@fma I don't use any servos so may not be able to help. But just looking at the example here https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_M280 shows:
M280 P0 S80 ; set 80deg servo position on GPIO port 0
So going by that, your M280 P0 S1500 would be setting the servo position to 1500 degrees, which doesn't make any sense to me.
Nope, values above 200 are taken as µs, and below are taken as degrees.
Anyway, I tried with values in degrees, like 0, 90 and 180, and I get the same (non) result.
hi @fma what was our old M280 code on RRF2. have you tried without inverting the pin just to check?
The old M280 code has the I1 parameter, that's all. I'll try without inverting the pin; maybe using S in M950 already does that...
Does that command return an error message if you send it from the command line?
No, no error.
What does M950 S0 with no other parameters return?
I checked that, and it looks ok:
GPIO/servo port 0 pin !fan0 frequency 50Hz
I tried without inverting, and I get the same result.
I also checked on fan1 output: same result.
DIY-O-Sphere last edited by DIY-O-Sphere
I had the same issue driving a servo on the fan output (Duet Maestro)
Connect a pullup resistor of around 1K between the servo control (Fan PWM) and +5V.
You mean a pullup, according to your drawing.
I'll try that...
Bingo! In fact, it makes sens, as the pwm output only pulls the signal to ground... So, it has to be pulled up in order to have a high state voltage value!
I think I had this resistor with RRF2, but as I didn't use the servo since several months, I forgot that