Shop OBEX P1 Docs P2 Docs Learn Events
Control brushed esc (electronic speed controller) — Parallax Forums

Control brushed esc (electronic speed controller)

BotdocterBotdocter Posts: 271
edited 2011-01-24 09:54 in Propeller 1
I am using esc's for the first time and am not entirely sure how to drive them.

I forum members told me that i can drive them with servo commands, but that doesn't seem to work.
With my servos i have to use a 4k7 resistor on the signal pin to make them work. Could it be the same thing with the esc's?

[url]Http://aesior.wordpress.com[/url]

Comments

  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 08:34
    Ok i have tried with resistors and the motors turn. But very weak. I can stop them by pinky.
    Also they don't seem to react on changing the pulse width. In some cases they don't turn at all, in some cases it stays the same.

    Anyone have any ideas?

    Pics can be found on the above link!
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-01-22 08:38
    You probably don't need the resistors. It would be helpful if you posted a link to the ESC specs.
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 09:29
    Descriptions:
    Forward with Reverse/Brake (6-12V,2-3CELLS*LIPO.)*
    Size 43 x 24 X 21(mm)
    Weight* 65(g)
    Operating Voltage 6-12(V) or 2-3cells Lipo
    BEC 1(A)
    Switching Rate 1.7(KHz)
    Low Voltage Cut-off 5(V)
    Suitable for most controller - Futaba/Acoms/Tamiya/JR/Hitec/GWS receiver

    Suitable for most*>23T Brushed Motor*- Tamiya 540 motor.....

    Specifications:
    MCU Controlled. No stepped operation.
    BEC (Battery Eliminator Circuit)
    Low torque "Soft Start"
    Brake. Reverse.
    Extremely smooth throttle step
    Safe “power on”
    Auto shut down when signal is lost
    Low Voltage Cut-off. High temperature Cut-off. High current Cut-off.
    Small dimensions and weight
    Includes:

    50A Brushed ESC
    ESC English Instruction
    100% Brand New in Bag
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 10:04
    A lot of speed controls have a start up sequence where the signal sent must be low for a given time (throttle in low position) so that may be an issue.

    The fact that it turns but not much is strange, either you are not sending long enough pulses or there is some issue in the wiring whereby the current is being limited.

    I assume you are driving the motor from a battery pack (it is charged isn't it!), does the BEC supply the propeller or does it have it's own supply? If you have a battery and a separate supply have you coupled the grounds? They should be coupled so a logic high from the prop translates to a logic high on the controller.

    Graham
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 11:21
    I believe the startup sequence is indeed the problem. Sometimes i hear a little beep.

    So what does "low" throttle mean?

    Is that pulsewidth 900 or 1500 as beeing the middle(0)
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 11:26
    A beep is good as it means it is armed. The pulse widths vary between 1 and 2ms, as you say 1.5ms is the middle, for a servo that means in the neutral position but for an ESC that means half throttle, most probably you need to set it to around 1ms and wait until you hear the arming beep. BUT read the esc manual as it should detail this.

    Graham
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 12:22
    Yeah that's the problem! I did not come with a manual...

    But this sounds quite clear. I think i know what to do now.

    Thanx!
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 12:25
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 14:21

    Thanks! allthough it did not gave me a correct sollution.
    This is the code that works to initialize but not correctly.

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000 'Note Clock Speed for your setup!!

    ServoCh1 = 6 'Select DEMO servo

    VAR

    OBJ
    SERVO : "Servo32v7.spin"

    PUB Servo32_DEMO | temp

    SERVO.Start 'Start Servo handler
    SERVO.Ramp '<-OPTIONAL 'Start Background Ramping

    'Note: Ramping requires another COG
    ' If ramping is not started, then
    ' 'SetRamp' commands within the
    ' program are ignored
    '
    'Note: At ANY time, the 'Set' command overides
    ' the servo position. To 'Ramp' from the
    ' current position to the next position,
    ' you must use the 'SetRamp' command


    SERVO.SetRamp(ServoCh1,1500,100) 'Pan Servo

    repeat 1500000 'Do nothing here just to wait for
    'background ramping to complete

    SERVO.SetRamp(ServoCh1,1400,100) 'Pan Servo

    repeat 1500000 'Do nothing here just to wait for
    'background ramping to complete


    SERVO.Set(ServoCh1,1515) 'actual speed goes from 1450 to 1550


    The last pulse width is accually the one that makes the wheel turn.(1515)

    The other ones, i can't change otherwise the beep won't sound.

    The strange thing is that the speed variations go from 1450(= -100%) to 1550 (+100%)

    any ideas??
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 14:46
    Is it a bi directional esc? If so initialise at 1500 otherwise try at 1000

    Rather than use a repeat loop for the delay use waitcnt, e.g. waitcnt(cnt+clkfreq*2) gives a 2 second delay

    I don't understand this statement: "The strange thing is that the speed variations go from 1450(= -100%) to 1550 (+100%)"

    Graham
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 14:47
    Oh and put your code in code tags when posting to the forum.

    [code] your code here [/code ]

    (without the space before the last bracket.
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 16:15
    Is it a bi directional esc? If so initialise at 1500 otherwise try at 1000

    Rather than use a repeat loop for the delay use waitcnt, e.g. waitcnt(cnt+clkfreq*2) gives a 2 second delay

    I don't understand this statement: "The strange thing is that the speed variations go from 1450(= -100%) to 1550 (+100%)"

    Graham

    Init only works from 1400 to 1470

    I meant that servos go from +- 900 to 2100. And these controllers go from 1450 to 1550
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 16:18
    The range of 1450 to 1550 seems far too small, considering you don't think it is working how did you arrive at the upper limit of 1550?

    I would try removing any ramping and then giving the controller plenty of time at each setting.

    Graham
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 16:22
    What do you mean with arrive? I tried without ramping. It made no difference. Also longer waiting periods did not matter.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 16:39
    I mean why do you think that 1550 is the upper limit of the esc.

    Graham

    p.s. arrive: because you came to a conclusion after a journey of discovery.
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 16:59
    above 1550 it doesn't go faster... so that must be the limit. at least with this calibration.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 17:00
    And at the point where it does not go any faster is it significantly slower than if you had connected it straight to the battery pack?

    Graham
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 17:02
    oh no! it goes even faster than i expected.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 18:05
    I'm confused, the motor goes faster than expected through the speed control? So what is the problem?
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 18:21
    That it is so sensitive. But it works this way so i'll go from here.
    Thank you for your help.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-22 18:25
    I think the range over which it appears to operate is also too small. Can you test the escs on an RC transmitter?

    And if you run the exact same code on a servo how does it respond?

    Graham
  • BotdocterBotdocter Posts: 271
    edited 2011-01-22 20:30
    With a servo it works normal. Like a servo should.

    Accually i believe the range is a bit wider. 1300 to 1500 with 1400 beeing 0. So that's a range of 200. Maybe because of different initialisation.
    I was planning on trying to connect it with a receiver. Lets see if that'll work.

    I'll get back to you...
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-01-22 23:08
    Many speed controls are "adaptive", meaning that they figure out where the max throttle is on takeoff, because most aircraft take off at full throttle. You may be seeing this behavior when the throttle maxes out. That said, most have a range of 1200 to 1800 us for the pulse width, some from 1100 to 1900, and fewer still from 1000 to 2000. Almost all center at 1500. My experience is with brushless controllers for aircraft, so yours may differ, especially if it's for a car and has reverse.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-01-23 03:26
    Jason,

    I've heard of speed controllers with start up sequences that require the user to push to full throttle first and then to zero to initialize but I've never heard of speed controls adapting based on the use of full throttle on take off, do you have an example of such a speed controller? I really can't see how that would work as models requiring full throttle at take off would just get full stick at take off and that would not allow adaptation to anything.

    Graham
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-01-23 12:56
    Pretty much every controller requires a low throttle condition to initialize. At that point they assume the "low point" they're seeing is zero. They set their internal uppper-end value to something useable, but on the low side, like 1750us. On takeoff the user applies full throttle, and the ESC uses this newly seen high value as the "real" high end of the throttle range.

    Most cheap ESCs for aircraft do this, or they'll use fixed points like 1200 and 1800 (I'm making these numbers up). Look for "automatic throttle range" when shopping. If you find one with a helicopter setting, or one that offers "fixed endpoints" or "programmable throttle endpoints", it means you can assume the values won't change, or they can be set by the user. For electronics projects, those tend to be much easier to work with.
  • BotdocterBotdocter Posts: 271
    edited 2011-01-23 13:38
    Thank you for your reply. Allthough the esc's you're talking about are flight ecs's. I have a esc with brake and reverse. I'm not sure it works the same. Will try with rc transmitter later tonight.
  • BotdocterBotdocter Posts: 271
    edited 2011-01-24 08:16
    Ok i hooked up the rc transmitter and got exactly the same values.
    1400 is middle.

    So this is the way to go.

    I tried initializing within my main spin file, but that doesn't seem to work. Where in the file should i place the init script?
    I placed it right under
    Cognew(Drive,@drivest........
    
  • BotdocterBotdocter Posts: 271
    edited 2011-01-24 09:54
    Could it be that it has something to do with the esc switching rate of 1.7khz?
    I once read something about 2khz that the propeller uses or am i totally off here?
Sign In or Register to comment.