Release/Stop Driving Servo?
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 2
- Joined: 12 Jul 2017, 07:21
Release/Stop Driving Servo?
hi, i'm successfully controlling a servo over mqtt using the Servo command. however, i'd like to stop the servo pwm signal after a few seconds to conserve power (and avoid the subtle noise it makes). i've tried sending a GPIO 0 command but that seems to have no effect after the Servo command is used. i need to reboot to get it to stop.
is there a way to do this with ESPEasy? i had this working fine with nodemcu, but switched to ESPEasy to get away from worrying about memory constraints...
is there a way to do this with ESPEasy? i had this working fine with nodemcu, but switched to ESPEasy to get away from worrying about memory constraints...
-
- New user
- Posts: 2
- Joined: 12 Jul 2017, 07:21
Re: Release/Stop Driving Servo?
started poking around in the code and i don't see Servo::detach() called anywhere, so i'm guessing the answer is "no". i'll try coding up something to address this and will contribute back if it works.
-
- New user
- Posts: 1
- Joined: 28 Jul 2017, 14:50
Re: Release/Stop Driving Servo?
Hi,
I have exactly the same problem! I have already tried to pull the Servo GPIO LOW, but without success. It keeps "sending" the PWM signal
I have exactly the same problem! I have already tried to pull the Servo GPIO LOW, but without success. It keeps "sending" the PWM signal
-
- New user
- Posts: 1
- Joined: 02 Jan 2018, 00:49
Re: Release/Stop Driving Servo?
I am having the same problem. The servo keeps buzzing or ticking once it reaches position. I am trying to control shutters with it and if there is any small load on it, the servo ticks to try and maintain position. This is not desireable as the general position is fine with me.
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Release/Stop Driving Servo?
I have the same problem. It kills the servos rather quickly... a fix would be desirable.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Release/Stop Driving Servo?
If it needs no force to keep the position, just detach the servo from ESP and enjoy the silence (a mod of the source code is necessary). 

-
- Core team member
- Posts: 9905
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: Release/Stop Driving Servo?
I added an issue about this on Github.
https://github.com/letscontrolit/ESPEasy/issues/672
https://github.com/letscontrolit/ESPEasy/issues/672
-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Release/Stop Driving Servo?
I'm not sure if it is a real issue. The servos just do what they have to do: Keep the set position.
-
- Core team member
- Posts: 9905
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: Release/Stop Driving Servo?
But do they change position if you go to 0% duty-cycle?
Other change could be to set an upper and lower limit on the allowed PWM value.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Release/Stop Driving Servo?
Yes, aren't they supposed to work that way? To be able to stay in the position with no power applied you'd need more expensive servos?
More on the subject:
https://arduino.stackexchange.com/q/24783
More on the subject:
https://arduino.stackexchange.com/q/24783
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Release/Stop Driving Servo?
I haven't tried it yet. For my purposes I detached the servo from ESP. So it has no power at all (I hope...) but reverts a bit back due to the mechanical force.
-
- Normal user
- Posts: 26
- Joined: 18 Nov 2016, 18:35
Re: Release/Stop Driving Servo?
I have the same problem, it's for my catfood, it's not important to keep the position.
The noise is stressful
How to do ? I can use mqtt command (nodered) or url commad (domoticz).
Help us
The noise is stressful

How to do ? I can use mqtt command (nodered) or url commad (domoticz).
Help us

-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Release/Stop Driving Servo?
Hi vadervader wrote: ↑02 Jan 2018, 22:03I haven't tried it yet. For my purposes I detached the servo from ESP. So it has no power at all (I hope...) but reverts a bit back due to the mechanical force.
Can you elaborate on necessary changes in source to de tach servo?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 190
- Joined: 12 Oct 2017, 20:46
Re: Release/Stop Driving Servo?
Simply power servo through transistor driven by another gpio pin and switch power off, when servo is not driven to move.
But servo can move under some force then, because it is not held in its position by motor force.
But servo can move under some force then, because it is not held in its position by motor force.
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Release/Stop Driving Servo?
Sure thats a way to do it, but I think there must be a software fix too using the detach command in the arduino source code.
I think there are many applications where a holding torque through servo power is not required, but servo buzz is critical.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 127
- Joined: 09 Feb 2017, 19:35
Re: Release/Stop Driving Servo?
edited the servo file to detach after 2 seconds. works perfectly.
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Release/Stop Driving Servo?
Which file (name of the ino) and what source code has been changed ?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 127
- Joined: 09 Feb 2017, 19:35
Re: Release/Stop Driving Servo?
i was in process of finding it....
I've been using mine like this for many months now without issue
it's _P001_Switch.ino
find:
Code: Select all
{
case 1:
//IRAM: doing servo stuff uses 740 bytes IRAM. (doesnt matter how many instances)
#if defined(ESP8266)
servo1.attach(event->Par2);
servo1.write(event->Par3);
#endif
break;
case 2:
#if defined(ESP8266)
servo2.attach(event->Par2);
servo2.write(event->Par3);
#endif
break;
}
Code: Select all
{
case 1:
//IRAM: doing servo stuff uses 740 bytes IRAM. (doesnt matter how many instances)
#if defined(ESP8266)
servo1.attach(event->Par2);
servo1.write(event->Par3);
delay(2000);
servo1.detach();
#endif
break;
case 2:
#if defined(ESP8266)
servo2.attach(event->Par2);
servo2.write(event->Par3);
delay(2000);
servo2.detach();
#endif
break;
}
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Release/Stop Driving Servo?
thx
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- Normal user
- Posts: 225
- Joined: 31 Aug 2016, 12:52
Re: Release/Stop Driving Servo?
Hi Guys,
Is it possible to add the 'detach feature' as e.g. a command in ESP Easy? I'm not capable of changing the source-code and re-compiling, so it would be a nice addition
Is it possible to add the 'detach feature' as e.g. a command in ESP Easy? I'm not capable of changing the source-code and re-compiling, so it would be a nice addition

-
- Core team member
- Posts: 9905
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: Release/Stop Driving Servo?
Who is online
Users browsing this forum: Anthropic Claude Bot [bot] and 25 guests