Install Servo
-
Hello guys,
@dc42 helped me with my servo problem, but now i have a new problem. With M950 i does not define the Q value. The SG90 worked well for a time, but now two SG90 died. Standard Q Value is 500. In the duet3d docu for M280:
*S values below 544 are treated as angles, and 544 or greater as the pulse width in microseconds.
The relationship between the S parameter and the pulse width output to the port is the same as in other 3D printer firmwares, so that devices such as BLTouch will perform the same way. However, there is no standard for servos on the relationship between pulse width and servo angle. Therefore, for most servos the value of the S parameter does not equal the servo angle. Almost all servos accept a pulse width range of at least 1us to 2us, which corresponds to an S parameter range of 44.2 to 141.2 degrees. So for many servos, values in the range 44.2 to 141.2 or alternatively 1000 to 2000 will cover the full operating range of the servo.*
My servo works with:
M950 S1 C"!duex.fan8" Q>200 / Well at start with 500.
M280 P1 S0 to 140 / SBut i noticed the servo and the cable at the servo gets warm and after a bit of time the servo died.
When i google a bit of the sg90, the oparation frequency is 50hz. Q50 is not working. I build a second wiring harness with short cables, but same result.Maybe i test S1000 to 2000? Now i have no sg90 left, i ordered new ones.
Or is it a problem with fan8? Maybe 3.3V PWM voltage, and the servo need 5v? Datasheet is ok with 3.3V.
Tomorrow i can get a oszillioskop. Then i measure the pwm signal at the servo pin.Maybe you guys have a solution?
Thanks alot,
Moritz
-
@2500ccm as far is I know, the Q parameter in M950 sets the PWM frequency. You can check what the firmware thinks it is set to by sending M950 S[servo number]. Make sure each M950 P and/or S number is unique, eg P1, P2, S3 P4, S5 etc
How have you wires the servo to fan8 on the Duex? General, servos need a positive pwm signal, but fans have the MOSFET on the negative side. Also, the positive side of the fan output is VIN (12 or 24V usually) not 3.3V. So I assume you are using special wiring @dc42 suggested. Please post a picture of this wiring; it sounds like it might be incorrect.
Ian
-
@2500ccm the usual reason servos die is when you are try to drive them beyond one of their limits. This causes the motor to be continuously stalled, so it eventually burns out.
To avoid this, ensure that you only send M280 commands that are within the limits that the servo can handle without hitting an endstop.
Alternatively, after sending each M280 command, use G4 to delay a short while, then I think sending M42 P# S0 (where # is the same port number as you use in M280) will turn off the PWM and the servo may stop driving the motor. Please test this thoroughly before you rely on it in case M42 can interrupt an output pulse.
The default frequency when you use the M950 S command is 50Hz because this is appropriate for most servos. So you can leave out the Q parameter.
-
@dc42 @droftarts
sorry for my late reply. I can't answer this topic. It was a problem with confirm of my email adress.Wiring:
Bltouch is on E6_PWM
Servo is on Fan8-
Both power supply has the same external psu.
Fan8- cable goes over resistor to 5V at psu. Another cable goes from Fan8- to servo.Today i tested with my oszilloskop:
M950 S1 C"!duex.fan8" Q500 | M950 S1 C"!duex.fan8" Q50 | M950 S1 C"!duex.fan8"
Always 500HZ on Oszilloskop. Never 50HZ.M950 S0 C"duex.pwm5"
Runs on 50HZ.Signal Voltage is around 500mV to PSU Ground.
Signal noise is better on Servo. Think it is because of 3.9kohm resistor.Bltouch works well for about a year. No problems.
I ordered the servo on amazon. In the discription they write analog signal. I think they work on 50Hz.
Maybe the servos die because of the 10 times higher pwm signal? Why does M950 Q50 doesn't change frequency?Thanks!
-
I disabled heater 5 and disconnected the cables.
PWM4:
M950 P6 C"duex5.pwm4"
M280 P6 S100
FAN8:
M950 P1 C"!duex5.fan8"
M280 P1 S100
On this images you can see the signal is inverted. I think @droftarts is right and my wiring is wrong. @droftarts do you have a solution?
Thanks.
-
@dc42 for the future:
I changed with M950 Q500 and Q50 the frequency at "duex5.pwm4 and this works. 50HZ and 500HZ on the oszilloskop. But at "!duex5.fan8" it does not work. Alway 500HZ. Maybe a bug or problem with the !inversion?
-
@2500ccm I believe the PWM frequency can't be changed on duex fan ports
-
@droftarts
wiring diagram