Alternative ESC firmware (reflashing)

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi manu,

Is pre-compilled binary working?

regards,
ziss_dm

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

Yes! I have the SimonK bootloader installed on a 10Amp TP esc. I can switch between SimonK and wii_esc via usb linker without a problem.
The compiled hex, from CodeBlock doesn't work (same for the Eclipse). I compiled with the Arduino1.2 binaries/libraries.

Maybe i have to check that i point to your bin libraries within the wii_esc folder?

manu

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Maybe i have to check that i point to your bin libraries within the wii_esc folder?


That would be good idea.. ;)

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

ziss_dm wrote:...
Aalternatively, you can build using make file:

Code: Select all

make -f Makefile.avr MCU=atmega8 BOARD=_TP_  F_CPU=16000000

regards,
ziss_dm


Can't get this to work, the generated hex is bigger then yours...

Code: Select all

Downloading file: "tp.hex"
11.788 byte(s) downloaded.

Loading file: "C:\temp\wii-esc\bin\avr\tp.hex"
12.061 byte(s) loaded.


Code: Select all

C:\temp\wii-esc>make -f Makefile.avr MCU=atmega8 BOARD=_TP_  F_CPU=16000000
AVR Memory Usage
----------------
Device: atmega8

Program:    4282 bytes (52.3% Full)
(.text + .data + .bootloader)

Data:         98 bytes (9.6% Full)
(.data + .bss + .noinit)



On XP, i have WinAVR-20100110 installed, GNU make

Code: Select all

C:\temp\wii-esc>make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

C:\temp\wii-esc>avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../gcc-4.3.3/configure --enable-win32-registry=WinAVR-20100110 --with-gmp=/usr/local --with-mpfr=/usr/local --prefix=/c/WinAVR --target=avr --enable-languages=c,c+
+,objc --with-dwarf2 --enable-doc --disable-shared --disable-libada --disable-libssp --disable-nls --with-pkgversion='WinAVR 20100110' --with-bugurl='URL:http://sourceforge.net/tra
cker/?atid=520074&group_id=68108&func=browse'
Thread model: single
gcc version 4.3.3 (WinAVR 20100110)



and even with Arduino avr gcc ..., (C:\arduino-0021\hardware\tools\avr\avr) 0021, 1.01, 1.03 can't get a correct hex :evil:

Code: Select all

-------------- Build: tp in mwc_ng (compiler: GNU AVR GCC Compiler)---------------

