12v Servo Control 1LC Tool Board
-
Hi!
Should it be possible to drive a 12v servo using the 1LC Tool Board? I'm powering the tool board and Duet3 Mini 5+ with a 12v power supply capable of 7 amps.
I've tried the following...a) I originally tried running the servo off of
out2
but It wouldn't move, so I figured the 0.8 amp limit wasn't sufficient to drive the servo.b) So I tried...
- The power and ground wires of the servo routed through to
out0
(because of the higher amp limit 5amps) (still at 12v - Vin == 12v) - The signal wire of the servo running to
out2.tach
The config I'm using is
M950 S0 C"121.out2.tach" Q250 M950 S0 C"121.out2+out2.tach" Q250 ; Doesn't work "invalid pin name" M280 P0 S1500 ; Doesn't work, no movement, no sound from the servo M280 P0 S45 ; Doesn't work, no movement, no sound from the servo
I've tried the same set up using
out2
as well (instead ofout2.tach
)The tool boards CAN address is the default
121
and I can communicate with the tool board,M115 B121
andM122 B121
commands return results as expected.The servo's manual claims that the signal line can operate between 50-330Hz, and the operating voltage is between DC8.4V~12.6V.
I feel like I might be over looking something simple here. Any help would be greatly appreciated!
- The power and ground wires of the servo routed through to
-
@toms I think there are a few things wrong
.
First, wiring. The positive and negative wires of the servo need to be connected to +12V and GND on your separate 12V PSU. Make sure the GND of this PSU is connected to the GND of the PSU that supplies the 1LC. See the image on the servo main page to identify the wires.The signal wire needs to be connected to a PWM-capable pin; out2.tach is a digital input pin, not a PWM output pin. OUT_0, OUT_1 and OUT_2 (VIN signalling, 12V maximum for this servo ) or IO_0 (3.3V signalling) can be used. However, I can't see what the signal voltage should be from the servo specification; usually 3.3V is okay.
Next, configuration. Assuming you are using 121.out2 for the signal wire, send
M950 S0 C"121.out2" Q250
. The frequency set by M950 Q250 (250 Hz) is within the range of the specifications (30-330Hz). The pulse width you send with M280 must be between 500 to 2500 uSec, so don't send S45; you may damage the servo.For more info and recommendations, see https://docs.duet3d.com/en/User_manual/Connecting_hardware/Motors_servos
Ian
-
Hey @droftarts
Thanks for clarifying that
out2.tach
is an input pin, I saw three pins and just assumed it was power, ground and signal.I think it ended up being a signaling voltage issue! I tried switching the signal wire over to
io0.out
like you suggested and it worked! So I guess the servo wasn't responding to 12v PWM signals. -
The current set up that's working now...
- 12v power supplied to the 1LC Tool Board
- Power and ground wires of the servo running to
out0
power and ground screw terminal - Signal wire running to
io0.out
The reason for the power and ground routed through
out0
is due to only having a single power and ground line running from the main board to the tool board. I guess I could splice the power lines atVin
but usingout0
lets me cut power to the servo using theM42 P0 S0
command.
The
config.g
fileG4 S2 ; wait for expansion boards to start M950 P0 C"121.out0" ; out0 5amps @ Vin (which is 12 volts in our case) M950 S1 C"121.io0.out" Q250 ; io0.out 5v PWM capable, Q = 250Hz PWM Frequency
Interacting with the servo
M42 P0 S255 ; Supplies the Servo with 12v M280 P1 S600 ; Moves the servo to lowest position M280 P1 S2500 ; Moves the servo to highest position M42 P0 S0 ; Turns the servo off
I know this probably isn't the intended use case for the 1LC Tool Board but it seems to be working.
Thanks for the help, I really appreciate it!
-
@toms with that wiring configuration there is a danger that you will feed 12V into the io0.out pin when the tool board is powered up. You should connect the servo negative supply wire to ground instead. The 4-pin output connector OUT1 has both +VIN and ground connections if you fit the VOUT jumper.
-
Hey @dc42, thanks for the heads up! So
out0_neg
isn't ground?So the new, better, approach is...
- 12v power supplied to the 1LC Tool Board
- Power and ground wires of the servo running to
out1.VOUT
andout1.GND
pins (with the VOUT Jumper installed for 2amps @ 12v) - Signal wire running to
io0.out
The
config.g
fileG4 S2 ; wait for expansion boards to start M950 S0 C"121.io0.out" Q250 ; io0.out 5v PWM capable, Q = 250Hz PWM Frequency
Interacting with the servo
M280 P0 S600 ; Moves the servo to lowest position M280 P0 S2500 ; Moves the servo to highest position
-
@toms out0_neg isn't ground until out0 is turned on.