I plan to have two servos for ailerons of my aircraft.
The issue is that the 2 servos do not move in sync. They should move opposite to each other at the same time, but sometimes they do, sometimes they don't. They are both powered by the 5v ouput, if I remember correctly, from the arduino uno board.
That's probably the problem. The Uno 5v pin is not intended to power high current devices like motors and servos. If you power the servos with a separate supply does the problem exist?
I'm a hobby microcontroller-user and a hobby RC-pilot.
As an airplane can crash down out of the air I recommend that you use a
ready to use transmitter / receiver you can buy off the shelf instead of trying to develop your own remote-control based on a microcontroller.
At hobbyking a complete set with transmitter and receiver start at $30
Of course it is fun to create things from scratch.
If you insist on using a microcontroller I recommend that you start with a car instead of a plane. Because a car just might bump into some obstacle maybe flip on the back and that's it without getting damaged or destroid. Or it might just stop driving which is no problem.
An airplane that looses control through a software-bug will 100% crash down.
How many material can you buy for $30 to build up a new plane?
If you have achieved a high reliable code you can move on from the car to the airplane.
If you are a beginner about RC-flying that adds another layer of learning
You should start with an airplane that is easy to fly and self-stabilising.
I agree with red_car : it is the problem.
You can use lithium battery. Take care about the voltage of your servos.
Here an example : https://www.tinkercad.com/things/2W13kjSBVSl
You can see that only 1 "little" servo like SG90 work with a current up to 100mA so you need at least 200mA for your project, only for the servos.
I guess you servo are a bit bigger than the SG90 ?
Stall current (at locked): 1300±40mA (4.8V ) 1600±50mA(6v)
Idle current (at stopped): 6±1mA (4.8V ) 6±1mA(6v)
Running life(at no load): >350000 Turns(4.8V ) >320000 Turns(4.8V )
Consider the implications of the Running current and Stall current; conservatively, remember that the Starting current approximates the Stall current, until the arm begins to move. Finally, look carefully at your application, to ensure that at the ends of motion, you're not going into stall by demanding a position the servo doesn't quite get to.
Moral of the story? Find the specs for the servo you're actually using.
C
Not true. The SG90 briefly draws the start/stall current every time it starts moving. That is around 1 Ampere, depending on the manufacturer.
A good rule of thumb is to have a separate servo power supply capable of providing 4.8 to 6V at 1 Ampere per servo (for small servos like the SG90) or 2.5 Amperes per servo for larger servos (MG996R).
@jremington Well, that might be a tad conservative, if you can guarantee not moving more than one at a time, AND turn off the servo between every move, and guarantee you don't stall due to end-of-travel. etc. etc.
But then again, you pretty much restated what I had already posted, so I guess that's a for my post.
C
As was I. The constant mythmaking that an SG90 servo only needs 100 mA can only be countered by providing links to SG90 Servos that draw one heck of a lot more. Additionally, the application the servo is used for is very important. If the servo is driven against hard stops and not tuned, then the stall current can become the 'at rest' current, for a little while anyways.