Brushless motor control with RC controller

Started by jdba...@tristate.edu October 29, 2007
Hi,

I am trying to control an Atlas brushless motor using an Atlas Black motor controller. My problem is I do not know how to signal the motor controller correctly using Basicx. I know the motor controller uses PWM, but when I try to send a pulse the motor just beeps. I have read that the controller can have safety locks in place that can only be unlocked with certain signals. My question is: does anyone know if the Atlas Black has locks in place, and if so how to overcome them and if not what am I doing wrong? Also is there a motor controller for a three phase brushless motor that can be easily used with the Basicx. Any information would be appreciated.

Thanks,

Jon
> ... if the Atlas Black has locks in place, and if so how to overcome
them ...

Sounds like a safety warning. If the motor controller (ESC) is like
those I've seen, you will need to emulate the motor-arming safety
conditions when the ESC is powered. The ESC will not allow you to start
catastrophically at full throttle.

You will probably need to provide a servo signal that looks like
throttle off or idle for some period, perhaps a few seconds, when you
apply power to the ESC. The ESC will then, in my experience, sing a
happy tune and become responsive.

Read your ESC instructions again; the motor-arming requirements are
surely there.
Tom
Tom,

Thanks for the prompt reply. There is a motor-arming sequence in my motor control. What would my PWM look like at no throttle, half throttle, full throttle etc.? I imagine there would be no PWM for no throttle, but what about the other speeds.

Also, I am using this motor in a robot. How do I keep the motor running without affecting the rest of my programming? In other words you will need to use a do-loop to keep the PWM running. How do I program the Basicx so that my main program does not get stuck in this loop and proceeds to the next stage of the program while still running the motor?

Thanks again for your help and patients.

Thanks,

Jon
> ... I imagine there would be no PWM for no throttle, but what about
the other speeds? [] How do I program the Basicx so that my main
program does not get stuck in this loop and proceeds to the next stage
of the program while still running the motor?

In my experience (with a Castle Creations Mamba-25 and an E-Flight 25
Pro), the throttle channel is a conventional R/C PPM signal (a +5v
1.0mS to 2.0mS pulse, repeated at ~50Hz). Off/Idle is represented by
a 1.0mS pulse while full throttle is a 2.0mS pulse, in my case and,
probably, yours. An R/C radio system is handy to initially play with
your motor (and, arguably, as a robot system override to avoid running
neighbors down during code development), and it will give you some
insight into controller and motor operation.

The ~50Hz repetition rate is usually not critical but at some slower
rate your ESC is likely to decide that control has failed. To
repeatedly send a pulse to the ESC, you can use a dedicated Basic-X
task; that task can issue a pulse then sleep for 20mS while your other
code (in other tasks) does its work.

This is incomplete code but something like this should work:

dim ThrottleValue as single

sub SendThrottle()
ThrottleValue = 0.0 'init motor Off, full speed = 1.0
do
call PulseOut(ThrottlePin, ThrottleValue * 0.001 + 0.0005, 1)
call Sleep(0.020)
loop
end sub

If your code changes ThrottleValue between 0.0 and 1.0, the motor
speed should change. To start, set ThrottleValue to zero, apply power
to the ESC and wait a second or so before ramping the throttle up.
Tom
The 0.5mS offset in this line was incorrect; try:

call PulseOut(ThrottlePin, ThrottleValue * 0.001 + 0.001, 1)
Tom
Tom,

Sorry for the delay. The program works perfectly. I added a timer to initiate the arming signal. I can't thank you enough. Thank you for all your time and patients. If you would like I will send pictures of the final robot. Thanks again.

Jon
-----Original Message-----
From: b... on behalf of Tom Becker
Sent: Tue 10/30/2007 10:49 AM
To: b...
Subject: [BULK] [BasicX] Re: Brushless motor control with RC controller

The 0.5mS offset in this line was incorrect; try:

call PulseOut(ThrottlePin, ThrottleValue * 0.001 + 0.001, 1)
Tom
> ... I will send pictures of the final robot.

Please do that. Something I don't understand about groups like this -or
maybe its just this one - is the absence is followup. Rarely does
anyone get to see results.

Often someone will ask "Help! I must leave for Mars tomorrow morning
and need some fuel ideas", so someone chimes in with viable suggestions
and the guy just disappears - either to an adequate passing grade, poor
navigation skills or the wrong fuel. We'd like to know!
Tom