Go Down

Topic: Servo twitching - Bicopter (Read 932 times) previous topic - next topic

rossi86m

Hey all!

I am building a bicopter for some time now on my free time. I am polishing the last things but there is something i can not fix.

For some reason once I start the brushless motors the servos start moving like crazy and i dont know why

I am using the following parts:
- 12v lipo battery
- 2 2204 brushless motors
- 2 18A simonk esc
- 2 mg90 servos
- mpu6050 gyro
- pca9685 servo driver
- arduino nano
- LM2596S voltage regulator
- 4channel rc receiver

Attached you will find
- My code
- The connection diagram
- A video of how the servos get crazy

Video: https://photos.app.goo.gl/GoPZ3pwnSEA6Dp1t8

Let me know if I am missing something

I appreciate your help

Thanks in advance!
Marco


jremington

When servos "go crazy", it is almost always due to inadequate servo power supply. Budget for 1 Ampere per servo.

The posted connection diagram is completely useless.

rossi86m

Thanks for taking the time

Let me know what other info is useful, so you can give  me an answer

Cheers,
Marco

jremington

A complete and accurate schematic diagram, with specifications for all the components including the batteries and voltage regulators, is required to diagnose power supply problems like this.

rossi86m

#4
Aug 23, 2019, 04:33 pm Last Edit: Aug 23, 2019, 04:34 pm by rossi86m
Thanks again for taking the time.

I am learning on the go.

Here is the schematic, I hope it helps. Pls let me know what other info I can include
The battery is a 2200 mah lipo
Thanks in advance

Looking forward to hearing from you!

Cheers!
Marco

jremington

The diagram does not show how the servos are powered, which is most likely the problem.

rossi86m

The diagram does not show how the servos are powered, which is most likely the problem.
They are both connected to the pca9685.
It has 3 pins for each servo
- Signal
- v+
- gnd

There is more clear
https://i.imgur.com/pyHjBTe.png


Cheers!
Marco

slipstick

#7
Aug 23, 2019, 05:13 pm Last Edit: Aug 23, 2019, 05:18 pm by slipstick
Unfortunately the PCA9685 is powered from the 5V pin on the Arduino...which will be at least part of the problem. That pin can only supply a maximum of around 400mA and just one of the servos may need more than that. The two motors, which according to your schematic are also powered from there, will definitely need a lot more than that.

Is your regulator at bare LM2596 (in which case it's missing most of the components needed to make it work properly) or a module which uses an LM2596 (if so what module is it?). And what voltage is it supplying? You need at least 7.5V to use Vin.  It would be much more sensible to use a 5V regulator and connect it to the servos and Arduino 5V pin and not mess about with Vin at all.

Steve

rossi86m

I am using a module. It is set to 5v
This is the module (https://www.amazon.com/Arduino-compatible-module-adjustable-regulator/dp/B01L6M8CKA)

You suggest to connect the servos directly to the LM2596 module instead of the pca9685?

Cheers!
Marco

slipstick

No. I suggested connecting the output of the 5V module to the PCA9685 and to the 5V pin of the Arduino. Do not connect anything to the Arduino Vin pin.

But you will need more power for the 2204 motors. 5V and 3A is nowhere near enough.

Steve

rossi86m

#10
Aug 23, 2019, 05:44 pm Last Edit: Aug 23, 2019, 05:51 pm by rossi86m
Ok a will check that connection

The ESCs of the motors are connected directly to the battery. I attached an image to double check if i understand it right

I will get back to you after trying that!

Thanks!
Marco

jremington

Never power motors or servos from the 5V output of the Arduino.

rossi86m

Ok I will change the connection to power the pca9586 from the vin pin


Thanks!!! i will let you know how it goes

slipstick

#13
Aug 23, 2019, 08:27 pm Last Edit: Aug 23, 2019, 08:32 pm by slipstick
Ok I will change the connection to power the pca9586 from the vin pin
Which part of "Do not connect anything to the Arduino Vin pin" was too difficult for you to understand?

That's what your last diagram showed. The PCA9586 is powered direct from the 5V regulator and the Arduino is also powered from there. That is correct.

Of course it doesn't help that your diagram is rubbish because it shows the motors powered from the PCA9586 and no direct connections to the battery. If you won't provide accurate information it may be impossible to help you.

Steve

rossi86m

#14
Aug 23, 2019, 08:43 pm Last Edit: Aug 23, 2019, 08:44 pm by rossi86m
Of course it doesn't help that your diagram is rubbish because it shows the motors powered from the PCA9586 and no direct connections to the battery. If you won't provide accurate information it may be impossible to help you.

Steve
You are right regarding the diagram, I have just adjusted it.
Change how motors are power and the 5v issue

attached you will see the diagram that i will test

I appreciate you take the time to give me this advice

I will test this new diagram and let you know

Thanks!!
Marco

Go Up