Alternative ESC firmware (reflashing)

Post Reply
ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

@Hamburger:
I cannot verify it my self, but according to this information http://www.armokopter.at/forum/viewtopic.php?f=9&t=1360 all ESC's in range 6-40A have similar MCU layout and therefore you can use same firmware.

@EOSBandi
Not sure I want to sacrifice serial port for escs.. ;) Currently I'm seriously thinking about this i2c-PPM converter: http://www.rcgroups.com/forums/showthread.php?t=1399162. With price tag around $10 it is really attractive option, to extend Pro Mini up to 8 motors. ;)

regards,
ziss_dm

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

ziss_dm,
thanks for the thorough description.
I am afraid my eyes and soldering skills are not sufficient to perform such tasks. What a pity.
Maybe I can interest someone to perform these tasks for me ( I have a small bulk of ESCs sitting in drawer, waiting).
Hamburger

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

ziss_dm wrote:Hi gompf-2 Quax,

....
I just point you to this because they also remove 3 caps in the commutation circuite.
....


Are they reffering to the to the LPF's in Back-EMF signal conditioner?
Are we sure, that they should be removed? ;)

regards,
ziss_dm


Hi ziss_dm,

i have a Mystery 30A and would like to test your modificated firmware. I'm unsure if the caps/resistors should be removed? Can i destroy the ESC if i don't remove them?

Thanks,
Heiko

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi funth1ngs,

In my case, I have removed caps after testing with 4s setup. With 3s it was working fine with caps.

regards,
ziss_dm

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hi ziss_dm,

i compiled the files with the following modifications:

Code: Select all

.equ    POWER_RANGE   = 250
.equ    MIN_RC_PULS   = 1000

; falling->rising intervals
.equ    MAX_INT_FR    = 2600 ; PWM + 100 = 2500 + 100
.equ    MIN_INT_FR    = 400 ;  PWM - MAX_RC_PULS - 100 = 2500 - 2000 - 100

; rising->falling intervals
.equ    MAX_INT_RF    = 2020 ; MAX_RC_PULS + 20 = 2000 + 20
.equ    MIN_INT_RF    = 980 ; MIN_RC_PULS - 20 = 1000 - 20


When I power up the ESC, the motor beeps and starts immediately to run at nearly full speed (rc_puls set to 1000ms). If I increase rc_puls, the speed increases too. But I can't stop the motor.

The PWM is arround 400Hz (2500ms) with 1000-2000ms rc_puls. Did I set the paramters correct?

Greetings,
Heiko

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Heiko,

I would guess, that you are modifying the pwm_arduino_250.inc file. The macros EvaluatePWC there is not subtracting MIN_RC_PULS and designed to accept PWM in range 16-2016ms .
In case you want standard RC range, just use other include pwm_rc_200.inc or pwm_fast_200.inc (second parameter of the _make.cmd).

pwm_arduino_250.inc:
POWER = Len / 8

pwm_rc_200.inc
POWER = (Len - MIN_RC_PULS) / 4

pwm_rc_100.inc
POWER = (Len - MIN_RC_PULS) / 8

regards,
ziss_dm
Attachments
Mystery20A_pwm_fast_200.zip
(2.85 KiB) Downloaded 690 times
bldc.zip
(103.55 KiB) Downloaded 598 times

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Thx ziss_dm,

it's working great now with 3s and 4s (the caps are still not removed) on the test bench. You guessed right, I've copied the pwm_arduino_250.inc and used it as template ;)

Cheers,
Heiko

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

Hi ziss_dm and quax,

I have a couple of questions regarding the internals of the ESC firmware, please. As you seem to have dived into the firmware internals I ask you for some insight.

You may or may not have followed my attempts to program a powermeter estimator based on the pwm signals sent to the ESC. This works with approx. 5% accuracy for me so far (with BlueSeries and Plush ESC; does not work well with HK SS ESCs). To improve accuracy and understanding I would like to learn more about firmware internals.

1. with arduino we send pwm out of [1000;2000] with step size of "1". But does ESC really care for this accuracy? How many steps resolution of the input signal does the firmware resolve?

2. by what formula does the input pwm signal get transferred into power outputted to motor? It is a linear function, I hope?

