ESC calibration
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
ESC calibration
I'm using RCtimer 30A esc's and I beleive the throttle calibration on them is getting messed up for what ever reason. I have them running on a hex and their pretty well hard wired in so its a pain to reset the throttle enpoints calibraion and programming changes by hooking up directly to an RX.
My question is if I#define MINTHROTTLE to 2000 would this be a good way to get them into programming mode?
I would just apply power seperately to the MWC first, activate throttle then power up the ESC's to calibrate and enter programming mode...
Any thoughts?
My question is if I#define MINTHROTTLE to 2000 would this be a good way to get them into programming mode?
I would just apply power seperately to the MWC first, activate throttle then power up the ESC's to calibrate and enter programming mode...
Any thoughts?
Re: ESC calibration
I have often wondered if there is a sketch that could be written and loaded to the arduino that would assist with programming all ESCs at once. including the min\max throttle.
would be a lot easier to change sketches in the arduino back and forth than to tear it apart everytime i need to program or configure something on an esc.
would be a lot easier to change sketches in the arduino back and forth than to tear it apart everytime i need to program or configure something on an esc.
Re: ESC calibration
Agreed I to would like a coded option to calibrate all ESC's at once. Doing them all one by one is a pain, especially when you have to dismantle most of a copter to get to all the appropriate plugs and what not.
Re: ESC calibration
cardboard wrote:Agreed I to would like a coded option to calibrate all ESC's at once. Doing them all one by one is a pain, especially when you have to dismantle most of a copter to get to all the appropriate plugs and what not.
This is what I've created to calibrate ESC on my quad:
Feel free to modify and adapt the software as it fit for you.
I hope this will help you to do the job.
Maybe someone in the dev team will adapt this to be more easy to configure for any number of motor config and place it in the code svn as a separate project.
Re: ESC calibration
And here's another one: http://www.file-upload.net/download-421 ... 2.zip.html
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
matbogdan wrote:cardboard wrote:Agreed I to would like a coded option to calibrate all ESC's at once. Doing them all one by one is a pain, especially when you have to dismantle most of a copter to get to all the appropriate plugs and what not.
This is what I've created to calibrate ESC on my quad:
Feel free to modify and adapt the software as it fit for you.
I hope this will help you to do the job.
Maybe someone in the dev team will adapt this to be more easy to configure for any number of motor config and place it in the code svn as a separate project.
OK so how do we use this?
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
KeesvR wrote:And here's another one: http://www.file-upload.net/download-421 ... 2.zip.html
looks like download link hell. do you have a file we can easily download? not trying to install spyware.
Re: ESC calibration
Paul from Flyduino placed this link on his topic, I haven't tried it so I don't know if its spyware.
Re: ESC calibration
matbogdan wrote:cardboard wrote:Agreed I to would like a coded option to calibrate all ESC's at once. Doing them all one by one is a pain, especially when you have to dismantle most of a copter to get to all the appropriate plugs and what not.
This is what I've created to calibrate ESC on my quad:
Feel free to modify and adapt the software as it fit for you.
I hope this will help you to do the job.
Maybe someone in the dev team will adapt this to be more easy to configure for any number of motor config and place it in the code svn as a separate project.
Why rcValue contains 8 values but just rcValue[²] is used?
Where 900 and 2200 in comes from?
Code: Select all
if(900<diff && diff<2200 && chan<8 )
Why do you accept values outside of the range 1000-2000? Shouldn't be instead
Code: Select all
if(1000<=diff && diff<=2000 && chan<8 )
However looks like the code is assigning a random number between 900 and 2200 to rcValue... could you explain this sourcecode?
Thanks, Federico
Re: ESC calibration
captaingeek wrote:KeesvR wrote:And here's another one: http://www.file-upload.net/download-421 ... 2.zip.html
looks like download link hell. do you have a file we can easily download? not trying to install spyware.
I have looked at the software from the link above, it contains a version of Multiwii V1.8 with a change to the initOutput function in Output.pde
The change alters this
Code: Select all
writeAllMotors(1000);
delay(300);
Code: Select all
writeAllMotors(2000);
delay(3000);
writeAllMotors(1000);
delay(500);
So the ECSs will be initialised to min/max every time Multiwii boots.
If it does not work properly then your copter will be launched into space