Running command: make.exe -f makefile.avr MCU=atmega8 BOARD=_TP_  F_CPU=16000000
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/pins_arduino.c -o obj/avr/lib-avr/arduino/pins_arduino.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/WInterrupts.c -o obj/avr/lib-avr/arduino/WInterrupts.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/wiring.c -o obj/avr/lib-avr/arduino/wiring.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/wiring_analog.c -o obj/avr/lib-avr/arduino/wiring_analog.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/wiring_digital.c -o obj/avr/lib-avr/arduino/wiring_digital.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/wiring_pulse.c -o obj/avr/lib-avr/arduino/wiring_pulse.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/wiring_shift.c -o obj/avr/lib-avr/arduino/wiring_shift.o
avr-gcc -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/nvram/nvram.c -o obj/avr/lib-avr/nvram/nvram.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/CDC.cpp -o obj/avr/lib-avr/arduino/CDC.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/HardwareSerial.cpp -o obj/avr/lib-avr/arduino/HardwareSerial.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/HID.cpp -o obj/avr/lib-avr/arduino/HID.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/main.cpp -o obj/avr/lib-avr/arduino/main.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/Print.cpp -o obj/avr/lib-avr/arduino/Print.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/Tone.cpp -o obj/avr/lib-avr/arduino/Tone.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/USBCore.cpp -o obj/avr/lib-avr/arduino/USBCore.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/WMath.cpp -o obj/avr/lib-avr/arduino/WMath.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram lib-avr/arduino/WString.cpp -o obj/avr/lib-avr/arduino/WString.o
avr-ar -rcs obj/avr/core.a obj/avr/lib-avr/arduino/pins_arduino.o obj/avr/lib-avr/arduino/WInterrupts.o obj/avr/lib-avr/arduino/wiring.o obj/avr/lib-avr/arduino/wiring_analog.o obj/avr/lib-avr/arduino/wiring_digital.o obj/avr/lib-avr/arduino/wiring_pulse.o obj/avr/lib-avr/arduino/wiring_shift.o obj/avr/lib-avr/nvram/nvram.o obj/avr/lib-avr/arduino/CDC.o obj/avr/lib-avr/arduino/HardwareSerial.o obj/avr/lib-avr/arduino/HID.o obj/avr/lib-avr/arduino/main.o obj/avr/lib-avr/arduino/Print.o obj/avr/lib-avr/arduino/Tone.o obj/avr/lib-avr/arduino/USBCore.o obj/avr/lib-avr/arduino/WMath.o obj/avr/lib-avr/arduino/WString.o
avr-g++ -MD -c -g -mmcu=atmega8 -O2 -ffunction-sections -fdata-sections -fno-exceptions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-split-wide-types -mcall-prologues -DF_CPU=16000000 -DARDUINO=22 -DBOARD=_TP_ -DUSB_VID=0x2341 -DUSB_PID=0x8036 -Isrc -Ilib-avr/arduino -Ilib/MWC_PT -Ilib-avr -Ilib-avr/nvram src/wii_esc_ng.cpp -o obj/avr/src/wii_esc_ng.o
avr-gcc -o "bin/avr/wii_esc_ng.elf" -mmcu=atmega8 -O2 -Wl,--relax,--gc-sections "-Wl,-Map=bin/avr/wii_esc_ng.map" obj/avr/src/wii_esc_ng.o obj/avr/core.a -lm
AVR Memory Usage
----------------
Device: atmega8
Program:    4416 bytes (53.9% Full)
(.text + .data + .bootloader)
Data:         98 bytes (9.6% Full)
(.data + .bss + .noinit)
Process terminated with status 0 (0 minutes, 6 seconds)
0 errors, 0 warnings (0 minutes, 6 seconds)
 

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi,

Program: 4282 bytes (52.3% Full)
(.text + .data + .bootloader)

Data: 98 bytes (9.6% Full)
(.data + .bss + .noinit)


This seems to be ok, with latest changes. The "downloaded" size is smaller because SVN automatically converts CR/LF to CR.. ;)


regards,
ziss_dm

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

Made a clean svn checkout, and it is working now with codeblocks! I will retry in Eclipse.
Thanks
PS:
question i asked in rc-groups at Simon, do you have a way to get this done?

@Simon
"breaking, motor decelerating"
The breaking effect of the complementary PWM is only possible on certain esc's. What about the "MOTOR_BRAKE", do certain esc handle it better than others. Is it the same principle as COMP_PWM?
Could the "MOTOR_BRAKE" be used dynamically (at all pwm inputs) to decelerate the motor. Sort of PD control loop of throttle input?
manu

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi Manu,

Not really(atleast not with this hardware and not with this control method), as in "Braking" mode you loose ability to track BEMF (no floating phase). That means after braking you do not know rotor position any more and you need to re-start the motor. Doing this dynamically would sugnificantly reduce dynamic response of the ESC and benifit would be lost.. ;)

BTW: This is one of the reason, why sensored motors still exist: You can activelly brake them, without loosing track of the rotor position.

regards,
ziss_dm

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

Could we make a hack to add 3 bemf sensors, and adapt software to try it out? IMHO, the "rapid dynamic" breaking is worth to try out to even further inprove the responsiveness of multis.

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

I think, it is easier (and cheaper) to use nFET boards with comp. PWM ;)

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