3. by power I mean voltage * current. Is the following correct?
- voltage: the voltage does not get moderated by the ESC; so is dependant on battery's ability to keep up with actual current
- current: the current gets moderated by the ESC depending on pwm input to achieve different rpm

Thanks, Hamburger

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hi,

it worked great, but now it's burned ;)

I made some fast throttle changes while the motor was running, no problems. Then while motor was not running, I've set throttle to 100% very fast. The motor made it's normal start sound, but just for a very short time and it did not start to spin. Then I heard some hard clicking and the ESC died.

Is it possible that there is a problem with the start up routine and "motor is running detection"? It looked like the motor was fully powered even though it wasn't spinning. Or could this been caused by the not removed caps/resistors?

I will order some new ones.

Thanks,
Heiko

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

funth1ngs wrote:Hi,

it worked great, but now it's burned ;)

I made some fast throttle changes while the motor was running, no problems. Then while motor was not running, I've set throttle to 100% very fast. The motor made it's normal start sound, but just for a very short time and it did not start to spin. Then I heard some hard clicking and the ESC died.

Is it possible that there is a problem with the start up routine and "motor is running detection"? It looked like the motor was fully powered even though it wasn't spinning. Or could this been caused by the not removed caps/resistors?

I will order some new ones.

Thanks,
Heiko


The answer is simple: It's absolutely forbidden to start with 100% power :!:

You cannot have both: a very fast reaction to the input changes and a slow down of the input reaction that is necessary to smoothen power jumps. If you increase the power of a brushless motor from lets say 30% to 100% it is equal to a accu short. The weakest link in the chain will be damaged. Therefore the increase has to be moderate or the ESC has to slow down power changes.

We need a fast power response for attitude control and therefore the power change control in the ESC software is omitted. The MultiWii software makes no sudden high power changes and doesn't destroy the ESC.

Regards,
quax

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Hamburger,

1. with arduino we send pwm out of [1000;2000] with step size of "1". But does ESC really care for this accuracy? How many steps resolution of the input signal does the firmware resolve?

This is not exactly true.
1) Arduino PWM has only 8 bit resolution. It has multiplier 8
2) To fit to the RC range 1000-2000, we have to limit values to the 125-250. So effectively WMC has < 7bit of the resolution of the PWM

The different ESC's firmwares have different internal resolution:
Mystery - 64 steps (according to my experiment)
Plush - 128 steps (according to my experiment)
BL-Ctrl 2.0 - 2048 steps
CC - 2048 steps
Quax - up to 255

2. by what formula does the input pwm signal get transferred into power outputted to motor? It is a linear function, I hope?

Sometimes yes, sometimes ESC has built-in throttle curve.

3. by power I mean voltage * current. Is the following correct?
- voltage: the voltage does not get moderated by the ESC; so is dependant on battery's ability to keep up with actual current
- current: the current gets moderated by the ESC depending on pwm input to achieve different rpm


I would say vice versa. The esc controls voltage and have no idea about current (we are talking about cheap escs). 50% of throttle usually means 50% of input voltage.


regards,
ziss_dm

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

Edit: ziss_dm was faster than me ;)

Hamburger wrote:....
1. with arduino we send pwm out of [1000;2000] with step size of "1". But does ESC really care for this accuracy? How many steps resolution of the input signal does the firmware resolve?
....

If you use an ESC with an onboard resonator of 16MHz, then you have 200 steps solution on the motors PWM side.
For an ESC that run with the internal 8MHz you have only 100 steps.
Meanwhile I can say that a solution of 100 ist sufficient for the attitude control of a quadrocopter.

Hamburger wrote:....
2. by what formula does the input pwm signal get transferred into power outputted to motor? It is a linear function, I hope?
....

It's linear, not least because of the calculation effort needed for other transfer characteristics.

Hamburger wrote:....
3. by power I mean voltage * current. Is the following correct?
- voltage: the voltage does not get moderated by the ESC; so is dependant on battery's ability to keep up with actual current
- current: the current gets moderated by the ESC depending on pwm input to achieve different rpm

Thanks, Hamburger