If you have a standard HW compatible ESC then it should work but I have not tried it.
hth David.
Re: ESC calibration
I never trust these things and don't use them.
Simply disconnect the signal wires thats all.
Simply disconnect the signal wires thats all.
Re: ESC calibration
The point is that, for example, my cheap radio turnigy sometimes has as max value 1900, sometimes 1910 (example values), depending on how fast and how strong you move the stick. So I suppose that the ESCs are not equally trimmed. Plus, there is no reason not to automatize the calibration system, if the code is correctly written.
Re: ESC calibration
I couldnt get the first one to compile, and the second one was too much for me to decode, there's got to be an easier sketch we can use.
Re: ESC calibration
tovrin wrote:I couldnt get the first one to compile, and the second one was too much for me to decode, there's got to be an easier sketch we can use.
This one compiles, but I am still waiting for the explanation requested

Code: Select all
/*
www.fuzzydrone.org
by Bogdan Matei
*/
#include <Servo.h>
//#include <ServoTimer2.h>
Servo serv1;
Servo serv2;
Servo serv3;
Servo serv4;
Servo serv5;
// a maximum of eight servo objects can be created
#define PPM_PIN_INTERRUPT attachInterrupt(0, rxInt, RISING); //PIN 0
volatile uint16_t rcValue[8] = {1502,1502,1502,1502,1502,1502,1502,1502}; // interval [1000;2000]
void rxInt() {
uint16_t now,diff;
static uint16_t last = 0;
static uint8_t chan = 0;
now = micros();
diff = now - last;
last = now;
if(diff>3000) chan = 0;
else {
if(900<diff && diff<2200 && chan<8 ) { //Only if the signal is between these values it is valid, otherwise the failsafe counter should move up
rcValue[chan] = diff;
#if defined(FAILSAFE)
if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0; // clear FailSafe counter - added by MIS //incompatible to quadroppm
#endif
}
chan++;
}
}
int pos = 0; // variable to store the servo position
int val=0;
int minv=50;
int maxv=170;
void setup()
{
Serial.begin(115200);
PPM_PIN_INTERRUPT
//11,10,9,3
serv1.attach(11);
serv2.attach(10);
serv3.attach(9);
serv4.attach(3);
serv5.attach(6);
Serial.print(rcValue[2]);Serial.print(" ");Serial.println(val);
}
void loop()
{
// val=map(rcValue[2], 1000, 2000, 0, 180);
// val = constrain(val, minv, maxv);
Serial.print(rcValue[2]);Serial.print(" ");Serial.println("");
serv1.write(rcValue[2]);
serv2.write(rcValue[2]);
serv3.write(rcValue[2]);
serv4.write(rcValue[2]);
serv5.write(rcValue[2]);
//delay(1);
}
Re: ESC calibration
Hello Federico,
My understanding of the software is that it connects all four ESCs to your transmitter (via the ESC ports on the FC) at the same time. This would be a manual process of calibrating the ESCS like you could do if the ESCs were connected diretley to the receiver. I have not tried it but I was curius myself so I read through it. By the way it does not compile because the required ServoTimer2 library needs to be installed first.
hth David.
My understanding of the software is that it connects all four ESCs to your transmitter (via the ESC ports on the FC) at the same time. This would be a manual process of calibrating the ESCS like you could do if the ESCs were connected diretley to the receiver. I have not tried it but I was curius myself so I read through it. By the way it does not compile because the required ServoTimer2 library needs to be installed first.
hth David.
Re: ESC calibration
djrm wrote:
So the ECSs will be initialised to min/max every time Multiwii boots.
If it does not work properly then your copter will be launched into space

If you have a standard HW compatible ESC then it should work but I have not tried it.
hth David.[/quote]
If somebody try's this and it has the space effect' please get it on camera and link it

