Floating servo control voltage causing a twitch?
SteveWoodrough
Posts: 190
Am I doing something stupid?· In order to prevent servo twitch I have to drive the stamp pin out HIGH.· Will I burn something out or use up too much current, etc. or is that just the way things need to be done?
Here's the scenario:
I'm trying to control an RC car ESC like a servo.· Once initialized, the ESC and the stamp work well together.· The trick is getting the ESC initialized.· The whatever the ESC "see's"· when the ESC set button is pressed is the Neutral or stopped speed.· This ESC likes 750 PULSOUT from the stamp.· To accomplish this, for the first few seconds after the STAMP "boots up " I send a 750 PULSOUT to the ESC.· After that period the ESC would be "ARMED" but a strange thing would happen.· Every 2.5 or so seconds the ESC would jolt the motor for a very short burst (~1/16 second).·
What I found was that if I did not drive the control pin HIGH (LOW had no effect) the ESC would jolt the motor for about 1/16 second every 2.5 or so seconds.·· This is not unique to the ESC.· I got the EXACT same response using my STAMP servos.· The servos too would jump at the same rate and frequency.· If the output pin is driven HIGH the servos did not twitch.
Is setting the pin HIGH when "not in use" the "proper" solution?
THANKS GUYS!!!
Attached is the stripped down code
Here's the scenario:
I'm trying to control an RC car ESC like a servo.· Once initialized, the ESC and the stamp work well together.· The trick is getting the ESC initialized.· The whatever the ESC "see's"· when the ESC set button is pressed is the Neutral or stopped speed.· This ESC likes 750 PULSOUT from the stamp.· To accomplish this, for the first few seconds after the STAMP "boots up " I send a 750 PULSOUT to the ESC.· After that period the ESC would be "ARMED" but a strange thing would happen.· Every 2.5 or so seconds the ESC would jolt the motor for a very short burst (~1/16 second).·
What I found was that if I did not drive the control pin HIGH (LOW had no effect) the ESC would jolt the motor for about 1/16 second every 2.5 or so seconds.·· This is not unique to the ESC.· I got the EXACT same response using my STAMP servos.· The servos too would jump at the same rate and frequency.· If the output pin is driven HIGH the servos did not twitch.
Is setting the pin HIGH when "not in use" the "proper" solution?
THANKS GUYS!!!
Attached is the stripped down code
Comments
Now the explanation: When the BASIC Stamp executes an END, it goes to sleep, reawakening every 2.3 seconds. When it does this, the pins tristate momentarily, which is what causes the glitch on your servo pin. The infinite loop just keeps the Stamp awake, preventing the sleep/wake cycle.
-Phil
Next question:
When working with signals that can trigger big events, like running an RC car ESC, is it a good idea to let the pin value float or would I be better off drving the pin value either HIGH or LOW? If I let the pin voltage float (I'm assuming it does) do I run the risk of a stray signal sending an unwanted command (blip)?
·