Controlling a servo motor

Thread Starter

vitoladas27

Joined Oct 24, 2020
5
I have a problem that is the following:
I have to control a servo motor between 3 positions, and i already can make the PWM signals to make the servo motor go to this 3 positions but i want to if i press one of two buttons the servo go to 1 position and when i drop the button the servo motor go to a default position and is the same for the other button, when i press go to the defined position and when i drop the button go to the default position!
And i make a logic circuit with the AND, XOR gates to control this process and doesnt work, someone can give a opinion or other path to make this idea ?
Thank you.
 

Attachments

Marley

Joined Apr 4, 2016
501
How does the controller know the motor position? You need some sort of feedback. A potentiometer, a rotary encoder or possibly simple position switches.
 

Thread Starter

vitoladas27

Joined Oct 24, 2020
5
How does the controller know the motor position? You need some sort of feedback. A potentiometer, a rotary encoder or possibly simple position switches.
The controller doesnt need to know the motor position, i only have to conect the right resistor to the discharge pin when the button is pressed.
 

Alec_t

Joined Sep 17, 2013
14,192
Is the default position between the two defined positions, or is it clockwise/counter-clockwise to both? Two resistors switched in series or parallel with a default resistor may be sufficient for setting the pulse widths.
 

Alec_t

Joined Sep 17, 2013
14,192
In that case the circuit below should work. The resistor values would need tweaking to suit the 3 positions required.
Note that the pulses are negative-going, S1 is a NO type and S2 is a NC type.
Inverters could be added to invert the pulse polarity and S2 logic if wanted.
3-position RC servo.jpg

LTspice sim file attached.
 

Attachments

Thread Starter

vitoladas27

Joined Oct 24, 2020
5
In that case the circuit below should work. The resistor values would need tweaking to suit the 3 positions required.
Note that the pulses are negative-going, S1 is a NO type and S2 is a NC type.
Inverters could be added to invert the pulse polarity and S2 logic if wanted.
View attachment 259447

LTspice sim file attached.
Sorry i forgot to refer, but i can't use micro controllers and NC switches.
I only have transistors and logic gates to solve the problem.
 

Alec_t

Joined Sep 17, 2013
14,192
I only have transistors and logic gates to solve the problem.
So why does your post#1 schematic include a '555 ?

Edit:
Providing you can tolerate a ~3% variation of pulse width over a 10-50 °C temperature range, then a much simpler circuit using just 1 logic gate, 1 diode, 2 caps, 3 resistors and 2 NO switches could be used.
 
Last edited:
Top