-
- Posts: 317
- Joined: Wed Feb 08, 2012 8:42 pm
- Location: United states
Re: ESC calibration
http://www.multiwiicopter.com/pages/multiwiicopter-wiki. Go to bottom of page on this link and that's what I do and it works for every brand esc!! You can also purchase a cable like this from whitespy ! This is easy and only requires receiver and esc's !!
Re: ESC calibration
djrm wrote:[
I have looked at the software from the link above, it contains a version of Multiwii V1.8 with a change to the initOutput function in Output.pde
we could include this code in MultiWii and activate it via a #define in config.h. It would build into a special version for your copter which is only good for calibrating all the ESCs attached. It would explicitly prevent entering the flying state.
That way , only if you want to use MWii to calibrate your copter's ESCs
- you set up config.h for your copter as usual, then activate #define CALIBRATE_ESCS_CANNOT_FLY in config.h, upload, power copter so ESCs get calibrated, - flying is not possible
- power off, comment //#define CALIBRATE_ESCS_CANNOT_FLY, upload again and go flying.
What do you think? Would that ease your calibration woes?
Re: ESC calibration
Greetings Hamburger, your idea is good.
There is also another patch version of auto ESC cal software with some more checking for protection here: http://fpv-community.de/wiki/index.php? ... i_anlernen
This one is only ever activated at power up if the throttle is set to full on.
I am looking at these ideas to use in conjuntion with an ESC programming sketch which could be used as an all in one ECS setup program on a seperate nano or even on the FC as you suggst.
Here the HW ESC software is described: http://www.rcgroups.com/forums/showthread.php?t=1567736
Best regards, David.
There is also another patch version of auto ESC cal software with some more checking for protection here: http://fpv-community.de/wiki/index.php? ... i_anlernen
This one is only ever activated at power up if the throttle is set to full on.
I am looking at these ideas to use in conjuntion with an ESC programming sketch which could be used as an all in one ECS setup program on a seperate nano or even on the FC as you suggst.
Here the HW ESC software is described: http://www.rcgroups.com/forums/showthread.php?t=1567736
Best regards, David.
Re: ESC calibration
I implemented the sequence as described earlier. It is now in the _shared branch. Please, I cannot test it, all my ESCs are reflashed and do not need nor take normal calibration. So I invite you to test it and report back, please. If we do not hear from users, the feature is likely to be removed from the code again.
- seibernator
- Posts: 7
- Joined: Sun Apr 29, 2012 11:38 pm
Re: ESC calibration
Hello Hamburger, I cannot find the shared branch on the Multiwii Google code page. Could you please tell me where it is and if I am looking in the right place? Thanks.
- seibernator
- Posts: 7
- Joined: Sun Apr 29, 2012 11:38 pm
Re: ESC calibration
Nice one, thanks. I will test and report this evening.
- seibernator
- Posts: 7
- Joined: Sun Apr 29, 2012 11:38 pm
Re: ESC calibration
Just one more question, do I just need to copy across the config.h file to my version of 1.9 or do I need to copy across all of the files?? Thanks.
Re: ESC calibration
It is a dev version.
Never mix files.
Never mix files.
Re: ESC calibration
/* 3. compile, upload, run --- cannot fly and will use Buzzer to indicate finished calibration */
What does "run" means? Arm the motors? Or "switch on the copter" ?
Thanks!
Re: ESC calibration
hi
im interested in this, has anyone tried it yet?
im having a ton of problems with the esc settings, so i dont want to mess with them anymore until someone can confirm that this works,
thanks
im interested in this, has anyone tried it yet?
im having a ton of problems with the esc settings, so i dont want to mess with them anymore until someone can confirm that this works,
thanks
Re: ESC calibration
Run means power the copter from battery - just cannot fly.
Re: ESC calibration
very good idea,
i have 4 x esc flashed with simonk latest firmware that accept the "standard" end-points calibration sequence.
BUT
the thing on the latest DEV version doesn't work at all. I can't provide any other infos apart from the fact that, after de-commented the right line in config.h and flashed, after the reboot of the mcu the ESC don't beep at all...
I don't know what happened. any ideas ?
Michele
i have 4 x esc flashed with simonk latest firmware that accept the "standard" end-points calibration sequence.
BUT
the thing on the latest DEV version doesn't work at all. I can't provide any other infos apart from the fact that, after de-commented the right line in config.h and flashed, after the reboot of the mcu the ESC don't beep at all...
I don't know what happened. any ideas ?
Michele
Re: ESC calibration
maybe the timing is not right?
There is a definite delay between full-throttle and zero-throttle. You can try and change the delay in MultiWii.ino.
If you do not know how to do that, you have to wait for other people's input, sorry.
There is a definite delay between full-throttle and zero-throttle. You can try and change the delay in MultiWii.ino.
If you do not know how to do that, you have to wait for other people's input, sorry.
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
vert intersted in getting this put into the main branch will test soon
Re: ESC calibration
Didn't seem to work for my octo set-up, not all ESC's got same throttle signal in time. Strange enough.
I've tried fiddling around with the time delay within the code, but couldn't get the timing correct.
Maybe there should be a delay added before the procedure starts, I don't know how long ESC's wait for full throttle to get in 'program mode'?
My config-card always takes a while to initialize after powering ESC, or so it seems
Now calibrated ESC's with MINTHROTTLE and MINCOMMAND (in my case 900):
!! MAKE SURE NO PROPS ATTACHED !!
1. Change MINTHROTTLE to 1950
2. Upload software
3. Power FC separately from ESC's
4. After FC has booted, ARM motors (in my case AUX1)
5. Connect power to ESC's
6. Wait to hear confirmation beep from ESC's
7. Disarm motors (AUX1 off)
8. Wait for confirmation beep
9. Disconnect power from ESC's
10. Connect board to PC again, change MINTHROTTLE back to original settings (in my case 1000), upload, test CAREFULLY.
This worked for me. Maybe Hamburger's code could be adjusted to use the ARM/DISARM combination with existing procedures?
For example, probably awful code, but I'm no coder
:
I understand the need for CANNOT_FLY procedure for safety, although I couldn't figure out/find where the procedure limits actual flying?
Is it because of 'hijacking' writeAllMotors with set values?
I've tried fiddling around with the time delay within the code, but couldn't get the timing correct.
Maybe there should be a delay added before the procedure starts, I don't know how long ESC's wait for full throttle to get in 'program mode'?
My config-card always takes a while to initialize after powering ESC, or so it seems
Now calibrated ESC's with MINTHROTTLE and MINCOMMAND (in my case 900):
!! MAKE SURE NO PROPS ATTACHED !!
1. Change MINTHROTTLE to 1950
2. Upload software
3. Power FC separately from ESC's
4. After FC has booted, ARM motors (in my case AUX1)
5. Connect power to ESC's
6. Wait to hear confirmation beep from ESC's
7. Disarm motors (AUX1 off)
8. Wait for confirmation beep
9. Disconnect power from ESC's
10. Connect board to PC again, change MINTHROTTLE back to original settings (in my case 1000), upload, test CAREFULLY.
This worked for me. Maybe Hamburger's code could be adjusted to use the ARM/DISARM combination with existing procedures?
For example, probably awful code, but I'm no coder

Code: Select all
#if defined(ESC_CALIB_ON)
delay(1500); //wait for ESC init
if (armed == 1) writeAllMotors MAXTHROTTLE; //sets high-point
delay(1000); //wait for ESC high-point confirmation
armed == 0; //set low-point
#endif
I understand the need for CANNOT_FLY procedure for safety, although I couldn't figure out/find where the procedure limits actual flying?
Is it because of 'hijacking' writeAllMotors with set values?
Re: ESC calibration
no, it is a security measure.
background: The calib sequence gets ececuted upon every poweron and every reset of arduino. That could result in some unwanted maximum throttle flight when only arduino gets reset but ESCs already running.
To avoid all this I made it into a special version which will sit idle forever after the calibrating sequence. That should kindly force everyone in re-flashing with a flyable MWii version once calibrating is done.
background: The calib sequence gets ececuted upon every poweron and every reset of arduino. That could result in some unwanted maximum throttle flight when only arduino gets reset but ESCs already running.
To avoid all this I made it into a special version which will sit idle forever after the calibrating sequence. That should kindly force everyone in re-flashing with a flyable MWii version once calibrating is done.
Re: ESC calibration
Security, safety... Similar but different 
I understand the security measure, I'd hate my copter to go full throttle just about anywhere.
Depending on how fast the MWC code loads after poweron/reset I think the solution for your code to set end-points is a delay before writing writeAllMotors HIGH.
Does anyone have any idea on how fast MWC loads/processes code and how long the 'timeframe' for ESC's is to set high-end point?

I understand the security measure, I'd hate my copter to go full throttle just about anywhere.
Depending on how fast the MWC code loads after poweron/reset I think the solution for your code to set end-points is a delay before writing writeAllMotors HIGH.
Does anyone have any idea on how fast MWC loads/processes code and how long the 'timeframe' for ESC's is to set high-end point?
Re: ESC calibration
I tried this, i even changed the delay to 8000 but it doesn't work.
My motors just starts to beep, and the beeping is getting slower around the motors... What could be wrong?
My motors just starts to beep, and the beeping is getting slower around the motors... What could be wrong?
Re: ESC calibration
Maybe adxuino boot is too slow?
Re: ESC calibration
i don't know...how can i test that?
I have Crius MultiWii SE.
I have Crius MultiWii SE.
Re: ESC calibration
I think that no simple test exists.aybe if ypu had a board woth different bootloader...
So for now if it does not work you are out of luck
So for now if it does not work you are out of luck
Re: ESC calibration
hey,
anyone had any success using the esc-calibration routine in the dev version?
Up until now I have seen failure reports only. If it does not work, we might better remove it.
So if it has worked for you, now is the time to speak up, please.
anyone had any success using the esc-calibration routine in the dev version?
Up until now I have seen failure reports only. If it does not work, we might better remove it.
So if it has worked for you, now is the time to speak up, please.
Re: ESC calibration
For me it didn't work.
i just got error beeps from my ESC's.
I soldered together cable from 1 channel to 4 and calibrated all esc's at the same time from 1 channel. That worked.
i just got error beeps from my ESC's.
I soldered together cable from 1 channel to 4 and calibrated all esc's at the same time from 1 channel. That worked.
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
which version should we test? do you have a link?
Hamburger wrote:hey,
anyone had any success using the esc-calibration routine in the dev version?
Up until now I have seen failure reports only. If it does not work, we might better remove it.
So if it has worked for you, now is the time to speak up, please.
Re: ESC calibration
any of the later DEV versions from download or the _shared whould contain that code.
These can be found at the google rep.
These can be found at the google rep.
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
OK found it can you add some step by step usage notes?
Re: ESC calibration
Read notes in config.h
It has a link to documentation.
It has a link to documentation.
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
yea I read the notes here. I think we need to have manual control over the throttle so we can adjust ESC parameters. Can you allow that?
http://code.google.com/p/multiwii/wiki/ESCsCalibration
http://code.google.com/p/multiwii/wiki/ESCsCalibration
Re: ESC calibration
The code uses minthrottle and maxthrottle to try calibrating.
Timing is fixed but may be wrong?
Timing is fixed but may be wrong?
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: ESC calibration
In addition to setting calibration I want to program the ESC's too. Possible?
Re: ESC calibration
not as is.
Re: ESC calibration
Woud be just a time consuming job to count the timing for the different sequences and code it to a pwm scheme for each esc.
But be aware: I have 6 HK BL12A with stock firmware and altough they have oscillators they don´t have a synchron timing. If you concentrated on it you can hear that the last start beeps are "running out of sync", when you wait for the programming menue with all 6 escs the beeps appear to be just randomly after 10 secs. Shoud be small differences in the stock FW revision but I didn´t check via ISP.
But be aware: I have 6 HK BL12A with stock firmware and altough they have oscillators they don´t have a synchron timing. If you concentrated on it you can hear that the last start beeps are "running out of sync", when you wait for the programming menue with all 6 escs the beeps appear to be just randomly after 10 secs. Shoud be small differences in the stock FW revision but I didn´t check via ISP.
Re: ESC calibration
thanks to hint by gompf-2, I moved the ESC calibration at the end of the output initialization. Should work (better) now?
Code is in _shared only atm, not in the 2.1-rc2.
Code is in _shared only atm, not in the 2.1-rc2.