Maker Pro
Maker Pro

Controlling 2 servos at the same time?

Rushmoore

Jun 21, 2015
26
Joined
Jun 21, 2015
Messages
26
Hi there,

I am making an animatronic Wheatley from portal 2 and I am working on the eye lid movement at the moment. I have to eye lids which are about 8 cm across and are made out of foam. I am going to use two servos to move the eyelids.

I want to be able to control the servos at the same time, I will be using a 2 axis joystick to control the servos, but I will only use the up down motion to control the servos. I am very ignorant when it comes to this sort of thing. I am not sure what code I would need to write to control the servos using the joystick, could anyone help me with this? Any advice would be greatly appreciated
smiley.gif


Many thanks

Rushmoore
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Hi there,

I am making an animatronic Wheatley from portal 2 and I am working on the eye lid movement at the moment. I have to eye lids which are about 8 cm across and are made out of foam. I am going to use two servos to move the eyelids.

I want to be able to control the servos at the same time, I will be using a 2 axis joystick to control the servos, but I will only use the up down motion to control the servos. I am very ignorant when it comes to this sort of thing. I am not sure what code I would need to write to control the servos using the joystick, could anyone help me with this? Any advice would be greatly appreciated
smiley.gif


Many thanks

Rushmoore
Please clarify... Are you looking to control both servos independently or in unison?
If you want to control the top and bottom eyelid at the same time you can get creative and use 1 servo and a linkage of some sort, or you could tie the data line of both servos together and simply mount the servos physically 180 degrees out of phase to each other so one goes up and one goes down at the same time.
 

AndyTherro

Nov 26, 2014
2
Joined
Nov 26, 2014
Messages
2
Hi there,

I am making an animatronic Wheatley from portal 2 and I am working on the eye lid movement at the moment. I have to eye lids which are about 8 cm across and are made out of foam. I am going to use two servos to move the eyelids.

I want to be able to control the servos at the same time, I will be using a 2 axis joystick to control the servos, but I will only use the up down motion to control the servos. I am very ignorant when it comes to this sort of thing. I am not sure what code I would need to write to control the servos using the joystick, could anyone help me with this? Any advice would be greatly appreciated
smiley.gif


Many thanks

Rushmoore

Hello there!

IF you are looking for individual PWM control for each servos using a microcontroller then there are many PIC microcontrollers that have up to 4 PWM modules. You can also do set them up symmetric to eachother like Gryd3 stated here above. If the the microcontroller is only suppose to control these two servoes you can use almost any µcontroller if you do software wise PWM.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Actually, the PWM modules are not good for controlling servos because the frequency is too low. An interrupt driven software PWM works better.

Bob
 

AndyTherro

Nov 26, 2014
2
Joined
Nov 26, 2014
Messages
2
Actually, the PWM modules are not good for controlling servos because the frequency is too low. An interrupt driven software PWM works better.

Bob

I have used the standard PWM modules for controlling servoes many times without problems in PIC's such as PIC16F887 for example. The standard 20mS (50Hz) period used often without problems. Can you explain why you think they are a no-go for controlling servoes?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Well, you can get a 20ms period, but you have to run the processor at 893KHz. ànd then, the resolution for the duty cycle is 1 part in 50,which might be enough. I prefer not to waste 96% of the processing power to get a 5 bit PWM.

Bob
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
I have a simple program to operate a servo at the required speed or follow a joystick .You can parallel as many servos as you like.
 
Top