+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: Control of Turnigy ESC AE-20A

  1. #1

    Default Control of Turnigy ESC AE-20A

    Hello everyone,
    I am starting a new project that uses the parallax model 750-90002 outrunner RC motor and a Turnigy electronic speed controller (ESC).
    I have Turnigy model AE-20A ESC's and have been trying to figure out how to go about controlling it from the propeller chip.
    I noticed the ESC I am using is also a very similar model to what is being used for the Elev8 project.
    My project is a type of spinning clock. There is a 'blade' attached to the motor which I will be lighting up with LED's. I need the RPM to be constant or a way to trigger the LED's when in correct physical position for a steady image.

    I have not connected or programmed the ESC yet... I would like to get more familiar before attempting anything as this will be my first time using an ESC.

    First question... connecting to propeller for programming.
    The connection from the ESC that would normally go to a radio receiver is 3-pin... I am assuming the white wire is for data, so connect the white wire to any desired prop pin?
    Would connecting the red/black wire to the prop's 3.3v power be fine? Or is it a different voltage?
    The ESC main power (where batteries would normally be used) will be a 12v switching power supply.

    Second Q:
    For programming the ESC, the instruction manual looks like it only uses 2 or maybe 3 input values (up, down, middle)... i.e. to start programming, hold throttle in 'up' position and power on the ESC, wait for tones.
    So for programming the ESC from the prop, I was thinking of using 2 buttons on different prop pins to set the output of the ESC data wire at 'throttle up' position and 'throttle down' position.
    So if I press button 1, the pin connected to the ESC data wire is set with outa[1]~~ to simulate a 'throttle up' position.
    If I press button 2, the pin connected to the ESC data wire is set with outa[1]~ to simulate a 'throttle down' position.
    Will this work? or should I use DUTY instead of outa? or does it work off of current sensing and so I should use a potentiometer?

    Third Q:
    This is more an extension of question2... for use after programming, how to go about controlling the speed of the motor connected to the ESC.
    What kind of input does the ESC use for controlling the speed of the attached motor? Would I use DUTY on the ESC data wire for controlling the speed and simulating the throttle of an RC controller?
    I am not sure yet of my desired RPM, but it will need to remain constant after finding an optimal speed.
    I am worried about the project flipping on its side during startup while trying to go from 0 to set RPM due to torque, so I will need to ramp the starts.


    I appreciate any help, I am worried about damaging electronics by using a trial and error process to figure this stuff out.
    I see quadcopters are a hot topic right now! Hoping after this project to use the gained knowledge in building of my own
    Sincerely,
    J
    Last edited by JBWolf; 02-27-2013 at 06:41 PM.

  2. #2

    Default Re: Control of Turnigy ESC AE-20A

    Quote Originally Posted by JBWolf View Post
    First question... connecting to propeller for programming.
    The connection from the ESC that would normally go to a radio receiver is 3-pin... I am assuming the white wire is for data, so connect the white wire to any desired prop pin?
    Would connecting the red/black wire to the prop's 3.3v power be fine? Or is it a different voltage?
    The ESC main power (where batteries would normally be used) will be a 12v switching power supply.
    No. Don't connect the red line to the 3.3V line. Many ESCs have battery elimination circuits (BEC) to provide the radio receiver with 5V. This would harm the Propeller. If this ESC doesn't have a BEC, then 3.3V wouldn't be enough to power the ESC circuit (if it requires an addtional 5v line).

    The white line is the signal line which connects to the Prop. The black ground line should connect to both the ESC's power supply and the Prop's ground (you need a common ground connection).

    Do you have a normal servo to experiment with? If so if might be easier to get a feel for controlling a servo before learning to control an ESC.

    Second Q:
    For programming the ESC, the instruction manual looks like it only uses 2 or maybe 3 input values (up, down, middle)... i.e. to start programming, hold throttle in 'up' position and power on the ESC, wait for tones.
    So for programming the ESC from the prop, I was thinking of using 2 buttons on different prop pins to set the output of the ESC data wire at 'throttle up' position and 'throttle down' position.
    So if I press button 1, the pin connected to the ESC data wire is set with outa[1]~~ to simulate a 'throttle up' position.
    If I press button 2, the pin connected to the ESC data wire is set with outa[1]~ to simulate a 'throttle down' position.
    Will this work? or should I use DUTY instead of outa? or does it work off of current sensing and so I should use a potentiometer?
    An ESC is controlled the same way a servo is controlled. The Servo32v7 object in the Propeller Tool library will do this for you. You could either have a special program to calibrate your ESC or have the Prop do the calibration with each start up using a set times to send the appropriate pulses or you could use your button idea.

    Third Q:
    This is more an extension of question2... for use after programming, how to go about controlling the speed of the motor connected to the ESC.
    What kind of input does the ESC use for controlling the speed of the attached motor? Would I use DUTY on the ESC data wire for controlling the speed and simulating the throttle of an RC controller?
    I am not sure yet of my desired RPM, but it will need to remain constant after finding an optimal speed.
    I am worried about the project flipping on its side during startup while trying to go from 0 to set RPM due to torque, so I will need to ramp the starts.
    The servo object has a ramping feature but I usually do my own ramping as part of the control program. Ramping is probably a good idea in this case but the ESC might take care of some of that for you.

  3. #3

    Default Re: Control of Turnigy ESC AE-20A

    Basically you control a servos position by writing a high pulse on the data that is between 1us and 2us. If the pulse is only 1us the servo will go to I tv s lowest position and 2 Millie will set it to its highest. I believe most servos expect a pulse every 20 millis, but I may be wrong.

    I expect your escs range to be within this pulse width range. You can use your cogs timer to set these pulses. You will probably need to write an arm sequence as well for your esc.

  4. #4

    Default Re: Control of Turnigy ESC AE-20A

    Quote Originally Posted by waymond91 View Post
    Basically you control a servos position by writing a high pulse on the data that is between 1us and 2us. If the pulse is only 1us the servo will go to I tv s lowest position and 2 Millie will set it to its highest. I believe most servos expect a pulse every 20 millis, but I may be wrong.
    Almost, the pulse should be between 1ms (1000us) and 2ms (2000us). There are some servos that can operate will outside this range (the small blue HobbyKing servos) but 1000us to 2000us is a good range for an ESC.

    I expect your escs range to be within this pulse width range. You can use your cogs timer to set these pulses. You will probably need to write an arm sequence as well for your esc.
    It's even easier than using a cog timer, just use the object "servo32v7" and you can control up to 32 servos.

    Many ESCs need to brought to a low throttle setting before they may be used at other settings.

  5. #5

    Default Re: Control of Turnigy ESC AE-20A

    I managed to burglarize a servo from one of my RC toys... an Airtronics 94102
    Do servos need a power supply? I cannot find a spec sheet for this servo and there are 3 wires, Red + black + black... not sure what to connect where

  6. #6

    Default Re: Control of Turnigy ESC AE-20A

    Quote Originally Posted by JBWolf View Post
    I managed to burglarize a servo from one of my RC toys... an Airtronics 94102
    Do servos need a power supply? I cannot find a spec sheet for this servo and there are 3 wires, Red + black + black... not sure what to connect where
    Pretty much everything needs a power supply!

    Yes, you'll need a supply of 5 or 6V or so capable of at least 0.5A, preferably 1A, and don't share this supply with the digital electronics.
    4 AA cells (alkaline or NiMH) will make a reasonable supply.

    To distinquish which of the two black wires is 0V might involve some investigation - you did take a note of how it was connected in the RC toy
    I hope...

  7. #7

    Default Re: Control of Turnigy ESC AE-20A

    yes, it was connected to the receiver port marked 'throt' lol
    Not much help there as I cannot visually determine much.
    Without destroying the receiver case I cannot access the board, it does not simply unscrew and come apart.
    This is an expensive receiver and I am not willing to risk destruction.

    My best guess would be that the red wire is anode and next closest wire is gnd.... or maybe the 2 blacks are +/- and red is signal... hmm

  8. #8

    Default Re: Control of Turnigy ESC AE-20A

    ok searched everywhere trying to find something to identify the wires... here is something I think will help:
    http://www.airtronics.net/index.php/...-receiver.html

    It's a legacy adapter... shows the wires changing color to red/black/blue.
    I think blue is it... so farthest wire from red. ill give it a try

  9. #9

    Default Re: Control of Turnigy ESC AE-20A

    ok I hooked it up but no movement.... turns out servos dont fare well after sitting in a damp basement for 12 years.
    Serious corrosion, it wont budge even with pliers! I may just have to try it with the ESC
    Name:  IMG_2739 - Copy.jpg
