Brushless motor/Servo control with PIC

Thread Starter

camerart

Joined Feb 25, 2013
2,997
Hi,
I am looking into controlling 3x Motos, plus 1x Servo using a PIC (18F46K20) this is a 3.3V device.

In the past I've played with PWM and possibly PPM, plus looking at the signals with an Oscilloscope, and now I'm trying to refresh my memory.

What is the best way to do this please?
Cheers, Camerart
 

Sensacell

Joined Jun 19, 2012
2,997
Start by defining you question a bit more.
"Controlling" a motor can mean many different things, do you want to turn it on and off? or commutate the coils directly?
Servo? do you mean a Radio Controlled Airplane Servo? or an industrial servo motor?
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997
Start by defining you question a bit more.
"Controlling" a motor can mean many different things, do you want to turn it on and off? or commutate the coils directly?
Servo? do you mean a Radio Controlled Airplane Servo? or an industrial servo motor?
Hi S,
Thanks.
I'm controlling a Quadcopter, so 3x prop motors, speed and 1x RC Servo movement.
C
 

John P

Joined Oct 14, 2008
1,972
I have to say, I am highly skeptical about the ability of an amateur to create code that would run a quadcopter. I certainly wouldn't try! If I wanted to control one, I would buy one and try to find some way to send orders to the processor that flies it--basically take over the controls, but keep the machine's systems intact.

Trying to run the actual motors is strictly for the birds.
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997
Hi J and N,
Ok, but if it was possible which of the 3x choices would you choose?
N's example uses DC motors.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997
DC motors can be simply controlled, but your prop motors(if BLDC) probably will need or have a ESC for each one. The ESC is a must have for BLDC control because they are electronically commutated not at all like a brushed motor.
Hi S,
I don't see many DC motors, that suit, so BLDC it is.
My original thought was PWM with ESC motor controllers, and I have all of these, and I think I could set them up ok, from a PIC. And of course the Servo would be the same.
I just thought I'd ask the experts first, to see if there were any other ideas, thanks.
C.
 

nsaspook

Joined Aug 27, 2009
9,703
Hi S,
I don't see many DC motors, that suit, so BLDC it is.
My original thought was PWM with ESC motor controllers, and I have all of these, and I think I could set them up ok, from a PIC. And of course the Servo would be the same.
I just thought I'd ask the experts first, to see if there were any other ideas, thanks.
C.
What will control the PIC and/or what are the duties of the PIC in the flight control system?

1650308977414.png
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997

nsaspook

Joined Aug 27, 2009
9,703
Hi N,
I'm just making it up as I go along! 4Years ago, I started a Tricopter control project: https://forum.allaboutcircuits.com/threads/remote-control-by-location-pic-in-oshonsoft.148795/
and have only just got to the stage of controlling the motors.
In between the PIC and the motors, is a KK2 board for level gyro control.
C.
You see, details like that make all the difference. From what I can quickly read the KK2 board is designed to send motor control signals to a ESC to control the motors. Still not sure what you want the PIC to do here if you already have a ESC for the motors and a proper flight controller.

https://mattrude.com/wp-content/uploads/2013/06/KK2.0-Multi-Rotor-Control-Board-User-Manual.pdf
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997
You see, details like that make all the difference. From what I can quickly read the KK2 board is designed to send motor control signals to a ESC to control the motors. Still not sure what you want the PIC to do here if you already have a ESC for the motors and a proper flight controller.

https://mattrude.com/wp-content/uploads/2013/06/KK2.0-Multi-Rotor-Control-Board-User-Manual.pdf
Hi N,
My normal procedure when starting a new section of a project, is to review what I first thought. If the forum had come up with a completely new idea, I would have considered it, and any information I give, would bias the result.

It looks as though PIC PWM Motor control is the way to go. The PIC would have 4x channels, sending out PWM to each Motor/Servo. The rest is just seeing what happens, and modify it as it proceeds.
C
 

shortbus

Joined Sep 30, 2009
9,370
It looks as though PIC PWM Motor control is the way to go. The PIC would have 4x channels, sending out PWM to each Motor/Servo.
I don't think so. It would control just the DC motor, but the BLDC prop motors still need the ESC for each motor, and they would be controlled by your KK2 board.
 

Thread Starter

camerart

Joined Feb 25, 2013
2,997
I don't think so. It would control just the DC motor, but the BLDC prop motors still need the ESC for each motor, and they would be controlled by your KK2 board.
Hi N,
Yes, of course, I was a bit lazy.
PWM it is then,
Thanks.
C
 
Last edited:
Top