Ok!
But what are the requirements for an ESC to be comp_PWM compatible? And is there a way to increase the breaking effect with compPWM?

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

1) You need board with high speed fets on both sides of the H-bridge (all nFET boards)
2) Thiker wires, high C rating battery, etc..

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

Does compPWM effectively drain current (energy) back to the battery? So motor becomes a generator for a short time?

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Yep.. :)

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

So, how could we further improve dynamic breaking?
I know i am annoying, but i think it's worth trying. I made a test-stand and added a heavy ring to the motor (lots of inertia). With the current compPWM you see already an improvement, but i am convinced it can be improved further.
Are you keen to try to implement a PD-loop? (or PID - loop)
Idea is to detect a deceleration command, and only then fully activate comp_PWM (motor act as a generator).
manu

AndrejLV
Posts: 23
Joined: Wed Mar 14, 2012 9:37 pm

Re: Alternative ESC firmware (reflashing)

Post by AndrejLV »

Alll, effectively drain current (energy) back to the battery ... means loss of 95% instead of 100%.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

What do you try to say with 95% instead of 100%?

@zissdm
do you have any further plans to add more functionalities to the mwii_esc?
thanks,
manu

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

mwii_esc for Eclipse howto:

(done on a mac)
In Eclipse :
    New Project -> C++ Project -> Makefile Project -> Empty project (AVR-GCC Toolchain)
    Go to project properties->C/C++ Build->Builder Settings and uncheck 'Use default build command'. Type in the textbox 'Build command': make -f makefile.avr
    Edit wii_esc_ng.cpp add the board type after the #includes:#define BOARD _TP_

Code: Select all

#include "storage.h"
#include "config_data.h"
#define BOARD _TP_
void setup_to_rt() {

Build, and done... ;)

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

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

Hello!
With latest Warthox stunts in minde (viewtopic.php?f=9&t=3193) I'm asking if WII-ESC is capable of mid-flight reverse switching and if yes how to do proper eeprom (and maybe MultiWII) configuration for it?!

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 »

back to temperature problem again - was trying to fly in snow with flashed blueSeries;
after 20 seconds flight one motor stopped midair; low altitude, so no visible damage;
during second flight @ 30 meter again (not sure which motor); result is fatal crash; need to rebuild
background: copter flew well throughout summer and in moderate temps up until now

Anyone else with low temperature problems with HK blueseries 20A ESCs?

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Alternative ESC firmware (reflashing)

Post by scrat »

Hamburger wrote:back to temperature problem again - was trying to fly in snow with flashed blueSeries;
after 20 seconds flight one motor stopped midair; low altitude, so no visible damage;
during second flight @ 30 meter again (not sure which motor); result is fatal crash; need to rebuild
background: copter flew well throughout summer and in moderate temps up until now

Anyone else with low temperature problems with HK blueseries 20A ESCs?


Buy esc's from Hobbyking and buy https://www.hobbyking.com/hobbyking/sto ... _UBEC.html
I'm using 30A version and they are working at -5 or more deg with no problem.

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi crashlander,

Currently not, but it was easy to do, so I have created brunch "wii-esc-ng-3d". Which works surprisenly well.. ;) If you want to test it - you welcome. ;)

regards,
ziss_dm

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

@Hamburger

Check your fuses, CKOPT should be programmed.

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:@Hamburger - Check your fuses, CKOPT should be programmed.

thanks; I will do that.

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

ahm, 'programmed' means the bit should be 0 (zero), acccording to avr fuses handling?

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Yes, 0 means programmed.

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 crashlander,
Currently not, but it was easy to do, so I have created brunch "wii-esc-ng-3d". Which works surprisenly well.. ;) If you want to test it - you welcome. ;)
ziss_dm

Thank you!
Any tips how to compile/configure: I'm using HK F-20A and F-30A so define of _BS_NFET is correct but what about endpoints, midpoints where should it arm (maybe extended range?)?
Will that modified version also worked with GUI EEPROM setup?
Does it work also with Turnigy TY-P1 that are marked as bs.hex (but are all N fet)?

Best Regards
Andrej

BTW:What does "surprisingly well" means?! ;)

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

RCP_START - full reverse
RCP_FULL - full forward

(RCP_START + RCP_FULL) / 2 - zero
RCP_DEADBAND - deadband around zero.. ;)

To arm, you need to set throttle inside deadband.

I have changed eeprom magic number, so GUI will work only if you load new config from file. All existing targets are supported.

I was surprised that simple transition run -> break -> startup has quite good response and startup is relieble. ;)

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Alternative ESC firmware (reflashing)

Post by alll »

ziss_dm wrote:@Hamburger

Check your fuses, CKOPT should be programmed.


What does that do? Is it always better to activate it for esc flashing (SimonK and others)?
edit: i found this:
http://www.petervis.com/C/1st%20configu ... tions.html

@Hamburger
Did it make a difference?

manu
Last edited by alll on Thu Mar 14, 2013 10:44 am, edited 1 time 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 »

alll wrote:@Hamburger - Did it make a difference?

not yet - need to rebuild the copter first and then check if weather is still cold enough to test for any possible effect.

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

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

ziss_dm wrote:I was surprised that simple transition run -> break -> startup has quite good response and startup is relieble. ;)

What ESC/motor/prop combo have you tested?
In my case Tgy TY-P1, KDA 20-28, 10x4.7 SF props startup after transition is much less than 100% successful. Tested on bench and much slower transition that is (probably) needed to successful flip.
Do you expect any improvements if I switch to HK F-20A?

Regards
Andrej

Edit: Motors starts/transits OK when there are no props attached... ..maybe must try with smaller/lighter props
Edit 2.:With 8x4.7 props transition is much better but still not 100% reliable.

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:@Hamburger
Check your fuses, CKOPT should be programmed.

had a quick look at the flashing.log I had kept:
avrdude: safemode: lfuse reads as 2E
avrdude: safemode: hfuse reads as CF
avrdude: safemode: Fuses OK

and the fuse calcs say this means
CKOPT = programmed = 0;

Any other idea what I could check for (still rebuilding the CF frame and it is getting warmer)?

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi crashlander,

How it looks like? Is it syncing to harmonic and continues rotation in same direction?

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 crashlander,
How it looks like? Is it syncing to harmonic and continues rotation in same direction?

It stops and resets (disarms) and it will rearm only after TH stick is put into center for second.
I'll try and make short video...

ebourlet
Posts: 9
Joined: Tue Mar 12, 2013 5:42 am

Where are BEMF on nfet HK blue series

Post by ebourlet »

I have this ESC http://static.rcgroups.net/forums/attachments/1/0/5/5/0/5/a4614446-81-own%20BS30A%20pads%20not%20in%20row.jpg
unfortunately I flashed with SimonK before I figured out the NTM motor will not work. Flashed with Wii BSNFET and it stutters will not run. Can anyone tell me how to find what caps I need to remove on this board?

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Where are BEMF on nfet HK blue series

Post by scrat »

ebourlet wrote:I have this ESC http://static.rcgroups.net/forums/attachments/1/0/5/5/0/5/a4614446-81-own%20BS30A%20pads%20not%20in%20row.jpg
unfortunately I flashed with SimonK before I figured out the NTM motor will not work. Flashed with Wii BSNFET and it stutters will not run. Can anyone tell me how to find what caps I need to remove on this board?


Did you flash esc's with latest FW from simonk? I think it works now with NTM motor.

ebourlet
Posts: 9
Joined: Tue Mar 12, 2013 5:42 am

wii-esc-2013-02-15.zip ?

Post by ebourlet »

I just flashed my HK Blue series N-FET with the low side pwm bs_nfet.hex file . I have a 2826 1000kv NTM motor. It appears to work fine . My question is it required to remove the BEMF caps? I can't find any information on where they are on this ESC and I can't find anything not working with this setup. Will leaving them on cause overheating or some kind of failure?

ebourlet
Posts: 9
Joined: Tue Mar 12, 2013 5:42 am

Re: Where are BEMF on nfet HK blue series

Post by ebourlet »

scrat wrote:
ebourlet wrote:I have this ESC http://static.rcgroups.net/forums/attachments/1/0/5/5/0/5/a4614446-81-own%20BS30A%20pads%20not%20in%20row.jpg
unfortunately I flashed with SimonK before I figured out the NTM motor will not work. Flashed with Wii BSNFET and it stutters will not run. Can anyone tell me how to find what caps I need to remove on this board?


Did you flash esc's with latest FW from simonk? I think it works now with NTM motor.

I used the file dated Simon K 2012-09-30 it is the one that the kkflash tool found. Is there a newer one? Because that did not work. Now I have the Wii dated 2-15-2013 and it works great but I am concerned that I do not know if I will damage anything if I do not remove the BEMF caps because I can't figure out which ones they are.

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

Re: Where are BEMF on nfet HK blue series

Post by crashlander »

ebourlet wrote:
scrat wrote:
ebourlet wrote:I have this ESC http://static.rcgroups.net/forums/attachments/1/0/5/5/0/5/a4614446-81-own%20BS30A%20pads%20not%20in%20row.jpg
unfortunately I flashed with SimonK before I figured out the NTM motor will not work. Flashed with Wii BSNFET and it stutters will not run. Can anyone tell me how to find what caps I need to remove on this board?


Did you flash esc's with latest FW from simonk? I think it works now with NTM motor.

I used the file dated Simon K 2012-09-30 it is the one that the kkflash tool found. Is there a newer one? Because that did not work. Now I have the Wii dated 2-15-2013 and it works great but I am concerned that I do not know if I will damage anything if I do not remove the BEMF caps because I can't figure out which ones they are.


Removing BEMF caps is necessary for WII-ESC to get proper/good results but not removing it will probably not destroy ESC or motor. In my case ziss_dm allows pointed out the right ones if I uploaded good picture of ESC.

Regards Andrej

ebourlet
Posts: 9
Joined: Tue Mar 12, 2013 5:42 am

Re: Alternative ESC firmware (reflashing)

Post by ebourlet »

There is a good photo here http://static.rcgroups.net/forums/attac ... %20row.jpg where should I ask to get someone to point out the right ones? Thank you

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

around end of last year ziss_dm did describe generic procedure to locate the bemf caps - in this thread

ebourlet
Posts: 9
Joined: Tue Mar 12, 2013 5:42 am

Re: Alternative ESC firmware (reflashing)

Post by ebourlet »

Thank you I found it from last November "Using multimiter, you can find them checking connction between pin 19, 22, 23 of the MCU". Sorry I should have read the entire thread first. I did try searching but apparently not for the right info.


Image

REmove the Caps in the yellow outlines. This is the HobbyKing Blue Series 30AMP N-FET
Last edited by ebourlet on Thu Mar 21, 2013 5:19 am, edited 1 time 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 »

good luck. I used my smallest soldering iron's tip and extraneous copper wire to suck away the solder from the smd caps. And magnifier glasses, of course.

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 crashlander,

How it looks like? Is it syncing to harmonic and continues rotation in same direction?


@ziss_dm
Short video of the issue:
ESC reset/stop after direction transition.
- around 58s into film one ESC resets
- 1:27, 1:48, 1:58 seems as funny startup noise
- 1:38 another ESC resets

ESC's and motors seems to stay cool.

Link: http://youtu.be/NMLeZOx6L0U

Best Regards
Andrej

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

Re: Alternative ESC firmware (reflashing)

Post by ziss_dm »

Hi crashlander,

in this procedure:

Code: Select all


