Alternative ESC firmware (reflashing)

Post Reply
crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

Gaijin wrote:I built a simple ESC flashing tool (for ESC's with pads e.g HK SS30A AND 20A, Hobbyking F-20A) from a 2x3 pin header plug, the pins from servo connectors and a UsbAsp programmer, no need to clamp as it's so quick

http://www.rcgroups.com/forums/showpost.php?p=21262287&postcount=1970

However I've found the quad to be overshooting/ hunting and somewhat unstable with re-flashed high performance esc's (otherwise the same combination flown before), can someone suggest a more suitable default set of PID's to start tuning from, i haven't really mastered PID tuning yet


Like Hamburger said few posts back you can probable double P (at least I'm running now with P=8.6) but since I can observe slight oscillations (couple mm on hand end) I have increased D (now D=25 but will probably go higher). I'm running it on a ProMini. But my Quad is now really stable and locked in on roll and pitch.

Regards Andrej

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: Alternative ESC firmware (reflashing)

Post by NikTheGreek »

Hi.
Did Anyone managed to flash towerpro 18A esc.with new firmware ?

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

3rd happy update on Plush 10A: I flashed with pwm-200-fast, reset the MWii to output normal pwm range and it worked. Today I flew 4 packs in strong wind with gusts and had not a single motor stop in midair. Actually, I like the sound of the 200 steps@ 8MHz combo, reminds me of oldschool Hughes helis. Maybe I am simply getting deaf.

Thanks again. Hamburger

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

my largest TRI has Blueseries 20A flashed to r195 (thanks ziss_dm) with turnigy 2205 motors.
Now I changed the motors to something bigger: Turnigy 2209 28turn 1050kv 15A Outrunner
Kv: 1050rpm/v
Operating Current: 4A ~ 12A
Peak Current: 15A
Suggested prop: 9x4.7
Weight: 46g
Dimensions: 27.6 x 28mm

Still running on 3S.
Overall it works, but with one motor I usually observe the following:
upon arming all motors start to spin, when slowly increasing throttle, that one motor looses sync and stops, tries to catchup again, looses sync and stops ...
Usually disarming & arming again helps.
Any ESC config parameter I could tune or should I increase minthrottle in MWii?

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

Hello!

I have sync problems with the MT3506 motor and flashed 30A Maytech V1 esc (all n-fet) with simonK firmware. Will use the combo with my Mikrokopter Octo and precision I2C to PWM converter from abusemark.

So found the wii firmware to eliminate the sync problems, but can´t make a hex file for flashing!

So please, can somebody help me with the hex (for Mikrokopter with 30A Maytech and MT3506 motor) file?

Thank you in advance!

Thanks!
Raptor4

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

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hi Raptor4,

here is r195 with default settings for all nFET boards.

Cheers,
Heiko
Attachments
Mystery20A_nFET_r195.zip
(2.41 KiB) Downloaded 324 times

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

Hello Heiko!

Thank You very much!

Flashed my esc´s with your hex file. Everything is ok, but the motors start at min 40 (in koptertool). Normally they start at min 18 with simonk firmware. So it´s because of the throttle range. Is there a way to change it?

Thank You!

Eugen

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

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hi Eugen,

I guess you are using TC's converter? Try to set pulse range from 1100 - 1900 ms.

Cheers,
Heiko

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

Hi Heiko!

With the puls range 1100-1900 ms the motors don´t start! The last puls range was 1000-2000ms in TC`s converter and the motors start at 40.

Cheers,
Eugen

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

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hm!

Try 1090 or 1050 ms as min pulse. Find the highest value which will start the motors.

Cheers,
Heiko

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

Thank You very much Heiko!

It works now with 1090 and 2050 ms pulse range. All motors do start at 15-18 :D

[url]So now have no problems with Maytech V1 ESC and Tiger MT3506 motor[/url] :D

But want to know Heiko, how You did it with the hex file! I have the AVR Studio 4 now. Is there an simple way to make the hex file with it ?

So I can start a new project in AVR Studio and then?

Can you please tell me also which files You used for my hex file and which timing for MT3506 motor?

Thank You again!

Cheers,
Eugen

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

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Nice!

You can try 1095 ms as min pulse, that should also work. Max pulse should stay at 1900 ms, because that's max power with wii-esc. If you use 2050 ms, you will loose some resoultion at the upper end.

Did you already read FirmwareAssembling about creating the hex file?

Cheers,
Heiko

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

OK! Will test the new pulse range!

Yes, I did read about creating the hex file. But have problems with it. So, which files I need and so on.

Cheers,
Eugen

wingspinner
Posts: 8
Joined: Wed May 09, 2012 4:26 pm

Re: Alternative ESC firmware (reflashing)

Post by wingspinner »

Yes, I did read about creating the hex file. But have problems with it. So, which files I need and so on.

Cheers,
Eugen


Hi Eugen,
What problems are you having? Have you tried to install the toolchain and the code? It's pretty easy. All you need to know is here: http://code.google.com/p/wii-esc/wiki/GettingStarted . It works exactly that way.

Once you get set to generate your hex file, I've found that the MT3506's will still loose sync unless I set timing advance to 1. You can do that in the include file for your esc under the "hw" directory.

Give it a shot, you might learn something

Raptor4
Posts: 6
Joined: Sat May 05, 2012 9:32 am

Re: Alternative ESC firmware (reflashing)

Post by Raptor4 »

Hi Heiko and wingspinner!

Have now no problems with creating the hex file! But tried to use the pwm_fast_250.inc as input for 2000us pulse range. So it works with esc 4, but not with other 3 esc´s on my test quadro with Mikrokopter Flctr and timecop I2C to PWM converter! Should I use the pwm_fast_200 only?

Cheers,
Eugen

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Alternative ESC firmware (reflashing)

Post by ezio »

Hi
I have dumped a firmware from four escs blueSeries 20A.
I don't know if atmels are protected or not so I also don't know if this dump is useful.
I put it here http://perso.numericable.fr/ezio/esc%20 ... %2020A.zip
please do not flash these files!!!

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

motor cut off in midflight again with BlueSeries 20A wii-esc r195 and Turnigy 2209 28turn 1050kv 15A Outrunner!
It was the second time with this combination. For the time being I reflashed it to simonk firmware but I prefer the greater stability and larger input range of the wii-esc firmware. (of course both exceed the stock esc firmware)

Not sure how to proceed now. It is the same undesirable sumptom as with the formerly used 2205 motors. Anyone else use these motors (the motors look kindof similar to some KDA / keda motors)?

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

@Hamburger
Not exactly solution but...
I'm running KDA 20-28 http://www.hobbyking.com/hobbyking/stor ... oduct=4701 (that looks the same by specifications) with (extended range) reflashed HobbyKing F-30A ESC's (http://www.hobbyking.com/hobbyking/stor ... duct=15205) and (unmodified) revision 195, with GWS 10x4.7 props and have no problems doing FFF and flips (meaning fast and radical throttle transitions). All that on 3S LiPoly.

Regards
Andrej

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

Andrej,
thanks for that info. Not sure what to make of it though. With the ESCs reflashed to simonk firmware I now have approx. 20 flights without motor cutoff. So from that it seems the problem is not related to ESC-amperage, wiring, etc.. Imho everything points at the motor -wii-ESC combination.
You use 30A ESCs? Ok, I have a 50A current sensor waiting to replace the old 25A sensor and will check for max current. Do you have a number for the actual max. current your motors draw?

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

Hamburger wrote:Andrej,
Do you have a number for the actual max. current your motors draw?

Sorry but I don't have measured hover current. Max current, for same configuration, per motor (as measured on the desk) is aprox. 12A. And reverse calculation for average in-flight current for all motors is also 12A ("consumed Amps." divided by flight time).
Maybe if you missed couple posts back (posting.php?mode=quote&f=13&p=14511#pr13708)(different motors and ESC) but maybe worth investigating.

Regards
Andrej

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

Uncortunately no. I know about timing advance.

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Hamburger,

Can you try to reproduce it on the ground? Is it happenning on WOT or low throttle?

I can imagine only couple of possibilities to motor stop:
1) Sync lost, but we have quite good sync recovery.
2) The input pulses getting outside allowed range, and failsafe is triggered.
3) MCU brouwnout.

regards,
ziss_dm
Last edited by ziss_dm on Thu May 24, 2012 12:01 pm, edited 2 times in total.

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,
good to hear from you.
It happened at below WOT (difficult to be more precise, I also have throttle curve in TX active).
Ok, I will try and reproduce on the ground with servo tester and spare ESC. Unfortunately I have no spare motor atm, so it will be a wild setup.
I will report back soon (next week).
Thanks, Hamburger

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

Re: Alternative ESC firmware (reflashing)

Post by funth1ngs »

Hi ziss_dm,

today I made some tests without propeller. I can hear a slight cklicking noise at nearly full speed. It's arround 1895 - 1900 us (with pwm_fast_200.inc). I guess it's just before transition to 100% duty cycle.

Is this normal? :)

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,
I did the test with the BlueSeries 20A ESC flashed to r195 stock and turnigy 2205 motor on 3S. I could not reproduce the motor cutoff.
This is the code I used for testing:

Code: Select all

/*
  ESC test. - based on arduino example code
 
 */

// These constants won't change.  They're used to give names
// to the pins used:
const int analogOutPin = 9; // Analog output pin that the ESC is attached to

// normal ESC
//#define MMIN 125
//#define MMAX 250

// special ESC extended range
#define MMIN 2
#define MMAX 252
#define INC 10

uint8_t outputValue = MMIN;        // value output to the PWM (analog out)

void setup() {
  Serial.begin(115200);
    analogWrite(analogOutPin, outputValue);           
    delay(5000);
}

void loop() {

  // change the analog out value:
  analogWrite(analogOutPin, outputValue);           

  // print the results to the serial monitor:
 
  Serial.print("\t output = ");     
  Serial.println(outputValue);   


  delay(600);
  if (outputValue == MMAX ) delay(5000);
 
 outputValue+= INC;
if (outputValue == MMAX + INC ) outputValue = MMIN;
if (outputValue > MMAX ) outputValue = MMAX;
}

for now I have flashed the large TRI's ESC to r195 stock and will again do some test flying.
Maybe I should change the test code somehow - another sequence of pwm values, maybe?

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

Re: Alternative ESC firmware (reflashing)

Post by quax »

I think, the slight cklicking noise comes indeed from the jump from the minimum PWM-off time to no PWM-off time.

There is a limited low pulse with because of software overhead. This may be a jump from 97% to 100% without steps between the power stages. A no load motor may have a little swing, if the power step occurs.

Might be the reason ....

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,

I think, I have solved problem with jumps at the end of PWM range. The interrupt serving short off cycles without exiting the routine.

But if voltage is high enough, the RPM limiter can produce shakes. In my test 1100Kv motor hitting the limit around 16v.

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 »

Hi zisss_dm,
will you release that new solution anytime soon? I might just wait for that (and hopefully avoid another crash from motor cutoff)

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

update on my latest crash issue:
after upgrading to r915 stock with those bigger motors (turnigy 2209) I could not reproduce motor cutoff on test stand with the sketch posted earlier and went through 3 battery packs at the field.
With the bigger motors I stand good chance to never reach 100% throttle - maybe that helps some.

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

now that a working silabs firmware exists, should we become interested? Any reason to go silabs?
https://github.com/bitdump/BLHeli/tree/ ... 736/SiLabs

They have an atmel branch as well, with governor (useless for multi rotors) but no wii specific extended range support.

a432511
Posts: 1
Joined: Thu Aug 09, 2012 2:40 pm

Re: Alternative ESC firmware (reflashing)

Post by a432511 »

Hello all. I am trying to get the wii-esc firmware to work with my HobbyWing 40A ESCs. They are different than the 30A version so the Plush30A hardware config file does not work. I made a new config file for the 40A version based on the differences that I saw between SimonK's tgy and tp_nfet firmware configs. The tgy firmware is synonymous with Plush30A and the tp_nfet is synonymous with the new config that I am trying to create. Just to be clear, SimonK's tp_nfet firmware is the firmware that works with the 40A version of the HobbyWing ESCs.

After making the changes to the Plush30A config, I was able to get my ESCs to power up with the 3 beep sequence, but I am not able to get the motor to start spinning up. I really have no idea what I am doing :-D as far as the code is concerned. I just used winmerge on SimonK's two different configs to see what I needed to change in the wii-esc configs. I think I am 99% there, but the motors just wont spin up. I am attaching the files that I modified/created.
Attachments
Pentium40A.zip
(10.77 KiB) Downloaded 217 times

vpb
Posts: 231
Joined: Mon Jul 23, 2012 4:09 pm

Re: Alternative ESC firmware (reflashing)

Post by vpb »

Hi, has anybody used custom simonk fw, and run 400khz mode with multiwii? we just need to reflash esc and enable #define I2C_SPEED 400000L in the sketch?

chris ables
Posts: 317
Joined: Wed Feb 08, 2012 8:42 pm
Location: United states

Re: Alternative ESC firmware (reflashing)

Post by chris ables »

That define is not for esc ! The esc refresh rate is in the output.ino and it is fixed at 490hz if im not mistaken ! :D

vpb
Posts: 231
Joined: Mon Jul 23, 2012 4:09 pm

Re: Alternative ESC firmware (reflashing)

Post by vpb »

So as you said, I need not to modify anything? :D

vpb
Posts: 231
Joined: Mon Jul 23, 2012 4:09 pm

Re: Alternative ESC firmware (reflashing)

Post by vpb »

I replace 3 turnigy plush 30A with 3 F-30A reflashed with simonk fw. No need to change anything in the config file. It flies great, very stable :D

chris ables
Posts: 317
Joined: Wed Feb 08, 2012 8:42 pm
Location: United states

Re: Alternative ESC firmware (reflashing)

Post by chris ables »

chris ables wrote:That define is not for esc ! The esc refresh rate is in the output.ino and it is fixed at 490hz if im not mistaken ! :D

The firmware is set at 490hz esc refresh rate and is fixed (not adjustable) ! The only way it can be changed is for a codewriter to rewrite output.ino file ! Hope this helps understanding ! :D

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

Just a quick update. The version 2.0 alpha is available for brave ones ;) This time this is complete re-write from scratch.

What's new:
1) Sigma-delta modulator is used instead of PWM. http://en.wikipedia.org/wiki/Delta-sigma_modulation
- Low noise
- High resolution (current builds have 1600 steps of resolution)
- It has quite big ON and OFF time, which reduces switching losses. On my bench HK SS 18A is working comparatively cool. With 1.1 and RapidESC it is getting extremely hot.
2) ZC detector is refactored again
- Synchronized with SDM
- 2:1 sampling factor
3) Start-up is refactored again
4) Due different filtering method, the dynamic response of the system is significantly increased.
5) Target names now "compatible" with RapidESC, just to make life easier.
6) Pre-compiled .hex available here: http://code.google.com/p/wii-esc/downloads/list

regards,
ziss_dm
Last edited by ziss_dm on Wed Aug 15, 2012 8:34 am, edited 1 time in total.

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi a432511,
Is it arming? You should have 4th beep..

regards,
ziss_dm

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

ziss_dm wrote:Hi,

Just a quick update. The version 2.0 alpha is available for brave ones ;) This time this is complete re-write from scratch.

What's new:
1) Sigma-delta modulator is used instead of PWM. http://en.wikipedia.org/wiki/Delta-sigma_modulation
- Low noise
- High resolution (current builds have 1600 steps of resolution)
- It has quite big ON and OFF time, which reduces switching losses. On my bench HK SS 18A is working comparatively cool. With 1.1 and RapidESC it is getting extremely hot.
2) ZC detector is refactored again
- Synchronized with SDM
- 2:1 sampling factor
3) Start-up is refactored again
4) Due different filtering method, the dynamic response of the system is significantly increased.
5) Target names now "compatible" with RapidESC, just to make life easier.
6) Pre-compiled .hex available here: http://code.google.com/p/wii-esc/downloads/list

regards,
ziss_dm


Any instructions for us with EXT_MOTOR_RANGE wishes?
I have noticed that new version seems to be in C/C++ (not in ASM), what compiler/compiler flags are recommended what are tunable parameters?
Also I'm using TY-P1 ESC that uses bs.hex (by SimonK) and Mystery20A.inc (from pre 2 wii-esc) which HW (hal) option to use now?

Regards Andrej

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Andrej,

1) Not yet. ;) But you can adjust receiver settings in config.h ;)
2) I'm using WinAVR-20100110. You can take a look options in "makefile.avr". Also there Code::Blocks IDE project file with all targets/options/etc. ;)
3) Currently I do not have any normal BS board to test. But I have created target, so be careful.

regards,
ziss_dm
Attachments
bs.zip
(3.37 KiB) Downloaded 178 times

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Alternative ESC firmware (reflashing)

Post by gompf-2 »

I would test a HK BS20A at the weekend. On my test ESC I removed the c´s in the back-emv circuite. What would you recommend at the moment: remove or leave them? (full n-FET board, works fine with wii-esc and SimonK´s FW).

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

It is better to remove them. If you want "perfect" results it is good idea to replace them with 30-40pf (instead stock 5n). This reduces jitter with small motors. Works also well with 1.0 and RapidESC. ;)

regards,
ziss_dm

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

Hello,
what is the proper range for EXT_MOTOR_RANGE in v2 config.h?
What is the difference (meaning of) RCP_MAX and RCP_FULL?

Code: Select all

#define    RCP_MIN             900
#define    RCP_MAX             2200
#define    RCP_START           1060
#define    RCP_FULL            1860
#define    RCP_DEADBAND        5


Should we leave

Code: Select all

#define    OSC_DEBUG
enabled in final version or is it there only for your (devel) purposes.

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

Should be something like this:

Code: Select all

//*************************
// RC Input               *
//*************************
#define    RCP_MIN             14
#define    RCP_MAX             2200
#define    RCP_START           18
#define    RCP_FULL            2016
#define    RCP_DEADBAND        2

MIN/MAX - valid range, everything outsude is rejected
START - where to start (with min. power)
FULL - where to have full power
DEADBAND - deadband for startup

It is better to disable OSC_DEBUG.

regards,
ziss_dm

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

@ziss_dm: thank you for quick answer.
I have noticed that bs.h and bs_nfet.h have same header that is probably NOT O.K.!?

Code: Select all

#ifndef _BS_NFET_H_
#define _BS_NFET_H_

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,
I'll fix it, but it should not affect anything as only one header included per target.

Regards,
Ziss_dm

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Alternative ESC firmware (reflashing)

Post by gompf-2 »

Hi,
Feels fine on the bench with 09-18 bs_nfet: BS12A/KDA20-50S, BS20A/KDA20-26M
btw, its still august ;)

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Oops.. ;)

Updated to "V 2.0.3 alpha":

Safety:
- PPM stream timeout (power off on a signal loss)
- Arming require at least one valid PPM frame

Experimental:
- Automatic oscillator calibration for boards without external oscillator. It uses PPM as a reference and searches best OSCCAL value.

regards,
ziss_dm

User avatar
Rob
Posts: 77
Joined: Sun Apr 03, 2011 4:40 pm

Re: Alternative ESC firmware (reflashing)

Post by Rob »

@ Ziss

I have the qynx controller tested, with a small engine one of the controllers hold while flying. I think the settings were not correct for this engine.
I must further test.

if RC input below RCP_MIN (by powerup) the controller won't arm.


Furthermore, with these settings I hear and see a small dip with ca.1770us to the input.

//*************************
// RC Input *
//*************************
#define RCP_MIN 900
#define RCP_MAX 2100
#define RCP_START 1100
#define RCP_FULL 1900
#define RCP_DEADBAND 5

(tested with a Hitec HFP-10)

Further change what I made for the Qynx controller:

in M8.h :

Code: Select all

#if (BOARD == _QYNX_)
#warning "INT1 for Qynx target"
ISR(INT1_vect) {
  uint16_t time = TCNT1;
  uint8_t state = (PIND & _BV(3));
  rx_ppm_callback(time, state);
}

inline void AttachPPM() {
  PORTD  |= _BV(3); // activeer pullup
  MCUCR = (MCUCR & ~((1 << ISC10) | (1 << ISC11))) | (1 << ISC10);
  GICR |= (1 << INT1);
}
#else
ISR(INT0_vect) {
  uint16_t time = TCNT1;
  uint8_t state = (PIND & _BV(2));
  rx_ppm_callback(time, state);
}

inline void AttachPPM() {
  PORTD  |= _BV(2);
  MCUCR = (MCUCR & ~((1 << ISC00) | (1 << ISC01))) | (1 << ISC00);
  GICR |= (1 << INT0);
}
#endif



in core.h :

Code: Select all

#if (BOARD == _QYNX_)
  #include "hal/m8.h"
  #include "hal/qynx.h"
#endif



and the qynx.h :

Code: Select all

#ifndef _QYNX_H_
#define _QYNX_H_

//*********************
// PORT B definitions *
//*********************
#define    CpFET           1
#define    BpFET           2
#define    ApFET           3

#define    PORTB_INIT      (1<<ApFET) + (1<<BpFET) + (1<<CpFET)
#define    PORTB_DD        (1<<ApFET) + (1<<BpFET) + (1<<CpFET)
#define    BRAKE_PB        0

//*********************
// PORT C definitions *
//*********************
#define    AnFET           0
#define    BnFET           1
#define    CnFET           2

#define    PORTC_INIT      0
#define    PORTC_DD        (1<<AnFET) + (1<<BnFET) + (1<<CnFET)
#define    BRAKE_PC        (1<<AnFET) + (1<<BnFET) + (1<<CnFET)

//*********************
// PORT D definitions *
//*********************
#define    DbgLED          2
#define    rcp_in          3
#define    DbgStr          4
#define    c_comp          6

#define    PORTD_INIT      (1<<DbgLED) + (0<<rcp_in) + (1<<DbgStr) + (0<<c_comp)
#define    PORTD_DD        (1<<DbgLED) + (1<<DbgStr)
#define    BRAKE_PD        0


inline void DebugLEDOn()     {PORTD |= _BV(DbgLED);}
inline void DebugLEDOff()    {PORTD &=~_BV(DbgLED);}
inline void DebugLEDToggle() {PORTD ^= _BV(DbgLED);}

inline void DebugStrOn()     {PORTB |= _BV(DbgStr);}
inline void DebugStrOff()    {PORTB &=~_BV(DbgStr);}
inline void DebugStrToggle() {PORTB ^= _BV(DbgStr);}

//*********************
// FET Control        *
//*********************
inline void ApFETOn()  {PORTB &= ~_BV(ApFET);}
inline void ApFETOff() {PORTB |=  _BV(ApFET);}
inline void AnFETOn()  {PORTC |=  _BV(AnFET);}
inline void AnFETOff() {PORTC &= ~_BV(AnFET);}

inline void BpFETOn()  {PORTB &= ~_BV(BpFET);}
inline void BpFETOff() {PORTB |=  _BV(BpFET);}
inline void BnFETOn()  {PORTC |=  _BV(BnFET);}
inline void BnFETOff() {PORTC &= ~_BV(BnFET);}

inline void CpFETOn()  {PORTB &= ~_BV(CpFET);}
inline void CpFETOff() {PORTB |=  _BV(CpFET);}
inline void CnFETOn()  {PORTC |=  _BV(CnFET);}
inline void CnFETOff() {PORTC &= ~_BV(CnFET);}

//*********************
// ADC definitions    *
//*********************
#define    mux_a           3
#define    mux_b           4
#define    mux_c           5

inline void ACInit() {
  ACMultiplexed();
  ACSR |= _BV(ACIC);
}

inline void ACPhaseA() {
   ACChannel(mux_a);
}

inline void ACPhaseB() {
   ACChannel(mux_b);
}

inline void ACPhaseC() {
   ACChannel(mux_c);
};

//#define BEMF_FILTER_DELAY_US 22

void Board_Idle() {
};

inline void Board_Init() {
  TIMSK = 0;
  // Timer1
  TCCR1A = 0;
  TCCR1B = _BV(CS11);                 /* div 8 clock prescaler */
  PORTB = PORTB_INIT; DDRB = PORTB_DD;
  PORTC = PORTC_INIT; DDRC = PORTC_DD;
  PORTD = PORTD_INIT; DDRD = PORTD_DD;

  ACInit();
}

#endif // _QYNX_H_




And I have set the necessary settings in codeblocks

Very clean and readable code ;)


Rob

Schachti
Posts: 6
Joined: Sat Jun 02, 2012 8:49 pm

Re: Alternative ESC firmware (reflashing)

Post by Schachti »

Hello,

I mean here not even a 1/4.
I have the Tiger MT 3506 and they want to fly with the 12 or 20A HK blue.
So I need a bs n-fet with less timing.
This can create a file of for me?

Greetings from Berlin
Schachti

http://translate.google.de/ :oops:

Post Reply