The voltage of the motor is the average of the motor-PWM. V_motor = on_time/pwm_period. If the PWM frequency is high enough, the voltage is transformed by the inductivity of the motor. The motor voltage controls the motor RPM.

The current depends on voltage, rpm and motor_properties. As the example of the sudden rise to 100% power shows, that current is also a function of the RPM. If you look for http://www.drivecalc.de/ (there is also an English version) you can see that behaviour in graphs and you can do some tests with the parameters.

Regards,
quax

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

ziss_dm and quax,

thanks to both of you for your explanations. Now I understand much better how to interprret the arduino output signals with respect of the power consumption. A future version of the power estimator could improve on that basis.

Hamburger

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

quax wrote:
funth1ngs wrote:Hi,

it worked great, but now it's burned ;)

I made some fast throttle changes while the motor was running, no problems. Then while motor was not running, I've set throttle to 100% very fast. The motor made it's normal start sound, but just for a very short time and it did not start to spin. Then I heard some hard clicking and the ESC died.

Is it possible that there is a problem with the start up routine and "motor is running detection"? It looked like the motor was fully powered even though it wasn't spinning. Or could this been caused by the not removed caps/resistors?

I will order some new ones.

Thanks,
Heiko


The answer is simple: It's absolutely forbidden to start with 100% power :!:

You cannot have both: a very fast reaction to the input changes and a slow down of the input reaction that is necessary to smoothen power jumps. If you increase the power of a brushless motor from lets say 30% to 100% it is equal to a accu short. The weakest link in the chain will be damaged. Therefore the increase has to be moderate or the ESC has to slow down power changes.

We need a fast power response for attitude control and therefore the power change control in the ESC software is omitted. The MultiWii software makes no sudden high power changes and doesn't destroy the ESC.

Regards,
quax


Hi Bernhard,

thanks for the explanation.

I made some quick changes from 5% to 100% and nothing happend as long as the motor was running. Because it has happened while the motor did not run, i thought it maybe has something to do with the start up routines or not removed caps.

Cheers,
Heiko

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Heiko,

I think, there are big difference between fast transitions and attempt to start at high power:
During fast transitions the motor start responding almost instantly and there are no big power difference between commutations. During startup it starts at low power and runs about second and then switches to the normal mode. If you set throttle to 100% this would produce step change between 5% and 100% and may damage FETs or even motor ;(

regards,
ziss_dm

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Quax,

Meanwhile I can say that a solution of 100 ist sufficient for the attitude control of a quadrocopter.


Currently I can test both 125 and 250 steps resolution on the same setup, just by re-flashing ESCs and WMC ;) And I would say there are big difference. With 250 steps resolution I pretty much cannot make it to oscillate (I have increased P up to 16 and stopped because, for some reason, it became difficult to control height. But was no signs of oscillations). Will see how it flies outdoors, but so far results are really promising. ;)

regards,
ziss_dm

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

ziss_dm wrote:Hi Heiko,

I think, there are big difference between fast transitions and attempt to start at high power:
During fast transitions the motor start responding almost instantly and there are no big power difference between commutations. During startup it starts at low power and runs about second and then switches to the normal mode. If you set throttle to 100% this would produce step change between 5% and 100% and may damage FETs or even motor ;(

regards,
ziss_dm


Hi ziss_dm,

it's hard to explain with my limited english :).

It looked like the startup didn't work and the ESC went into the normal mode although the motor has not rotated.

Cheers,
Heiko

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Heiko,

Was it completelly stopped for long time?

regards,
ziss_dm

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

Just a short video of ESCs running with 250 steps resolution, this is acro mode:
http://www.youtube.com/watch?v=n_g2s1nc ... rofilepage

regards,
ziss_dm

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

ziss_dm wrote:Hi Heiko,

Was it completelly stopped for long time?

regards,
ziss_dm


Hi ziss_dm,

I'm not 100% sure, but i think it was stopped for at least 5 - 10 seconds.

Cheers,
Heiko

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »


User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

ziss_dm wrote:Outdoor test:

togehter with the ESC test very convincing.

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

Hi ziss_dm,

looks great.

I'm interested in a personnel review.

Would you do me the favor and inform us about pros and cons?
If you have ideas for improvements, what should be added or changed?

Regards,

quax

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Quax,

Would you do me the favour and inform us about pros and cons?
If you have ideas for improvements, what should be added or changed?

First, I'll try to summarize the idea: Although your firmware can have resolution up to 255 steps, it still not utilized due limitation of the Arduino PWM output in standard RC range (125 steps) To overcome this limitation, we are extending acceptable PWC pulse range acceptable by ESC firmware to the 16-2016ms. Additionally, we also modifying WMC to output PWM in range 2-252.
Pros:
- Simple modifications for both ESC firmware and WMC
- Looks like additional 125 steps of resolution significantly improve precision and stability.
Cons:
- The ESC is not RC compatible any more, but we can always re-flash it back ;).
- The software decoder for PWC has significant amount of jitter. Probably better to use input capture, but it would require ESC rewiring.
- The margins are really small, which could lead to the problems. For example, 8mhz Plush was not arming, until I properly calibrated RC oscillator.
- With 8mhz ESC’s the PWM frequency probably too low.
Ideas:
- It would be interesting to test 1000 steps resolution somehow. To decide is it really worth an effort. ;)
- Maybe it is good idea to install current sensor on ESC and limit current using it. I think, it may improve efficiency and make ESC more universal

Regards,
Ziss_dm

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

Thanks ziss_dm for you comments :)

In the moment I run my BLCs with 255 -> 200 steps. I program the MWC outputs from 0% to 100% PWM. My BLC is connected via ICP1, measures the input PWM and convert it to 200 steps motor PWM. I fly with that setup from the beginning and for me it works fine. Unfortunately I'm not a very skilled pilot and can only say that the hovering is very stable.

- The software decoder for PWC has significant amount of jitter. Probably better to use input capture, but it would require ESC rewiring.

The ICP1 is much better and worth the rewiring. The 17a-type that I perfer, has the ICP1 open so it can be connected parallel to the INT0 pin.

- The margins are really small, which could lead to the problems. For example, 8mhz Plush was not arming, until I properly calibrated RC oscillator.

I don't use BLCs with internal 8MHz. The flea was an exception. But I thought about replacing the 16MHz with 20MHz. Some people say that is works fine. But I couldn't find a 20MHz resonator and the replacement with a crystal needs additional C's - to much effort and risk.

- With 8mhz ESC’s the PWM frequency probably too low.

Should be about 10kHz. I think an improvement would be, to start the motor with 20kHz or higher and let it run with 10kHz. We mostly use motors with low KV and then 10kHz is ok. Only on startup the current may go to high. That's a problem of all BLCs.

Ideas:
- It would be interesting to test 1000 steps resolution somehow. To decide is it really worth an effort.

I think 200 is enough and a lot of quadrocopters fly with only 100 steps. But I'm curious, if an expert can find an improvement at more steps. 1000 steps at 10kHz makes a step width of 100ns. I cannot believe that this difference is mechanical noticeable. There are a lot of unsymmetrical effects on each motor, e.g. the strength of the magnets, the distance between the magnets, the distance between stator and magnets, the difference in windings of the stator teeth. All this is unavoidable and even exists at high quality motors.

- Maybe it is good idea to install current sensor on ESC and limit current using it. I think, it may improve efficiency and make ESC more universal

Yes, I agree. That is the most important improvement. It's not only good for security and consumption measurement, there are also some ideas, how to start up the motor evaluating the current behaviour. Unfortunately no cheap motor has that feature. For my MWC I integrated a current measurement circuit for the whole current consuption. But that's only the second choice.
There are some DIY solutions (schematics and PCBs) with current measurement. But no design could find enough response to become popular.

Regards,
quax

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