void wait_for_power_on() {
  //wait_for(rx.rcp_start + US_TO_TICKS(cfg.rcp_deadband_us), rx.rcp_max, 15);
  int8_t cnt = 0;
  while (1) {
    uint16_t tmp = rx_get_frame();
    if (tmp > rx.rcp_zero + US_TO_TICKS(cfg.rcp_deadband_us))
      cnt++;
    else
    if (tmp < rx.rcp_zero - US_TO_TICKS(cfg.rcp_deadband_us))
      cnt--;
    else
      cnt = 0;
    if (abs(cnt) > 5) break;
  }
  if (cnt > 0) {
    pwr_stage.rev = 0;
  } else {
    pwr_stage.rev = 1;
  }
}


Could you please increase inumber of PPM frames (if (abs(cnt) > 5) break;) from 5 to 40-50 and try again? This is actually defines time for breaking, but in PPM frames.. ;).

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 »

F20A not running - how to proceed?
removed 3 bemf caps;
used r515 source,
added COMP_PWM to config.h,
built via Makefile using the arduino IDE's toolchain,
flashed in that order bs_nfet.hex, extended.eep, noboot hfuse (hfuse file taken from older release)
test with limited power source:
hear several beeps (6 beeps?, no armed beep); but motor never starts spinning.

Same for all three ESCs.

For testing I flashed one ESC with v2013.02.15 comp-pwm bs.nfet & extended & noboot hfuse. That does give one more beep at pwerup (I think the armed beep), starts spinning but quits for higher input values (like at about analogWrite(PIN, 150) )

How should I proceed?

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

Re: Alternative ESC firmware (reflashing)

Post by Hamburger »

While waiting for input I modified simonk esc firmware to honor the extended input range, enabled comp.pwm and flashed bs_nfet together with those fuses:

lfuse:w:0x3f:m -U hfuse:w:0xca:

it works! So combo of ESC f20a (pcb has date 2011.12.28) and t-motor 2212-16 is ok. I am afraid this set of ESCs for that particular TRI is now lost to simonk-fw :(

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

Re: Alternative ESC firmware (reflashing) - mega2560

Post by Hamburger »

hi again, I am back with another problem.
After switching from 328p to mega2560 board,the motors never run. wii-ESC gives only three starting tones (old v1 wii-esc version 1 r194 or r195. (With the 328p board everything worked perfectly).

I hooked up a meter and the signals from the motor out pins are
33us @488Hz after powerup (MINCOMMAND 1008)
338us@488Hz when armed (MINTHROTTLE 1160)
Do I need to set anything different for the mega2560 from when using 328p board? I remember Alex introduced a shift of values some time ago when using EXTENDED_RANGE for brushed motors. but I have no idea whether that would be related and/or if the neccessary shift was applied to the mega output routines?
solvedit is indeed the MINCOMMAND setting. For mega it must be left at default of 1000 (because mega code still contains +128 for output register value.

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

Re: Alternative ESC firmware (reflashing) - mega2560

Post by crashlander »

Hamburger wrote:solvedit is indeed the MINCOMMAND setting. For mega it must be left at default of 1000 (because mega code still contains +128 for output register value.

Yes! That is the case. Probably it would be nice to "synchronize" the behavior between the two (because it bites me almost every time).
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 »

Yes. I would remove the +128 from the mega code. Then mincommand must always be 1008.
Anyone with an octo for testing here because motors 7 and 8 are non hw pwm?

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

Re: Alternative ESC firmware (reflashing)

Post by crashlander »

Hamburger wrote:Then mincommand must always be 1008.

Yes but only for specially flashed brushless ESC's and for brushed (FET driven) it must stay 1000.
That way it may be buried in def.h and we could only have something as

Code: Select all

#define BRUSHED
and

Code: Select all

#define EXT_MOTOR_RANGE
and those could activate proper

Code: Select all

#define MINTHROTTLE
#define MINCOMMAND
...
Regards Andrej

Post Reply