Go Down

Topic: Controlling brushless motor with I2c Pca9685 (Read 755 times) previous topic - next topic

rossi86m

Hey guys

I am building a bicopter and for some reason, that i am think is an interference between the timers that i use to control the motors and the interrupts that i use to get the signals from the RC control, I am getting ticks on the servos

Someone recommend me to use a I2c Pca9685 to control both the servos and the motors of the bicopter.

I would like to know your thoughts before doing it

Attached you will find the flight controller code that I am working on

Thanks in advance,
Marco

Northof49

#1
Feb 08, 2019, 09:40 pm Last Edit: Feb 08, 2019, 10:14 pm by Northof49
My observation is that using an Arduino to drive servos results in twitching servos.  Nothing you would notice while they are in motion, but if they are supposed to stand still, they twitch.  Some brands worse than others.   I switched to pca9685 and they are rock steady.

What are you using to drive the brushless motors?  A standard RC brushless motor controller that takes servo style pwm inputs?  Should be as simple as controlling a servo.  If so, take a look at this article:

https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all


rossi86m

Northof49 Thanks for the answer!!!

To control the brushless motors I a using a esc connected to the arduino.

What I am was wondering is if I can connect the esc to the controller you suggested to also control the brushless motors.

I will give the pca9685 a try I think it will give me the accuracy that i need to have the bicopter steady

If you have any other suggestion pls shoot!!!!

Thanks a lot !!!!!!

vinceherman

#3
Feb 11, 2019, 03:00 pm Last Edit: Feb 11, 2019, 03:00 pm by vinceherman
Some of the PCA9685 that I purchased have shipped from the factory with the headers attached.  I think these came from AliExpress.  Others needed the headers soldered on. (maybe adafruit?)

If I were putting this in a copter, I would want it without headers and just solder on the 4 or so servos worth of headers that I need.

Northof49

You should be able to control all the servos and the ESC (that expects pwm servo like input) off the  pca9685 controlled by your Arduino.

rossi86m

Hello!!

I am builfing a bicopter flight controller from scratch

Recently I bought a pca9685. I had no problem controlling the servos with it, but when I try to control the brushless motors I had no luck yet

I was able to arm it with this
servos.setPWM(3,0,1);

But I have no Idea on how to make it run. Which is the min and max throttle. I still not ableto get it right

How can I canfigure the ESC. Like when I start the ESC with the radio controller at full throttle and the move it down to 0 throttle

I hope I was clear

Looking forward to hearing from you guys

Thanks in advance

Marco

slipstick

If you post your code it will be easier to help with it. I'm guessing that you're using the Adafruit_PWMServo library but what else you're doing I have no idea. E.g. what PWM frequency have you set?

It might also help to know what ESC you're trying to run because they're not all the same. Have you calibrated the SERVOMIN and SERVOMAX to suit the ESC? What values?

Steve

rossi86m

#7
Aug 04, 2019, 11:59 pm Last Edit: Aug 05, 2019, 12:01 am by rossi86m
Steve thanks for taking the time.

Sorry for the lack of context.

Yes I am using adafruit library.
I am setting the frequency to 60hz
servos.setPWMFreq(60);


When I was using the servo library to set up the motors I used writemicroseconds(2000) as full throttle and writemicroseconds(1000) as no throttle. I don't know how to calibrate it using the pca9685

The esc is a generic one running simonk

Hope it helps

Looking forward to hearing from you.
Marco


rossi86m

Guys I finally bought the pca9685. I was able to control the servos but i am having a hard time calibrating and controling my two brushless motors

How do I send the signal of min and max throttle to the esc using the adafruit_pwmservodriver library?

Thanks,
Marco

rossi86m


ballscrewbob

Topics MERGED.
Please keep it all in the same place and don't throw the same topic around.
That simply wastes peoples time and effort and makes it harder for anyone wanting to help.

Bob.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

rossi86m

Sorry for that my mistake

Any idea on how should i make the communication between the pca and the esc?

Thanks

rossi86m

Hey guys Y found the answer

I use a 50hz frequency

and the 0 throttle is a value of 210 and full throttle 410

If anyone needs the code just let me know

Go Up