ziss_dm wrote:First, I'll try to summarize the idea: Although your firmware can have resolution up to 255 steps, it still not utilized due limitation of the Arduino PWM output in standard RC range (125 steps) To overcome this limitation, we are extending acceptable PWC pulse range acceptable by ESC firmware to the 16-2016ms. Additionally, we also modifying WMC to output PWM in range 2-252.
Pros:
- Simple modifications for both ESC firmware and WMC
- Looks like additional 125 steps of resolution significantly improve precision and stability.
Cons:
- The ESC is not RC compatible any more, but we can always re-flash it back ;).
- The software decoder for PWC has significant amount of jitter. Probably better to use input capture, but it would require ESC rewiring.
- The margins are really small, which could lead to the problems. For example, 8mhz Plush was not arming, until I properly calibrated RC oscillator.
- With 8mhz ESC’s the PWM frequency probably too low.
Ideas:
- It would be interesting to test 1000 steps resolution somehow. To decide is it really worth an effort. ;)
- Maybe it is good idea to install current sensor on ESC and limit current using it. I think, it may improve efficiency and make ESC more universal


I am obviously not qualified to comment as an expert here, but maybe the view of an interested user can be helpful as well.
- voiding general usability is ok, even without re-flashability. The ESCs' prices are low enough.
- extending pwm input range to gain more effective stick granularity sounds good. Altering MWii software is an acceptable burden (supposing it can be done)
- completely eliminating the setup-by-beeps-and-throttle procedure is a huge bonus from user perspective, imho.
- using high end motors with current sensors is not an option - too expensive, too few choices, no choices in the small power range of motors (I could not find any)
- electrically chaging the ESCs for current measurement sounds work intensive. For my copters > 300 grams I now use these hardware sensors form amploc. http://amploc.com/store/index.html Advantage: no electric contact to high currents. I d not know if this could ease the implementation you seem to have in mind.
Keep up the good work, it sounds very promising.
Hamburger

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

Again thanks for the feedback. Let's see, what we can solve :)

Hamburger wrote:- using high end motors with current sensors is not an option - too expensive, too few choices, no choices in the small power range of motors (I could not find any)

Sorry, I said it wrong, I ment BLCs with a current sensor and not motors. You are right, there are no motors with a current shunt.

Hamburger wrote:- electrically chaging the ESCs for current measurement sounds work intensive. For my copters > 300 grams I now use these hardware sensors form amploc. http://amploc.com/store/index.html Advantage: no electric contact to high currents. I d not know if this could ease the implementation you seem to have in mind.

Great, that sensor is fantastic. Cheap, simple to implement, and fast, so that also a current interpreter for the startup may work. Normally I would also use one for a MWC and the over all current consumption. For tests on the bench it's also useful for a single BLC. From my next budget I will invest some money for this current sensor :)


Yesterday I received my Mystery20A from Hobbyking and I was also able to read the flash/eeprom back. It was completely unlocked :mrgreen:
Next I will test the original software for it's properties. If it works fine, it could be converted for other BLCs with disappointing properties. There is also a governor mode that maybe interisting. I'm not sure that I would have tried to read the BLC out.


Regards,
quax

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

quax wrote:Great, that sensor is fantastic. Cheap, simple to implement, and fast, so that also a current interpreter for the startup may work. Normally I would also use one for a MWC and the over all current consumption. For tests on the bench it's also useful for a single BLC. From my next budget I will invest some money for this current sensor :)

yes, this sensor works well with MultiWii for the 'over all power consumption' already. I did the implementation some time ago; included in v1.8. It works well on two of my copters.

Thanks for the ongoing efforts. Hamburger

funth1ngs
Posts: 68
Joined: Tue Aug 09, 2011 8:37 pm

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

quax wrote: Yesterday I received my Mystery20A from Hobbyking and I was also able to read the flash/eeprom back. It was completely unlocked :mrgreen:
Next I will test the original software for it's properties. If it works fine, it could be converted for other BLCs with disappointing properties. There is also a governor mode that maybe interisting. I'm not sure that I would have tried to read the BLC out.


Hi Bernhard,

I have heard that the new Hobbyking/Mystery Blueseries have ony N-Channel mosfets. Can you confirm this?

Cheers,
Heiko

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

Hi Heiko,

my Mystery-20A has high-side P-FETs and low-side N-FETs.

But a bird piped into my ear that there is an alternate power FET solution. It looks like this:

Image

On the first view it looks like a puzzle to find out, how it works ;)

regards,
Bernhard
Last edited by quax on Mon Aug 22, 2011 7:51 pm, edited 1 time in total.

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Alternative ESC firmware (reflashing)

Post by marbalon »

