HOWTO control servo motors #10443
Replies: 23 comments 79 replies
-
Superb, thanks for contribution! |
Beta Was this translation helpful? Give feedback.
-
"You must add support for Shutter in my_user_config.h file" How? example would be perfect..what to uncomment/include/define |
Beta Was this translation helpful? Give feedback.
-
my servo is mg995 360°, I can't control it, something is missing but i dont know what, it works from nodered changing the PWM1 values between 100 and 400 and sending MQTT message. I tried to follow this instructions but doesn't work. any ideas |
Beta Was this translation helpful? Give feedback.
-
Dear Dmitry, You post the most interesting motion control topics - Excellent quality of work! Thanks for your contributions! Spasibo! |
Beta Was this translation helpful? Give feedback.
-
@TrDA-hab thanks for your tut! Is the problem in the code or in the parameters? |
Beta Was this translation helpful? Give feedback.
-
i just noticed that the pwm is held and this causes the motor to "twitch" continuously in the end position. is it possible to detach the servo after the pwm has been set? |
Beta Was this translation helpful? Give feedback.
-
furthermore, it would be good if a "status 10" would be sent as soon as the servo (as shuttermode 5) has moved. this would then display the current data in hassio |
Beta Was this translation helpful? Give feedback.
-
ok, now i have set ShutterOpen/CloseDuration1 = 5 and it works (slowly) for positions >1 %. |
Beta Was this translation helpful? Give feedback.
-
I am trying to control a small servo using this FS90r, but failing miserably. Though I am not really new to tasmota, I am new to using servos, so I appreciate your patience.
Run commands in the console to configure the motor operation:
Running the command ShutterOpen1 starts the server, but it simply never stops until I restart the ESP.
I would be grateful for any help/advice. |
Beta Was this translation helpful? Give feedback.
-
PowerRetain 1 not storing Shutter position |
Beta Was this translation helpful? Give feedback.
-
tell me how to add a second scale for the second servo? i added pwm2 and a relay for it, but the second scale does not appear in the interface, is it possible at all? |
Beta Was this translation helpful? Give feedback.
-
Following you instructions, I can get a MG995 to turn clockwise, and counter clockwise, but can't get it to stop. |
Beta Was this translation helpful? Give feedback.
-
I was not able to get this to work at all on latest 12.3.1... all the
commands don't work at all. I have an Amewi servo from a toy car, which is supposed to turn between -90-90 degrees. Looking at the docs of the other servos, it should work with 2us...1520us @330Hz, which should translate to somewhat 1...304 for even with a 12.0.2 I can't get it to turn plausibly. Did anyone experience this as well? PS: actually 12.0.2 with |
Beta Was this translation helpful? Give feedback.
-
Playing around with it, I think that the Shutter control is probably the wrong way to do what I want. I want to control an RC car by directly setting the servo position and the speed controller over PWM. Because this involves MQTT, I settled on a different approach using Berry and just setting Still I wonder what the main source of latency is, and while this is probably the wrong discussion thread to ask this, is there anything known about this? Here are my considerations:
|
Beta Was this translation helpful? Give feedback.
-
Hi! Thanks to this walkthrough I was able to control my servo motor. Anyway I could stop the PWM automatically when calling ShutterOpen1 or ShutterClose1? |
Beta Was this translation helpful? Give feedback.
-
I was having trouble configuring a servo using Tasmota 12.3.1. The answer is that it is mandatory to set ShutterRelay e.g.
Could someone please add this to the instructions above - THX |
Beta Was this translation helpful? Give feedback.
-
hi it will not let me enter ShutterPWMRange1 100, 500 |
Beta Was this translation helpful? Give feedback.
-
Does tasmota only allow a servo to exist in two states, open or closed? There's no way to dynamically control what angle the servo is rotated to? |
Beta Was this translation helpful? Give feedback.
-
@stefanbode could it be, that with 13.0.0 the shutterinvert command doesn´t work? |
Beta Was this translation helpful? Give feedback.
-
This guide does not appear to work for the latest tasmota version (13.1.0). The official documentation works however: The difference is an extra |
Beta Was this translation helpful? Give feedback.
-
Hey Guys, Just wondering if anyone has had any issues using the pwm for shutters on the ESP32 WROOM module. I'm trying to setup a chicken coop controller to control the door of the coop at sunrise and sunset and some lights inside and out of the coop but the pwm shutter doesnt seem to want to work. I have used the settings specified in the instructions but nothing happens when I try to open or close the shutter. The servo is a linear servo Firgelli L12-100-100-6-R |
Beta Was this translation helpful? Give feedback.
-
Hey Stefan, So, I set the values in the examples at the top of this outside shuttermode so just in dimmer mode and the servo moves with pwm frequency of 200. Its drives full out 410 and full in at 210. Nathan |
Beta Was this translation helpful? Give feedback.
-
Thx for nice post. I just update my old arduino code to Tasmota firmware and try to get my old blinds working. My setup is 3pcs servo motors on different shutters. I try tasmota firmware with one servo and that works nicely. Now my question i dont have "main power relay" on every servo, i have ONE main power relay what gives power all my servos. How i get Tasmota firmware control that one main relay (D6 pin) always when some servo need to move. This is easy config on Tasmota if have relay every servo, but any tips how i get tasmota use only one output pin (D6) always when some of 3servos need to move. Thanks a lot for hints and tips :) |
Beta Was this translation helpful? Give feedback.
-
Using Servo Motor
Servo controlled by PWM pulses. The angle to which the servo should be set is regulated by the pulse width.
The servo has no direction of rotation (clockwise or counterclockwise), but only the rotation angle of the output shaft.
To operate a servo requires signal uses:
EN
(enable) turn on / off servo.PLS
(pulse) for controls rotation angl.DIR
(direction) only shows the direction of rotation, but does not control it.More information:
Example configuration
EN
andDIR
are onRelay1
andRelay2
respectively. Remember to use a non-inverse relay for the enable signal.The
PLS
signal is assigned as aPWM<x>
component where<x>
matches the number of the shutter (e.g.,PWM1
forShutter1
).The PWM frequency must be set with the
PWMfrequency 200
command. The frequency setting is a global setting all PWM components on the device. This means that all shutters on the device will operate at the same speed.Using the
ShutterMotorDelay
command to provide a slow increase / decrease in speed. This causes the driver to ramp the speed up and down during the defined duration. The change of the ShutterMotorDelay does NOT change the distance the shutter makes. This is very convinent to trim the accelerate and decelerate rate without changeing the distance.ShutterOpenDuration
andShutterCloseDuration
define the open / close time. By changing the times you adjust the speed of the servo output shaft.ShutterOpenDuration
andShutterCloseDuration
can be different.Using the
ShutterPwmRange
command to set the pulse width range. The calculation of parameters forShutterPwmRange
is obtained by dividing by 5 the minimum and maximum values of the pulse width range.Note!
Even within the same servo model, there may be manufacturing tolerances that result in a different operating range of pulse lengths. For accurate operation, each specific servo must be calibrated: through experiments, it is necessary to select the correct range that is specific to it.
For example the pulse width range for different servos:
ShutterPwmRange
109, 480ShutterPwmRange
100, 500Servo datasheet:
How to use it:
You must add support for Shutter in my_user_config.h file (оr flash your ESP8266 module with tasmota.bin file).
Run commands in the console to run the "Shutter" mode (you must first configure the GPIO!):
SetOption80 1
// enable Shutters support.Shuttermode 5
// enable Shutter mode for servo.PWMfrequency 200
// this is a global variable for all Servos.SetOption15 0
// to control the storage of values.Run commands in the console to configure the motor operation:
ShutterPwmRange1 100, 500
//this is a global variable for all Servos.ShutterOpenDuration1 0.5
// define the open time, in seconds.ShutterCloseDuration1 0.5
// define the close time, in seconds.ShutterMotorDelay1 0.2
// servo does not like abrupt start / stop.Restart 1
Run commands in the consolee to test the motor operation:
ShutterOpen1
// to open the SERVO#1.ShutterStop1
// to stop the SERVO#1.ShutterClose1
// to close the SERVO#1.Perform the shutter calibration (optional).
Motor Wiring Diagrams
One Shutter
Dual Shutter
Additional Information:
##Best regards,
TrDA.##
Beta Was this translation helpful? Give feedback.
All reactions