Alternative ESC firmware (reflashing)
Alternative ESC firmware (reflashing)
Hi,
A little bit history first. Recently I have replaced ESCs in my quad from Mystery 20A Brushless Speed Controller (Blue Series) to the Turnigy Plush 30A. And I would say that this dramatically changed behaviour, it was not bad before, but now it is significantly more stable!
So, I was curious what is so different about them and I have performed couple of bench tests. I’m not saying that it was really precise tests and could provide only general points:
1) Mystery ESC is more responsive to the throttle commands
2) Mystery ESC is more linear to the throttle (at least according to the current). The Plushes have more exponential throttle curve.
3) But Mystery ESC has only around 60 points resolution (again according to the current) and Plush has more than 100
According to this results, looks like, MultiWII likes more ESCs with higher resolution than ones with quicker response times. BTW, I would not recommend using Plushes as they have big problems keeping motors in sync during fast manoeuvres. I already have couple of crashes due motor(s) just stops in flight.
So currently I’m investigating possibility to re-flash Mystery ESC to the Quax firmware. The idea is to improve resolution. If somebody have experience with it, your help will be really appreciated.
regards,
ziss_dm
A little bit history first. Recently I have replaced ESCs in my quad from Mystery 20A Brushless Speed Controller (Blue Series) to the Turnigy Plush 30A. And I would say that this dramatically changed behaviour, it was not bad before, but now it is significantly more stable!
So, I was curious what is so different about them and I have performed couple of bench tests. I’m not saying that it was really precise tests and could provide only general points:
1) Mystery ESC is more responsive to the throttle commands
2) Mystery ESC is more linear to the throttle (at least according to the current). The Plushes have more exponential throttle curve.
3) But Mystery ESC has only around 60 points resolution (again according to the current) and Plush has more than 100
According to this results, looks like, MultiWII likes more ESCs with higher resolution than ones with quicker response times. BTW, I would not recommend using Plushes as they have big problems keeping motors in sync during fast manoeuvres. I already have couple of crashes due motor(s) just stops in flight.
So currently I’m investigating possibility to re-flash Mystery ESC to the Quax firmware. The idea is to improve resolution. If somebody have experience with it, your help will be really appreciated.
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
I developed the software for that purpose and, of course, I use it in my MWC.
I have a very special solution implemented. The motor outputs are programmed as 4kHz PWM from 0-100% duty cycle. The BLCs are programmed to evaluate this 4kHz input and therefore the motor-power is updated with a 4kHz rate. The new motor-power is set directly without any timing ramp.
The default PID values were to high for my MWC
This is the fastest motor-power control I know.
But I have also versions that can accept a very high input rate of 1-2ms input pulses. They can do also a direct tranfer of the input-value to the motor-power. Unfortunately there are a lot of different HK-BLCs out there and they are often sold with different hardware under the same name.
In the DIY thread of rcgroups there are some disclosed versions. Newer BLCs have a C8051F330 type mcu instead of an ATmega8 type. For those new versions there is still no software available.
I have a very special solution implemented. The motor outputs are programmed as 4kHz PWM from 0-100% duty cycle. The BLCs are programmed to evaluate this 4kHz input and therefore the motor-power is updated with a 4kHz rate. The new motor-power is set directly without any timing ramp.
The default PID values were to high for my MWC
This is the fastest motor-power control I know.
But I have also versions that can accept a very high input rate of 1-2ms input pulses. They can do also a direct tranfer of the input-value to the motor-power. Unfortunately there are a lot of different HK-BLCs out there and they are often sold with different hardware under the same name.
In the DIY thread of rcgroups there are some disclosed versions. Newer BLCs have a C8051F330 type mcu instead of an ATmega8 type. For those new versions there is still no software available.
Re: Alternative ESC firmware (reflashing)
I am not at all familiar with the intricacies of ESCs, so consider this a question out of curiosity.
Could we not bypass the entire ESC hassle and have our MultiWii arduino drive the power mosfets (or whatever it is that handles the big amperes) directly?
Could we not bypass the entire ESC hassle and have our MultiWii arduino drive the power mosfets (or whatever it is that handles the big amperes) directly?
Re: Alternative ESC firmware (reflashing)
Hamburger wrote:.....
Could we not bypass the entire ESC hassle and have our MultiWii arduino drive the power mosfets (or whatever it is that handles the big amperes) directly?
The control of the Power-FETs is not the problem. The problem is to evaluate the rotor position, calculate the commutation timing and do the commutation with a correct timing. For a good control you need a MCU on each BLC.
Re: Alternative ESC firmware (reflashing)
@quax
which blc's do you prefer for your firmware?
Thank'S
which blc's do you prefer for your firmware?
Thank'S
Re: Alternative ESC firmware (reflashing)
These two types are my favorit ESCs:
http://www.hobbyking.com/hobbyking/stor ... A_ESC.html
http://www.hobbyking.com/hobbyking/stor ... A_ESC.html
The problem is, that they are more and more replaced by a C8051F330 controlled device with the same brand. There is still no software available for the C8051F330.
http://www.hobbyking.com/hobbyking/stor ... A_ESC.html
http://www.hobbyking.com/hobbyking/stor ... A_ESC.html
The problem is, that they are more and more replaced by a C8051F330 controlled device with the same brand. There is still no software available for the C8051F330.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Alternative ESC firmware (reflashing)
ziss_dm wrote:A little bit history first. Recently I have replaced ESCs in my quad from Mystery 20A Brushless Speed Controller (Blue Series) to the Turnigy Plush 30A. And I would say that this dramatically changed behaviour, it was not bad before, but now it is significantly more stable!
I replaced today on a quad my 4 Mystery 12A Brushless Speed Controller (Blue Series) to the HK Super Simple 18A.
I noticed the same. The behavior is far more predictable and safe.
Mystery blue series are definitively not the best choice for multiwii.
Re: Alternative ESC firmware (reflashing)
Hi quax,
I have another question bl-17a.asm or tp-18a.asm? Are they supposed to be the same (apart from timings)?
In my case bl-17a.asm behaves better on sturtup..
So far my progress is:
1) Created ISP programmer from Arduino (ArduinoISP example )
2) Have managed to backup firmware from Mystery 20A (chip is not locked)
3) Have managed to adjust pin mapping for the bl-17a firmware for Mystery 20A
4) Have managed to adjust input PWM timings in the bl-17a firmware to accept timings in range 16-2000 usec. This would "align" it to the Arduino's PWM analogWrite(), with range 2-250. Which should give 248 steps of effective resolution. (for standard ESC's we have range 125-250 1000-2000 usec)
5) Re-flashed one of Plushes with tp-18a.asm
To Do:
1) Sort out startup issues with tp-18a.asm
2) Try to adjust input timings in tp-18a.asm
3) Adjust MWC to use extended resolution
4) Test
regards,
ziss_dm
I have another question bl-17a.asm or tp-18a.asm? Are they supposed to be the same (apart from timings)?
In my case bl-17a.asm behaves better on sturtup..
So far my progress is:
1) Created ISP programmer from Arduino (ArduinoISP example )
2) Have managed to backup firmware from Mystery 20A (chip is not locked)
3) Have managed to adjust pin mapping for the bl-17a firmware for Mystery 20A
4) Have managed to adjust input PWM timings in the bl-17a firmware to accept timings in range 16-2000 usec. This would "align" it to the Arduino's PWM analogWrite(), with range 2-250. Which should give 248 steps of effective resolution. (for standard ESC's we have range 125-250 1000-2000 usec)
5) Re-flashed one of Plushes with tp-18a.asm
To Do:
1) Sort out startup issues with tp-18a.asm
2) Try to adjust input timings in tp-18a.asm
3) Adjust MWC to use extended resolution
4) Test
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
ziss_dm wrote:Hi quax,
I have another question bl-17a.asm or tp-18a.asm? Are they supposed to be the same (apart from timings)?
In my case bl-17a.asm behaves better on sturtup..
....
There are a big differences in the design.
The tp-17a uses 3 multiplexed comparator inputs and has usually a 16MHz resonator.
The tp-18a uses 2 multiplexed comparator inputs and the original second comparator input and runs with the internal 8MHz oscillator.
Both versions have to be adapted to the port usage of the chosen ESC.
You should evaluate your ESC version first.
ziss_dm wrote:....
2) Have managed to backup firmware from Mystery 20A (chip is not locked)
....
If you really could read the firmware, than you are the first one (as far I know).
Normally you only read the low address or 0xff or something like that.
But If you really managed to read the firmware, you would do me a huge favor, if you send it to me. I'm very curious, how they do the control. Even if it is a C-compiled code, I expect to have a chance of understanding. (my email address in on my homepage).
ziss_dm wrote:....
3) Have managed to adjust pin mapping for the bl-17a firmware for Mystery 20A
4) Have managed to adjust input PWM timings in the bl-17a firmware to accept timings in range 16-2000 usec. This would "align" it to the Arduino's PWM analogWrite(), with range 2-250. Which should give 248 steps of effective resolution. (for standard ESC's we have range 125-250 1000-2000 usec)
5) Re-flashed one of Plushes with tp-18a.asm
....
Sounds good, but why did you change the 17a software to load in the end the 18a software?
ziss_dm wrote:....
To Do:
1) Sort out startup issues with tp-18a.asm
2) Try to adjust input timings in tp-18a.asm
3) Adjust MWC to use extended resolution
4) Test
regards,
ziss_dm
Please keep us informed. I must admit, that I only would reflash the ESC, if it is necessary. If the quad flys great, I would take the ESC as it is sold.
greeting,
quax
Re: Alternative ESC firmware (reflashing)
Hi quax,
Tnx, somehow I have missed comparator differences (thought, that this is leftovers from voltage/current measurements). I'm trying to adapt tp-17a to the Plush as it looks like, this version has more tweaks and fixes
I will post backup of the firmware tonight.
regards,
ziss_dm
There are a big differences in the design.
The tp-17a uses 3 multiplexed comparator inputs and has usually a 16MHz resonator.
The tp-18a uses 2 multiplexed comparator inputs and the original second comparator input and runs with the internal 8MHz oscillator.
Tnx, somehow I have missed comparator differences (thought, that this is leftovers from voltage/current measurements). I'm trying to adapt tp-17a to the Plush as it looks like, this version has more tweaks and fixes
I will post backup of the firmware tonight.
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
Hi quax,
Just for curiosity:
Is it really metter which FET doing PWM (N or P)? Maybe it would be better to clamp transistor bases trough Shottki diodesd to the OCP pin and run HW PWM on timer2? Or I'm inventing a wheel?
regards,
ziss_dm
Just for curiosity:
Is it really metter which FET doing PWM (N or P)? Maybe it would be better to clamp transistor bases trough Shottki diodesd to the OCP pin and run HW PWM on timer2? Or I'm inventing a wheel?
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
ziss_dm wrote:Hi quax,
Just for curiosity:
Is it really metter which FET doing PWM (N or P)?
....
The low cost ESCs have normally only a transistor control for the high side FETs. That's a slow switch and cannot be used for 8kHz or more motor-PWM. Only the low side FETs are driven on and off with high speed and switch fast enough.
There are also some low cost ESCs in the higher power range, which are also driven on the high side. Those can do both either N-PWM or P-PWM. But the most importand improvement of high and low side driven ESC is the capability of the free running mode, that allows to decrease the power lost of the ESC.
ziss_dm wrote:....
Maybe it would be better to clamp transistor bases trough Shottki diodesd to the OCP pin and run HW PWM on timer2? Or I'm inventing a wheel?
regards,
ziss_dm
There are some attempts to do this on some 18a types. They made an interesting resistor coupling for that feature. But I don't know, if it was really implemented there.
greetings
quax
Re: Alternative ESC firmware (reflashing)
Hi Quax,
This is Mystery firmware backup.
regards,
ziss_dm
This is Mystery firmware backup.
regards,
ziss_dm
- Attachments
-
- Mystery20A.zip
- (113.5 KiB) Downloaded 1885 times
Re: Alternative ESC firmware (reflashing)
Hi Quax,
You probably tired of my questions, but I would try once again.
set_new_duty:
As I understand it supposed to limit power on startup to the PWR_MAX_STARTUP (in case it is called from startup routine). But because all timings initialized to the 3FFFF (1FFFF) it skips this check... ;( And power is unlimited. So, what is better:
1) Move check for startup sooner
2) or initialize timings with zeros
regards,
ziss_dm
You probably tired of my questions, but I would try once again.
set_new_duty:
Code: Select all
set_new_duty: mov temp1, ZH
sub temp1, sys_control
brcc set_new_duty10
ldi temp1, MIN_DUTY-1
set_new_duty10: lds temp2, timing_x
tst temp2
brne set_new_duty12
lds temp2, timing_h ; get actual RPM reference high
cpi temp2, PWR_RANGE1 ; lower range1 ?
brcs set_new_duty20 ; on carry - test next range
set_new_duty12: sbr flags2, (1<<RPM_RANGE1)
sbr flags2, (1<<RPM_RANGE2)
ldi temp2, PWR_MAX_RPM1 ; higher than range1 power max ?
cp temp1, temp2
brcs set_new_duty31 ; on carry - not higher, no restriction
mov temp1, temp2 ; low (range1) RPM - set PWR_MAX_RPM1
rjmp set_new_duty31
set_new_duty20: sbrs flags2, STARTUP
rjmp set_new_duty25
ldi temp3, PWR_MAX_STARTUP ; limit power in startup phase
cp temp1, temp3
brcs set_new_duty25 ; on carry - not higher, test range 2
mov temp1, temp3 ; set PWR_MAX_STARTUP limit
rjmp set_new_duty31
set_new_duty25: cpi temp2, PWR_RANGE2 ; lower range2 ?
brcs set_new_duty30 ; on carry - not lower, no restriction
cbr flags2, (1<<RPM_RANGE1)
sbr flags2, (1<<RPM_RANGE2)
ldi temp2, PWR_MAX_RPM2 ; higher than range2 power max ?
cp temp1, temp2
brcs set_new_duty31 ; on carry - not higher, no restriction
mov temp1, temp2 ; low (range2) RPM - set PWR_MAX_RPM2
rjmp set_new_duty31
set_new_duty30: cbr flags2, (1<<RPM_RANGE1)+(1<<RPM_RANGE2)
set_new_duty31: com temp1 ; down-count to up-count (T0)
mov tcnt0_pwron_next, temp1 ; save in next
;!!!!!
mov tcnt0_power_on, temp1
;!!!!!
; tcnt0_power_on is updated to tcnt0_pwron_next in acceptable steps
ret
As I understand it supposed to limit power on startup to the PWR_MAX_STARTUP (in case it is called from startup routine). But because all timings initialized to the 3FFFF (1FFFF) it skips this check... ;( And power is unlimited. So, what is better:
1) Move check for startup sooner
2) or initialize timings with zeros
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
Hi ziss_dm,
many thanks for the files. I'm quite sure, that you are the first one, who detected an open AVR on an ESC.
The code looks sensfully and seemed to be written in ASM
Hopefully I get some time to investigate it. I'm very curious about the startup sequence.
Do you have an image of the 'naked' Mystery-20A? Does it have the same port usage as the 17a?
No, I'm never tired of interest
There are two intentions in this function:
1.) At lower RPM the PMW is limitted because the current grows very high on the mismatch of RPM and PWM. There are two ranges that have limits.
PWR_RANGE1 corresponds with PWR_MAX_RPM1
PWR_RANGE2 corresponds with PWR_MAX_RPM2
2.) In the startup phase there are special power conditions, because some motor need high power at startup and run reliable with lower power.
if the STARTUP flag is set, the PWM is always between PWR_STARTUP and PWR_MAX_STARTUP.
It looks, as if you catched an older version of set_new_duty:
Here is an actual one:
For the use with a MWC you should theses lines again:
greetings
quax
many thanks for the files. I'm quite sure, that you are the first one, who detected an open AVR on an ESC.
The code looks sensfully and seemed to be written in ASM
Hopefully I get some time to investigate it. I'm very curious about the startup sequence.
Do you have an image of the 'naked' Mystery-20A? Does it have the same port usage as the 17a?
ziss_dm wrote:Hi Quax,
You probably tired of my questions, but I would try once again.
....
No, I'm never tired of interest
ziss_dm wrote:....
set_new_duty:Code: Select all
.....
As I understand it supposed to limit power on startup to the PWR_MAX_STARTUP (in case it is called from startup routine). But because all timings initialized to the 3FFFF (1FFFF) it skips this check... ;( And power is unlimited. So, what is better:
1) Move check for startup sooner
2) or initialize timings with zeros
regards,
ziss_dm
There are two intentions in this function:
1.) At lower RPM the PMW is limitted because the current grows very high on the mismatch of RPM and PWM. There are two ranges that have limits.
PWR_RANGE1 corresponds with PWR_MAX_RPM1
PWR_RANGE2 corresponds with PWR_MAX_RPM2
2.) In the startup phase there are special power conditions, because some motor need high power at startup and run reliable with lower power.
if the STARTUP flag is set, the PWM is always between PWR_STARTUP and PWR_MAX_STARTUP.
It looks, as if you catched an older version of set_new_duty:
Here is an actual one:
Code: Select all
;-----bko-----------------------------------------------------------------
set_new_duty: mov temp1, ZH
sub temp1, sys_control
brcc set_new_duty10
ldi temp1, MIN_DUTY-1
; evaluate RPM range
set_new_duty10: lds temp2, timing_x
tst temp2
brne set_new_duty12
lds temp2, timing_h ; get actual RPM reference high
cpi temp2, PWR_RANGE1 ; lower range1 ?
brcs set_new_duty20 ; on carry - test next range
; lower as range1
set_new_duty12: sbr flags2, (1<<RPM_RANGE1)
sbr flags2, (1<<RPM_RANGE2)
ldi temp2, PWR_MAX_RPM1 ; higher than range1 power max ?
cp temp1, temp2
brcs set_new_duty40 ; on carry - not higher, no restriction
mov temp1, temp2 ; low (range1) RPM - set PWR_MAX_RPM1
rjmp set_new_duty40
; higher as range1
set_new_duty20: cpi temp2, PWR_RANGE2 ; lower range2 ?
brcs set_new_duty30 ; on carry - not lower, no restriction
set_new_duty22: cbr flags2, (1<<RPM_RANGE1)
sbr flags2, (1<<RPM_RANGE2)
ldi temp2, PWR_MAX_RPM2 ; higher than range2 power max ?
cp temp1, temp2
brcs set_new_duty40 ; on carry - not higher, no restriction
mov temp1, temp2 ; low (range2) RPM - set PWR_MAX_RPM2
rjmp set_new_duty40
; higher as range2
set_new_duty30: cbr flags2, (1<<RPM_RANGE1)+(1<<RPM_RANGE2)
; range limits are evaluated - look for STARTUP conditions
set_new_duty40: sbrs flags2, STARTUP
rjmp set_new_duty50
ldi temp3, PWR_STARTUP ; at least PWR_STARTUP ?
cp temp1, temp3
brcc set_new_duty42 ; on no carry - higher than PWR_STARTUP, test PWR_MAX_STARTUP
ldi temp1, PWR_STARTUP ; lower - set to PWR_STARTUP
rjmp set_new_duty50
set_new_duty42: ldi temp3, PWR_MAX_STARTUP ; limit power in startup phase
cp temp1, temp3
brcs set_new_duty50 ; on carry - not higher, test range 2
mov temp1, temp3 ; set PWR_MAX_STARTUP limit
set_new_duty50: com temp1 ; down-count to up-count (T0)
mov tcnt0_pwron_next, temp1 ; save in next
; tcnt0_power_on is updated to tcnt0_pwron_next in acceptable steps
ret
;-----bko-----------------------------------------------------------------
For the use with a MWC you should theses lines again:
Code: Select all
.....
;!!!!!
mov tcnt0_power_on, temp1
;!!!!!
greetings
quax
Re: Alternative ESC firmware (reflashing)
quax wrote:....
Do you have an image of the 'naked' Mystery-20A? Does it have the same port usage as the 17a?
....
Hi ziss_dm,
I just saw, that you have updated the bl-17a.inc with the M-20A port usage.
That's a great help to understand the code.
You made a change here:
Code: Select all
.equ MIN_RC_PULS = 17*2 ; µs (or lower) = NO_POWER
and here:
Code: Select all
cpi i_temp1, low (16*2)
ldi i_temp3, high(16*2) ; test range low
I'm not sure about the meaning of the changes.
Do you want an input control from 16ms to 2000ms pulse-width from minimum power to maximum power?
regards
quax
Re: Alternative ESC firmware (reflashing)
Hi quax,
Yes, because it matches Arduino's PWM in range 2-250 (AnalogWrite()) and gives 248 steps of effective resolution. (For standard RC ESCs we have range 125-250 => 1000-2000ms)
regards,
ziss_dm
Do you want an input control from 16ms to 2000ms pulse-width from minimum power to maximum power?
Yes, because it matches Arduino's PWM in range 2-250 (AnalogWrite()) and gives 248 steps of effective resolution. (For standard RC ESCs we have range 125-250 => 1000-2000ms)
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
Hi!
Some guys in the ARM-o-Kopter forums modded quax 17a firmware for the Mystery Blue series, but rs232 only. I just point you to this because they also remove 3 caps in the commutation circuite. Maybe you have a look on this : http://www.armokopter.at/forum/viewtopic.php?f=9&t=1360 (german)
Edit: Also very interesting, 1-wire bootloader for BLMCs (sorry, also in german): http://www.armokopter.at/wiki/doku.php?id=aok:elektronik:regler_neu:bootloader
Regards,
gompf
Some guys in the ARM-o-Kopter forums modded quax 17a firmware for the Mystery Blue series, but rs232 only. I just point you to this because they also remove 3 caps in the commutation circuite. Maybe you have a look on this : http://www.armokopter.at/forum/viewtopic.php?f=9&t=1360 (german)
Edit: Also very interesting, 1-wire bootloader for BLMCs (sorry, also in german): http://www.armokopter.at/wiki/doku.php?id=aok:elektronik:regler_neu:bootloader
Regards,
gompf
Re: Alternative ESC firmware (reflashing)
gompf-2 wrote:....
I just point you to this because they also remove 3 caps in the commutation circuite.
....
Thanks for the hint, it is absolutely necessary to remove these caps with my software.
Someone can do me a favour and measure the value of the caps. I would like to investigate the behavior of my software with such caps, but would like to know, what values are used e.g. by Mystery
Re: Alternative ESC firmware (reflashing)
Fluke 289 gives me 1.14,1.16,1.16nF (desoldered of course) so I asume them to be 1200pF. The one in the RC input filter measures 0.635nF, shoud be 680pf.
ESC is HK 12A blue series, new version (Rs/Cs placed not so ordered).
ESC is HK 12A blue series, new version (Rs/Cs placed not so ordered).
Re: Alternative ESC firmware (reflashing)
gompf-2 wrote:Fluke 289 gives me 1.14,1.16,1.16nF (desoldered of course) so I asume them to be 1200pF. The one in the RC input filter measures 0.635nF, shoud be 680pf.
ESC is HK 12A blue series, new version (Rs/Cs placed not so ordered).
Thanks, I was wondering, how they want to do high RPM rates. But with 1nF or 1,2nF it should be ok. It's more a spike limiter than a timing element.
Maybe I order a 20A version by next chance.
greetings
quax
Re: Alternative ESC firmware (reflashing)
ziss_dm wrote:Hi Quax,
This is Mystery firmware backup.
regards,
ziss_dm
Thanks again.
But I must say, although I know a lot about the topic, it's a mystery and not an open book
In the moment I cannot preview when I will have understood all the program functions. It's more difficult as I expected. But I like this kind of puzzle
greets
quax
Re: Alternative ESC firmware (reflashing)
Hi gompf-2 Quax,
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
....
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
Re: Alternative ESC firmware (reflashing)
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
I just ordered a Mystery 20A for testing. A capacitor in that range may work, but I don't know it. Therefore I need an ESC for testing and measurement, e.g. with my scope. The opportunity to reload the original software , makes this device to a preferred test object.
Normally there shouldn't be a capacitor in the BEMF circuit. Higher values like 100nF don't work for sure, because the motor timing depends on the RC delay and not on a calculation as I do.
Regards,
quax
Re: Alternative ESC firmware (reflashing)
Hi Quax,
How is your research?
Just want to share couple of tweaks to your firmware.
1) Zero crossing filter. Just simple majority filter. In my case helps with 4s setup, the motor not loosing sync.
2) Power ramping for the first commutation during startup (pre-align). again in my setup helps smoothly start, even with high startup power.
3) I have managed to merge bl-17a and tp-18a using macroses.
regards,
ziss_dm
How is your research?
Just want to share couple of tweaks to your firmware.
1) Zero crossing filter. Just simple majority filter. In my case helps with 4s setup, the motor not loosing sync.
Code: Select all
;-----bko-----------------------------------------------------------------
; *** scan comparator utilities ***
.if CLK_SCALE==2
.macro __waitp
nop
nop
.endmacro
.else
.macro __waitp
.endmacro
.endif
wait_for_low: sbrs flags0, OCT1_PENDING
ret
clr temp1
clr temp2
sbic ACSR, ACO
inc temp1
__waitp
sbic ACSR, ACO
inc temp1
inc temp2
__waitp
sbic ACSR, ACO
inc temp1
__waitp
sbic ACSR, ACO
inc temp1
inc temp2
__waitp
sbic ACSR, ACO
inc temp1
__waitp
sbic ACSR, ACO
inc temp1
inc temp2
__waitp
cp temp2, temp1
brcc wait_for_low
ret
wait_for_high: sbrs flags0, OCT1_PENDING
ret
clr temp1
clr temp2
sbis ACSR, ACO
inc temp1
__waitp
sbis ACSR, ACO
inc temp1
inc temp2
__waitp
sbis ACSR, ACO
inc temp1
__waitp
sbis ACSR, ACO
inc temp1
inc temp2
__waitp
sbis ACSR, ACO
inc temp1
__waitp
sbis ACSR, ACO
inc temp1
inc temp2
__waitp
cp temp2, temp1
brcc wait_for_high
ret
;-----bko-----------------------------------------------------------------
2) Power ramping for the first commutation during startup (pre-align). again in my setup helps smoothly start, even with high startup power.
Code: Select all
.macro SetPWM
ldi temp1, @0
com temp1
mov tcnt0_pwron_next, temp1
mov tcnt0_power_on, temp1
.endmacro
wait120ms:
ldi temp1, 1
mov t1_timeout, temp1
wait120ms_wait_for_t1:
tst t1_timeout
brne wait120ms_wait_for_t1
ret
pre_align: ldi temp1, INIT_PB ; all off
out PORTB, temp1
ldi temp1, INIT_PD ; all off
out PORTD, temp1
ldi temp1, INIT_PC ; all off
out PORTC, temp1
ldi temp1, 20*CLK_SCALE
pp_FETs_off_wt: dec temp1
brne pp_FETs_off_wt
SetPWM(PWR_STARTUP*1/4);
rcall com5com6
rcall com6com1
rcall wait120ms
SetPWM(PWR_STARTUP*2/4);
rcall wait120ms
SetPWM(PWR_STARTUP*3/4);
rcall wait120ms
SetPWM(PWR_STARTUP);
rcall wait120ms
ret
3) I have managed to merge bl-17a and tp-18a using macroses.
regards,
ziss_dm
- Attachments
-
- bldc.zip
- (99.21 KiB) Downloaded 1621 times
Re: Alternative ESC firmware (reflashing)
ziss_dm wrote:Hi Quax,
How is your research?
....
Unfortunately my ESC isn't arrived yet.
The code reengineering is stopped at the moment. It is very complicated to find out the sense of the variables and subroutines. From time to time I need a break to clear my brain
Edit: but I found out, that this is a version with governor mode
ziss_dm wrote:Hi Quax,
Just want to share couple of tweaks to your firmware.
1) Zero crossing filter. Just simple majority filter. In my case helps with 4s setup, the motor not loosing sync.
....
2) Power ramping for the first commutation during startup (pre-align). again in my setup helps smoothly start, even with high startup power.
....
3) I have managed to merge bl-17a and tp-18a using macroses.
regards,
ziss_dm
I'm very happy to see a progress in the software. By the next opportunity I will test it and hope you agree, if I publish it at the end on my homepage, including your name.
Unfortunately my time suffic only for a few things to do.
In the moment I enjoy the flying with my MWC and build a second one.
Regards,
Bernhard
Re: Alternative ESC firmware (reflashing)
Hi,
Just a quick report. I have tested idea of extending ESC resolution up to 250 points. Results is quite impressive so far (next is outdoor tests).
Normal resolution PID's: 5.7/0.030/17
With extended resolution: 12/0.080/60
And it is really stable in hover
The modifications to the WMC:
Firmware for the Mystery 20A in the attachment. If somebody has interest, I can post instructions how to easily re-flash them using arduino.
regards,
ziss_dm
Just a quick report. I have tested idea of extending ESC resolution up to 250 points. Results is quite impressive so far (next is outdoor tests).
Normal resolution PID's: 5.7/0.030/17
With extended resolution: 12/0.080/60
And it is really stable in hover
The modifications to the WMC:
Code: Select all
#define MINCOMMAND 1000
#define MINTHROTTLE 1080
#define MAXTHROTTLE 2000
#define EXT_MOTOR_RANGE
....
#ifndef EXT_MOTOR_RANGE
analogWrite(PWM_PIN[i], motor[i]>>3);
#else
analogWrite(PWM_PIN[i], ((motor[i]>>2) - 250) + 2);
#endif
Firmware for the Mystery 20A in the attachment. If somebody has interest, I can post instructions how to easily re-flash them using arduino.
regards,
ziss_dm
- Attachments
-
- Mystery20A_arduino_pwm.zip
- (2.84 KiB) Downloaded 1646 times
Re: Alternative ESC firmware (reflashing)
Hi ziss_dm,
yes, very interesting. Please post info for flashing via arduino.
Does same firmware have chance to work for the 12A blue series?
Thanks, Hamburger
yes, very interesting. Please post info for flashing via arduino.
Does same firmware have chance to work for the 12A blue series?
Thanks, Hamburger
Re: Alternative ESC firmware (reflashing)
Terrific, my batch of mystery 20A esc's just arrived. I'll try them out. What do you think about using serial control of ESC's, as described on the page somebody referenced above? This could free up pins on arduino, especially on hex and octo configs.
Re: Alternative ESC firmware (reflashing)
Hi,
Just a short story, how I'm re-flashing ESC's
1) After opening ESC, you need to solder wires to the ISP pads.
2) Connect them to the arduino
Note, that we are going to power up ESC's MCU from the arduino through USB, so you need to connect ISP +5v to the arduino's vcc pin.
3) In the Arduino IDE open sketch: Examples\ArduinoISP and upload it into aduino.
4) As we are going to use AVRDude as a programmer, we need to disable reset from USB. Some boards have a switch, some does not (Pro Mini, for example). Easiest way to disable reset on boards without switch is to connect resistor 30 ohm between VCC and RST pins.
5) As I said before, we are going to use AVRDude. It is shipped with arduino IDE and located in \hardware\tools\avr\bin. You can set environment variable ARDIDE and you can copy-paste commands. My arduino mapped to com3, you need to change it to your serial port. Next we need to run this:
In case everything connected correctly, it should respond:
If something wrong, check your wiring, com port, power, etc..
6) If you want to backup existing firmware, execute the following:
7) To flash new firmware:
8) Test your ESC with current limiter first. It could be just automotive bulb connected in series.
regards,
ziss_dm
Just a short story, how I'm re-flashing ESC's
1) After opening ESC, you need to solder wires to the ISP pads.
2) Connect them to the arduino
Code: Select all
10: Reset
11: MOSI
12: MISO
13: SCK
GND: GNG
vcc: +5v
Note, that we are going to power up ESC's MCU from the arduino through USB, so you need to connect ISP +5v to the arduino's vcc pin.
3) In the Arduino IDE open sketch: Examples\ArduinoISP and upload it into aduino.
4) As we are going to use AVRDude as a programmer, we need to disable reset from USB. Some boards have a switch, some does not (Pro Mini, for example). Easiest way to disable reset on boards without switch is to connect resistor 30 ohm between VCC and RST pins.
5) As I said before, we are going to use AVRDude. It is shipped with arduino IDE and located in \hardware\tools\avr\bin. You can set environment variable ARDIDE and you can copy-paste commands. My arduino mapped to com3, you need to change it to your serial port. Next we need to run this:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -v -p m8 -P com3 -c avrisp -b 19200
In case everything connected correctly, it should respond:
Code: Select all
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 "H:\Program Files\arduino-0022\hardware\tools\avr\etc\avrdude.conf"
Using Port : com3
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.03s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: safemode: lfuse reads as 2E
avrdude.exe: safemode: hfuse reads as CF
avrdude.exe: safemode: lfuse reads as 2E
avrdude.exe: safemode: hfuse reads as CF
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
If something wrong, check your wiring, com port, power, etc..
6) If you want to backup existing firmware, execute the following:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -p m8 -P com3 -c avrisp -b 19200 -U flash:r:flash-orig.hex:i -U eeprom:r:eeprom-orig.hex:i
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: reading flash memory:
Reading | ################################################## | 100% 14.55s
avrdude.exe: writing output file "flash-orig.hex"
avrdude.exe: reading eeprom memory:
Reading | ################################################## | 100% 20.97s
avrdude.exe: writing output file "eeprom-orig.hex"
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
7) To flash new firmware:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -p m8 -P com3 -c avrisp -b 19200 -U flash:w:Mystery20A_arduino_pwm.hex
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
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.81s
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.20s
avrdude.exe: verifying ...
avrdude.exe: 2336 bytes of flash verified
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
8) Test your ESC with current limiter first. It could be just automotive bulb connected in series.
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
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
@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
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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
Re: Alternative ESC firmware (reflashing)
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
In my case, I have removed caps after testing with 4s setup. With 3s it was working fine with caps.
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
Hi ziss_dm,
i compiled the files with the following modifications:
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
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
Re: Alternative ESC firmware (reflashing)
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
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 1685 times
-
- bldc.zip
- (103.55 KiB) Downloaded 1606 times
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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
Re: Alternative ESC firmware (reflashing)
Hi Hamburger,
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
Sometimes yes, sometimes ESC has built-in throttle curve.
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
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
Re: Alternative ESC firmware (reflashing)
Edit: ziss_dm was faster than me
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.
It's linear, not least because of the calculation effort needed for other transfer characteristics.
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
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
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
Hi Quax,
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
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
Re: Alternative ESC firmware (reflashing)
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
Re: Alternative ESC firmware (reflashing)
Hi Heiko,
Was it completelly stopped for long time?
regards,
ziss_dm
Was it completelly stopped for long time?
regards,
ziss_dm
Re: Alternative ESC firmware (reflashing)
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
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
Re: Alternative ESC firmware (reflashing)
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