Views: 859
Size:  86.9 KB

  10. #10

    Default Re: Control of Turnigy ESC AE-20A

    Wow! I have never seen anything like that before! I think you should be okay testing directly on the esc, with the esc connected to the motor. JUST MAKE SURE YOU LEAVE THE PROPELLER OFF THE MOTOR WHILE YOU ARE TESTING. That can be a painful lesson lol.
    Basically, your should will have an arming sequence (normally this is done on the transmitter by pulling the throttle low, then high, then low again). You can do this with a pre-made servo object if you like. You may have to map the esc values against the servo values. (ie, writing the servo to 0 degrees may not be 0 on the esc, likewise, writing the servo to 180 might not be writing the esc to 100% throttle).
    This is because on most rc airplanes, you do not typically use the full 180 degrees of the servo, it is most often centered at 90 and then can go 45 degrees forward or back.
    I am curious to see how your quadrotor turns out. I started an autopilot earlier this summer, and I am getting close to figure it out. I posted an instructable explaining some of the basic concepts, and I also signed up with DIY drones, a lot of help to be found there as well.

  11. #11

    Default Re: Control of Turnigy ESC AE-20A

    JBWolf,
    I can't help but think that an outrunner RC motor and ESC are expensive solutions to building a propeller clock. Not to mention that they are over the top in capability for such a simple task. Do you really need speed control on your LED propeller? Hundreds of Propeller clocks have been built with much lower tech motors, or motors salvaged from hard disk drives, VCR's etc, all sorts of things. YouTube is full of such videos.

    I'd take up the challenge of doing the clock the minimalist way and save the motor/ESC for something that needs them like, you know, flying things.

  12. #12

    Default Re: Control of Turnigy ESC AE-20A

    I agree, it is a bit expensive and I do literally have a box full of random motors.
    The spinner/blade is machined aluminum so it weighs a bit more, but balanced well.
    I have used stepper motors triggered with a ULN2803 on the prop for high torque/low speed applications.... but this will be my first time working with a high speed & precise position application.
    I was hoping to learn what I set out for in this thread so I could accomplish this project and also use the gained knowledge for working on a quadcopter later on.
    I do not find the price of these components overly expensive as I am not planning to make more than two, I owe a friend a favor and he really seemed impressed the first time we saw a spinning clock... this would make a perfect gift.

  13. #13

    Default Re: Control of Turnigy ESC AE-20A

    How should I modify the Servo32v7 to work with an ESC, especially for programming.
    I see the first movement command in the demo is :
    SERVO.Set(ServoCh1,1500) 'Move Servo to Center
    So I'm assuming changing 1500 to 0 would simulate a full off and 3000 full on?

    Now I also see the changes in movevents are done by 'panning' via ramping:
    'SetRamp(Pin, Width,Delay)<-- 100 = 1 sec 6000 = 1 min
    SERVO.SetRamp(ServoCh1,2000,200) 'Pan Servo

    So for programming the ESC on first run...
    SERVO.Set(ServoCh1,3000) 'full on to start programming
    ' delay for tones
    SERVO.Set(ServoCh1,0) 'full off to finish programming


    If that works for programming... then this for bringing up to desired rpm?
    SERVO.SetRamp(ServoCh1,2000,200)

    What you guys think?
    Last edited by JBWolf; 02-28-2013 at 05:04 PM.

  14. #14

    Default Re: Control of Turnigy ESC AE-20A

    Trying to understand how the ESC works...
    So if the ESC just uses PWM for speed control and programming... how exactly does it use the pulses?
    Does it simply turn on full power when it receives a pulse and by limiting the amount of time on/off = stable rate of revolution?
    Or is there an IC doing interpretation such as waiting for the pulse to finish then uses voltage modulation to control the rpm?
    I think if I can understand the concept behind the ESC it would help me in control of it.

  15. #15

    Default Re: Control of Turnigy ESC AE-20A

    For sure there is a chip in there.
    A motor requires a sequence of power pulses on 3 lines to get the thing to turn. Modern brushless RC motors are not using old fashioned mechanical comutators to do that. Some electronics has to do that for you.
    Meanwhile on the input side you are providing a pulse width command to say what power you want.

    If it were me I'd just start sending it normal RC servo pulse width modulated signal, as described above, and see what happens.

  16. #16

    Default Re: Control of Turnigy ESC AE-20A

    Servo.Set() takes a microsecond pulse length value to send to the servo / ESC. The range of allowable values is 1000 to 2000, corresponding to 1000us to 2000us. You don't have to modify anything - you can just use it right out of the box. 1000 will be "motor off" and 2000 will be "full throttle".

    The ESC has a microcontroller on it that measures the duration of the pulses you send, and uses that to set the amount of power applied to the motor. It generally does not control RPM, though some helicopter ESCs do have a governor option which will do that.

    For your motor clock, the best thing you can do is use a sensor to detect the RPM of the motor. Either an infrared LED / detector pair, a hall-effect sensor and magnet, or whatever else you can come up with. Having the propeller chip measure the RPM is easy, and every time you get a hit on your sensor, you know *where* in the rotation you are as well, so it's easy to compute the correct delays for lighting up your lights.

    I did it using an infra-red emitter / detector pair years ago, on a much less capable chip:
    http://jasondorie.com/WordPress/?p=18

  17. #17

    Default Re: Control of Turnigy ESC AE-20A

    Very clever, I do not think I have seen a clock like that with backlighting pulsed to make hands. I like it!

    Ok I almost have enough to go on to give it a go... The one thing I am still unsure of is the breaks and active time of pulse duration commands.
    For example in the 'servo32v7_RampDemo' code, the 'servo.set()' commands are one directly after another without a waitcnt or repeat... it appears to me as if it just sends a single pulse command and then the pin output ceases, but I may be wrong.
    The reason for this concern is that I need to simulate a constantly held down 'throttle down' and 'throttle up'.
    If I sent a command such as 'set(1000)' to simulate a 'throttle down', does it just send it a single pulse and then idles? or does it keep that pulse going to hold a servo in position until another set command is sent?
    so im wondering if would I need a repeat in there to keep the signal alive for simulating a held down throttle down/up... or not.

    I noticed that following a 'servo.setramp()' command, there is a repeat in the code to wait until the ramping is complete. But I understand ramping is a delayed movement as opposed to the servo.set.

    Does servo.set() output stay 'alive' ?
    Thanks
    Last edited by JBWolf; 03-03-2013 at 11:18 PM.

  18. #18

    Default Re: Control of Turnigy ESC AE-20A

    Cool, it works! The reason they call this motor an 'outrunner' slipped my mind, got a little surprise starting it up while it was laying on it's side lol.
    Set the throttle and tried it out... works nicely, however I will need to implement ramping as the speed changes feel very violent.

    Heres what I am currently using:
    Code:
    CON
        _clkmode = xtal1 + pll16x                           
        _xinfreq = 5_000_000           '80mhz
    
        ServoCh1 = 3                   'ESC Controller Pin
        Button1  = 26                  'Momentary Throttle  UP  Simulator
        Button2  = 20                  'Momentary Throttle DOWN Simulator
        LED1     = 13                  'Green  LED
        LED2     = 14                  'Yellow LED
        LED3     = 15                  'Red    LED
    
    VAR
        
    OBJ
      SERVO : "Servo32v7.spin"
    
    PUB Servo32_DEMO | temp
    dira[Button1]~
    dira[Button2]~
    dira[LED1..LED3]~~
    
        SERVO.Start                 'Start Servo handler
      
    
    
    Repeat
    
        if ina[button1] == 1
           SERVO.Set(ServoCh1,2000)               'Throttle Up
           outa[led2]~
           outa[led1]~~
             Repeat while ina[button1] == 1
               waitcnt(clkfreq / 10 + cnt)
    
        
        if ina[button2] == 1
           SERVO.Set(ServoCh1,1000)               'Throttle Down
           outa[led2]~
           outa[led3]~~
             Repeat while ina[button2] == 1
               waitcnt(clkfreq / 10 + cnt)
    
        outa[led1]~
        outa[led3]~          
        SERVO.Set(ServoCh1,1500)                  'Throttle Center Idle
        outa[led2]~~ 
        waitcnt(clkfreq / 10 + cnt)

  19. #19

    Default Re: Control of Turnigy ESC AE-20A

    Nice , but using outrunners with ESC be carefull :

    An outrunner motor running at full speed without load may be damaged.
    Better try it with values near 1300 for your tests.

    I understand you try it for a POV clock : an outrunner seems much too fast.
    I used a simple DC motor and a Hall detector to build things like that.
    It runs at about 350 RPM so that the leds are on at the same location every turn
    (depends on the radius of the circle you use , about 16 cm in my case)

    You can find many exemples of POV with the Arduino Microcontroller.

    Try : http://carlitoscontraptions.com/2007...pov-prototype/

    Cats92
    Last edited by Cats92; 03-04-2013 at 10:29 AM.

  20. #20

    Default Re: Control of Turnigy ESC AE-20A

    Cats92,

    I'm surprised, I would have thought you want a refresh rate of 20Hz minimum. That would be 20 revs per second or 1200 revs per minute. Still I've never built a POV device so maybe less is OK.
    ..depends on the radius of the circle you use..
    Also I don't see how that can be. Surely X revs per second is the same refresh rate no matter what the radius.

+ Reply to Thread

Similar Threads

  1. $100 Turnigy Mini Quadcopter
    By erco in forum General Discussion
    Replies: 14
    Last Post: 08-04-2012, 04:29 AM
  2. Replies: 1
    Last Post: 02-10-2010, 10:35 AM
  3. Toggle between radio control and autonomous control
    By kenjones1935 in forum BASIC Stamp
    Replies: 4
    Last Post: 11-17-2009, 09:10 PM
  4. Replies: 7
    Last Post: 09-27-2006, 10:49 PM
  5. Replies: 0
    Last Post: 09-12-2002, 02:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts