Shop OBEX P1 Docs P2 Docs Learn Events
control a RC aircraft electric motor from the Propellor — Parallax Forums

control a RC aircraft electric motor from the Propellor

jekain314jekain314 Posts: 3
edited 2012-05-05 08:24 in Propeller 1
I want to control a RC brushless electric motor from the Propellor.
This is the type of motor used on common RC aircraft.

(1) Do I need to use a ESC for brushless motors with the motor --- my guess is yes.
(2) if yes, I assume I connect the 3-wire connector from the ESC that normally goes to the receiver to the propellor.
(3) I have the Propellor C3. If yes to above, do i connect the ESC 3-wire connector to one of the three "tri ports" on the C3??
(4) is there an example of code somewhere to just command a variable speed on the motor?

--- Jim

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-04 10:08
    Jim,

    Yes, you've assumed correct on all the answers.

    You could use the normal servo demo code in the Propeller Tool's library or there's also a very basic servo demo in in post #15 of my QuickStart servo tester thread.

    The demo doesn't use the servo object's ramp feature. I usually want to control the ramping myself, so I don't use the ramping feature in my projects.
  • bee_manbee_man Posts: 109
    edited 2012-05-04 10:23
    (1) Do I need to use a ESC for brushless motors with the motor --- my guess is yes.

    Yes
    (2) if yes, I assume I connect the 3-wire connector from the ESC that normally goes to the receiver to the propellor.

    Yes, it behaves just like a servo
    (3) I have the Propellor C3. If yes to above, do i connect the ESC 3-wire connector to one of the three "tri ports" on the C3??

    I don't have a C3 but if they are for servos it should work Signal/Power/Gnd White/Red/Black
    (4) is there an example of code somewhere to just command a variable speed on the motor?

    Look in the OBEX and you will find several servo test codes. Remember most ESC's need to be power down when they initialize in order to work properly
  • SRLMSRLM Posts: 5,045
    edited 2012-05-04 10:27
    3) Warning: do *not* connect the ESC directly if it has a "battery elimination circuit" (BEC, and most ESCs do have one). You have to disconnect the middle wire of the ESC from the plug.
    4) I use Servo32. Use the servo function in that object. For my ESCs I have to output a pulse of 1000 (uS) for a few seconds until it beeps, then I can ramp it up to maximum speed at around 1800.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-04 10:36
    SRLM wrote: »
    3) Warning: do *not* connect the ESC directly if it has a "battery elimination circuit" (BEC, and most ESCs do have one). You have to disconnect the middle wire of the ESC from the plug.

    Good catch. I often power my Propeller boards from the BEC. I'm not sure if using a BEC to power the C3 would be a good idea though.
    SRLM wrote: »
    4) I use Servo32.

    This object is also included in the library of the Propeller Tool version 1.3.
  • bee_manbee_man Posts: 109
    edited 2012-05-04 10:41
    I use the BEC for power, I don't know if that would be able to power the C3 board, I guess it would work if it is before the 3.3V regulator. You will have to experiment with the output pulse to start I use Servo32v7 and send 1600 for low 2400 for full power.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-05-04 11:47
    The answers above should have set you on your way. Do be careful as mentioned with the 5V from the esc (BEC).

    IIRC I posted an object that just drives an ESC and motor using the pc and its keyboard to turn the speed up and down. I used this to start my work on a quadcopter a year or two ago. The propeller is an ideal chip for this type of control!
  • jekain314jekain314 Posts: 3
    edited 2012-05-04 12:53
    thanks all for the excellent comments.

    Does the commands that change the propellor (the spinning one) speed behave the same as those that control the +/- servo motion?

    The PWM signal from the Propelor is just a PWM so would seem this isnt any different for the servo and the motor.
    maybe the internal circuitry of the motor takes care of the different (+/-) functions of the servo and the continuous spinning motor.

    --- Jim
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-04 13:09
    Yes, It uses the same pulse length control.

    Technically the signal to servos isn't really PWM since the length of the pulse is more important than the duty cycle.

    Many airplanes use servos on the throttle channel. The radio equipment doesn't care if it's a servo or a ESC they both are controlled the same way.

    As others have suggested, some speed controllers need to start at certain settings in order to work properly. This keeps the motor from jumping to a high power setting accidentally.
  • Mark_TMark_T Posts: 1,981
    edited 2012-05-05 08:24
    Duane Degn wrote: »
    Yes, It uses the same pulse length control.

    Technically the signal to servos isn't really PWM since the length of the pulse is more important than the duty cycle.

    Many airplanes use servos on the throttle channel. The radio equipment doesn't care if it's a servo or a ESC they both are controlled the same way.

    As others have suggested, some speed controllers need to start at certain settings in order to work properly. This keeps the motor from jumping to a high power setting accidentally.

    Servo signals are precisely pulse-width modulated since only the width of pulses matters... PWM is used loosely to mean "duty cycle modulation". Servo pulses do not have to be regularly spaced at all (in RC applications pulses can go missing due to drop-outs in reception so that duty-cycle modulation would be error-prone)

    Its usual to have the throttle right back at power-up to arm the ESC - RC motors are very dangerous as they can generate 100's or 1000's of watts of mechanical power into a sharp propeller blade, so ESCs tend to test for various error conditions and disarm themselves automatically.
Sign In or Register to comment.