I have worked on building a homemade quarocopter for my final year project, I remember having trouble with this too :)
I have used Turnigy Plush 30amp Speed Controllers.
Frist of all, FYI:
The normal sequence when staring an ESC (again, the one I worked with) is:
- as soon as your ESC is powered - minimun throttle (close to 1ms pulse) for about 3 seconds (until the beep codes for battery type and ok to start are elapsed)
This is a safety feature - normally, this means that the throttle stick is at minimum.
However, a great majority of Electronic Speed Controllers are programmable in terms that you have to program this minimum (and maximum) throttle I said earlier about.
In other words maybe that programmed minimum throttle is around 0.7ms (if you programmed it from RC transmitter with trim set to minimum) and when you power on your ESC input is around 10ms pulse, it's a safety feature it won't start, since in this case throttle is not minimum.
In order to program the new maximum and minimum input values (calibration):
- Power On
- as soon as you ESC is powered - maximum throttle (close to 2ms pulse) again wait for the beeps (only battery type)
- quickly jump to minimum throttle (close to 1ms pulse) and wait again for the new initialization beeps (this time there will be less, without battery type)
- new values for minimum and maximum throttle are now stored
I strongly recommend you use this kind of initialization every time so that all ESCs will be synchronized regarding minimum and maximum value of throttle. Also I strongly recommend you don't have any propellers mounted when experimenting with this approach :)
Now, regarding your code,
- I don't think you need to slide all the way up to the maximum or to down to the minimum during the initialization phase (in my case ESC expects value ASAP, with no slides), you should write the output value directly(no slide up/down).
- As soon as you reach the maximum value you start sliding down to the minimum. You should stay long enough at maximum value (Around 1 second)
- If initialization is not OK on first try, ESC is locked until supply is cut and turned on back again. There is no point in making attempts to initialize if first attempt is failed.
When calibrating or starting the ESC be sure to hold minimum value and/or maximum value as long as it is required. Something like:
Normal starup(as you described your ESC):
- Turn On ESC
- minimum throttle
- wait 2 seconds
- maximum throttle
- wait 2 seconds
- minimum throttle
- wait 1 second
- OK to Go
Normal starup(the ESC I used):
- Turn On ESC
- minimum
- wait 3 seconds
- OK to Go
Calibration:
- Turn on ESC
- maximum
- wait 2 sec
- minimum
- wait 1 sec
- OK to go
Another thing, good to know, entering programming mode for ESCs allows you to set a lot of parameters such as the cutoff threshold, brake. Before attempting flight, you must be sure that all these parameters are set the same for all ESC you use. Again, for the ESC I used, see the manual, page 2.
I'm pretty sure you've already figured this out, but I wanted to post it maybe it will help others :)
The "standard" RC protocol is to transmit bursts of AM pulses[1], the relative positions of which are translated by the receiver into variable-width control pulses that get sent to the servos. It should be fairly straightforward for the smartphone app to send pulses out the headphone jack, which are then used to key a simple RF transmitter on a standard RC control frequency. Then, in the car, you'd use an off-the-shelf RC receiver and servos to control the car.
A standard RC servo requires a control pulse that has a variable width of 1-2 ms (sometimes this is extended to 0.5-2.5 ms) and repeats at a 20-50 Hz rate. A basic RC car might have as few as two servos, while a complex plane might have six or more, each of which needs its independently-controlled pulse.
Rather than sending variable-width pulses over the air, which would be subject to noise and distortion of various types, the transmitter instead sends a series of fixed-width pulses (on the order of 0.5 ms or so), and it's the spacing among these RF pulses that becomes the width of the servo control pulse at the output of the receiver.
For example, a six-channel transmitter will send 7 pulses at a time. The time between the rising edge of the first pulse and the rising edge of the second pulse is turned by the receiver into the control pulse for servo #1. Similarly, the time from the second RF pulse to the third RF pulse becomes the control pulse for servo #2, and so on. After the seventh RF pulse, there's a relatively long gap (10 ms or more), which signals the receiver to reset its decoder back to servo #1.
[1]: I might be wrong about the modulation. Certainly, the earliest systems used AM, but indications are that modern systems are FM.
Best Answer
The wireless transceiver is the part labelled MRF49XA. The giveaway is the PCB trace antenna.
In the marked photo below:
The ATMEL part is the microcontroller which is running the show. If you have the resources (an oscilloscope or logic analyser) you can probe the communication lines between the microcontroller and the transceiver to determine what is being sent.
I hope this helps!