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 :)
Pulsing the motor full-on for a few cycles occasionally should work fine if you're OK with the resulting strong torque pulses on the flywheel and backwards on whatever is holding the motor. This will also result in a higher speed ripple. You have to decide whether you can tolerate the speed ripple or not.
One drawback will be lower efficiency. Shorter pulses of higher current versus longer pulses of lower current are the same to the motor, but don't cause the same dissipation in the inevitable effective resistance in series with the windings. The dissipation of the resistance is proportional to the square of the current. Usually you try to pulse motors fast enough so that the inherent inductance smooths out the actual current as a sawtooth about the average. A constant average current minimizes the lossed in the series resistance.
Best Answer
Benjamin Vedder's "VESC" project which is open source will allow you to do anything you want. You can find older versions and the latest version online. VESC allows sensorless or sensor based operation, dynamic braking, FOC control, and much much more.
Current VESC 6 project page
Older 2016 VESC V4 site which may be enough.
You can buy commercial ESC's which use the VESC software - so you have full control of what you can do with them. Here in the ads, plus many VESC refs.
VESC V4 uses current sensors in 2 motor phases - which notionally is enough.
VESC V6 has current sensors in all 3 motor phases - which were found to be 'useful' in practice.
These are NOT recommendations - just examples.
Flipsky Mini FSESC4.20 50A ESC Based Upon VESC With Aluminum Anodized Heat Sink for Rc Car
Flipsky High Current FSESC 200A 60V ESC base on VESC6 for Electric Skateboard Rc Model
_________________________________
Disclaimer: I have no involvement with VESC. I am not (yet) even a user of VESC - but almost all paths tend to lead to it at present.