I have another question. Is this possible to make software for ESC with overcurrent control? It don't need to be so fast like this one but safer for mosfets ;) Just more steps like you created 200 or 254 little faster but I'm not a good pilot and afraid that I need to change mosfets on ESC often than propellers :(

Thanks for your work!

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

marbalon wrote:I have another question. Is this possible to make software for ESC with overcurrent control? It don't need to be so fast like this one but safer for mosfets ;) Just more steps like you created 200 or 254 little faster but I'm not a good pilot and afraid that I need to change mosfets on ESC often than propellers :(

Thanks for your work!


Unfortunately there is no current sensor on the cheap chinese ESCs. Therefore it's not possible to detect an overcurrent.
But there are some security functions in the software that detect a blocked motor and switches the power off.

cu
Bernhard

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Alternative ESC firmware (reflashing)

Post by marbalon »

Quax thank for quick reply. So functions used for motor stop detection works to slow for tunned software ?

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

But there are some security functions in the software that detect a blocked motor and switches the power off.

That is the function of my software. I don't know, what the original software really does.

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Alternative ESC firmware (reflashing)

Post by marbalon »

Hmm but Mystery20A_arduino_pwm.zip comes from you or ziss_dm? My firen use it in mystery 12A and works superb except overcurent detecition. So this functions in in this firmware and should bee tunned for 12A or you still porting your firmware to mystery ?

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

marbalon wrote:Hmm but Mystery20A_arduino_pwm.zip comes from you or ziss_dm? My firen use it in mystery 12A and works superb except overcurent detecition. So this functions in in this firmware and should bee tunned for 12A or you still porting your firmware to mystery ?

That's basically my software.
As I told you, it is not possible to implement an overcurrent function. There is no current sensor.

My software detects dangerous situations, e.g. a blocking of the motor.

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Alternative ESC firmware (reflashing)

Post by marbalon »

Sorry I just try to say that my friend burn 2 ESC because land in grass and propellers stop the motor. So this it was because he have 12A and blocking motor detection is not working on it? Or maybe this is not ideal and sometimes this can happened?

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

I tried to upload new firmware into Mystery20A and also in HK BlueSeries 20A, but I failed.
First I tried:

Code: Select all

D:\Dokumenty\arduino ostatní\mystery>"D:\Program files\arduino-0022\hardware\too
ls\avr\bin\avrdude.exe" -C "D:\Program files\arduino-0022\hardware\tools\avr\etc
\avrdude.conf" -v -p m8 -P com5  -c avrisp -b 19200 -F

avrdude.exe: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

             System wide configuration file is "D:\Program files\arduino-0022\ha
rdware\tools\avr\etc\avrdude.conf"

             Using Port            : com5
             Using Programmer      : avrisp
             Overriding Baud Rate  : 19200
             AVR Part              : ATMEGA8
             Chip Erase delay      : 10000 us
             PAGEL                 : PD7
             BS2                   : PC2
             RESET disposition     : dedicated
             RETRY pulse           : SCK
             serial program mode   : yes
             parallel program mode : yes
             Timeout               : 200
             StabDelay             : 100
             CmdexeDelay           : 25
             SyncLoops             : 32
             ByteDelay             : 0
             PollIndex             : 3
             PollValue             : 0x53
             Memory Detail         :

                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
 ----- ---------
               eeprom         4    20   128    0 no        512    0      0  9000
  9000 0xff 0xff
               flash         33    10    64    0 yes      8192   64    128  4500
  4500 0xff 0x00
               lfuse          0     0     0    0 no          1    0      0  2000
  2000 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  2000
  2000 0x00 0x00
               lock           0     0     0    0 no          1    0      0  2000
  2000 0x00 0x00
               calibration    0     0     0    0 no          4    0      0     0
     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0
     0 0x00 0x00

             Programmer Type : STK500
             Description     : Atmel AVR ISP
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA8 is 1E 93 07
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as FF

avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as FF
avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.


And then:

Code: Select all

D:\Dokumenty\arduino ostatní\mystery>"D:\Program files\arduino-0022\hardware\too
ls\avr\bin\avrdude.exe" -C "D:\Program files\arduino-0022\hardware\tools\avr\etc
\avrdude.conf" -p m8 -P com5  -c avrisp -b 19200 -U flash:w:Mystery20A_arduino_p
wm.hex -F

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA8 is 1E 93 07
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "Mystery20A_arduino_pwm.hex"
avrdude.exe: input file Mystery20A_arduino_pwm.hex auto detected as Intel Hex
avrdude.exe: writing flash (2336 bytes):

Writing | ################################################## | 100% 3.80s

avrdude.exe: 2336 bytes of flash written
avrdude.exe: verifying flash memory against Mystery20A_arduino_pwm.hex:
avrdude.exe: load data flash data from input file Mystery20A_arduino_pwm.hex:
avrdude.exe: input file Mystery20A_arduino_pwm.hex auto detected as Intel Hex
avrdude.exe: input file Mystery20A_arduino_pwm.hex contains 2336 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 4.17s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
             0x18 != 0xff
avrdude.exe: verification error; content mismatch

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

Before and after both the ESC's works, as I programmed anything.
You advise me some?

User avatar
quax
Posts: 47
Joined: Mon Mar 14, 2011 12:28 pm
Contact:

Re: Alternative ESC firmware (reflashing)

Post by quax »

@marbalon
I did my very best, but there are always some situations that are not covered.

@Stalk
These lines look like an incorrect connection:

Code: Select all

avrdude.exe: Device signature = 0xffffff
avrdude.exe: Yikes!  Invalid device signature.
avrdude.exe: Expected signature for ATMEGA8 is 1E 93 07


avrdude read 0xffffff, means, that it saw only an high line, not driven by MISO from the AVR.
You should control the ISP connection.

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

I use Mega Seeduino v1.22 as a programmer. ISP pins are 10,11,12,13 or 50,51,52,53? Here I could be wrong.
Thank you for your answer.

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

We figured it out. The Mega Seeduino it is:
Reset - 53
MOSI - 51
MISO - 50
SCK - 52
Everything went as it should :lol: , but the ESC will beep three times and just enough. Arduino Pro Mini MWC him start. :roll: :cry:
What to do, please help. :?: :?:

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

Correction:
The motor will beep four times. They try to spin, but not spin. Only turning jerkily.
Where's my mistake, please? :|

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

In this way I program without soldering.
Attachments
pgramming ESCm.jpg

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

I reflashing alternative firmware to ESC Mystery 20A. I modified the MWC by ziss_dm. I have connected the engine Keda 20-50. The engine does not start. Only slowly rotate jerky.
How can I be wrong?
Thanks for any reply.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Stalk,

You can try to slightly increase MINTHROTTLE from 1080 to something like 1120.

regards,
ziss_dm

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

Hi ziss_dm
Thank you for your reply.
I tried MINTHROTTLE until 1250, but unsuccessfully. I also tried a bigger engine 20-22L, but nothing.

Is this correct?

Code: Select all

void writeMotors() { // [1000;2000] => [125;250
  for(uint8_t i=0;i<min(NUMBER_MOTOR,4);i++
    #ifndef EXT_MOTOR_RANGE
      analogWrite(PWM_PIN[i], motor[i]>>3);
    #else
      analogWrite(PWM_PIN[i], ((motor[i]>>2) - 250) + 2);
    #endif
  #if (NUMBER_MOTOR == 6) && defined(MEGA)
.
.
.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Stalk,
Are you using MEGA? You also can try to flash normal RC firmware to test.

regards,
ziss_dm

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

Unfortunately I'm at work. I will try it tonight. Should I remove the capacitors, which are discussed above?
I do not know but ktré are.
thank you

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: Alternative ESC firmware (reflashing)

Post by Stalk »

Hi ziss_dm,
I flash normal RC firmware back intu ESC and its work normally.
However, when I flash fast firmware again, it does not work. Only four beeps and turn choppy when I turn on the motor.
It would help remove the three capacitors, which you talked about earlier? I'm running on 3 lipo.
thank you

regards
Stalk

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Stalk,

Are we talking about , Mystery20A_pwm_fast_200.zip from here viewtopic.php?f=13&t=516&start=30 ?
Or you flashed backup of the original firmware?

regards,
ziss_dm

Post Reply