HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jun 23, 2013, 06:22 AM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Hi Simon,

Quote:
Originally Posted by simonk View Post
...
Afaik, it's not possible to read or write the fuses. You can not ask it to do a chip erase and then the EEPROM will stay, or you can back-up and restore the EEPROM separately, etc...
I have read fuses on some AVR chips, I cannot recall having done it on an ATMEGA8.

Off the top of my head, I cannot recall an asm project, but here is the listing of a call from C for ATTINY24/45/85.

Code:
  switch(boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS)&0xf){
 232:    e0 e0           ldi    r30, 0x00    ; 0
 234:    f0 e0           ldi    r31, 0x00    ; 0
 236:    89 e0           ldi    r24, 0x09    ; 9
 238:    80 93 57 00     sts    0x0057, r24
 23c:    84 91           lpm    r24, Z
 23e:    8f 70           andi    r24, 0x0F    ; 15
 240:    82 30           cpi    r24, 0x02    ; 2
 242:    51 f4           brne    .+20         ; 0x258 <main+0xa8>
  case 0x02: //RC osc
One from an asm project, again for ATTINY:
Code:
  ;get the low fuse byte
  clr r30
  clr r31
  ldi r16,(1<<RFLB)|(1<<SPMEN)
  out SPMCSR,r16
  lpm r16,z
  andi r16,0xf
  subi r16,0x02 ;internal RC clock
  brne accclk
The avr-gcc documents the register settings.

Whilst it might well be possible for you to check the fuses before erasing EEPROM, it probably isn't worthwhile, especially if space is tight (as it often is in bootloaders).

My statement was really just clarification that EEPROM is probably erased using your bootloader, that was my recollection from reading the code at some point.

Owen
OwenD is offline Find More Posts by OwenD
Last edited by OwenD; Jun 23, 2013 at 04:11 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jun 23, 2013, 07:02 AM
manuLRK
Belgium
Joined Sep 2004
1,529 Posts
Simon,

Mmm, i don't get it. sorry , could you add a hand drawing of the connections, and what i should see and measure on the scope?

thanks,
manu

Quote:
Originally Posted by simonk View Post
To find reasonable dead time values, you can use a milliAmpere-meter and binary search the value where the current stays the lowest with no motor attached, though this isn't exact. With an oscilloscope, I run the power through a weak jumper lead that acts as a slight resistor, then attach the scope probe at the end of it, where it connects to the ESC positive wire. With the 'scope on about 20-50ns horizontal, triggering on falling edges at just below the normal supply voltage. You can then see when the shoot-through occurs, and for how long. If you trigger from the motor phase instead, you can also work on low versus high side values separately (a bit more tricky).

Maybe there really should be high/low dead-times on the spreadsheet...the problem being that otherwise, there would need to be a separate .hex for almost every ESC, instead of just the pin-incompatible ones.
alll is offline Find More Posts by alll
Reply With Quote
Old Jun 23, 2013, 12:29 PM
Wolfgang
wkorosec's Avatar
St. Gallen, Switzerland
Joined Jun 2004
36 Posts
Hi Simon,
thank you very much for you helpful explanation of RCP_LOW_DBAND and LOW_BRAKE !

Quote:
Originally Posted by simonk View Post
LOW_BRAKE applies the brake power specified by LOW_BRAKE_POWER as soon as the input command goes RCP_LOW_DBAND below the neutral area, hence the name "low".
I already understood and tested the effects of LOW_BRAKE, SLOW_THROTTLE and LOW_BRAKE_SPEED.

There is one missing piece in my fixed-wing acro puzzle, which is probably completely useless for multicopters: it should be possible to define the "power" or torque of the brake by a parameter. Imagine an acrobatic airplane on a vertical dive. Gas is idle - without motor brake the prop will turn faster and faster, and the plane will accelerate. Especially when flying competitions you do not want to go too fast. If you "brake" the prop, but do not stop it, the plane will dive slower because of the induced drag of the prop. BTW: This is also the reason why acro pilots are willing to pay > 300 USD for speed controllers like this one http://www.jetimodel.com/index.php?p...=0&category=84

So my - hopefully - last question for the moment is:
Is LOW_BRAKE_POWER the right parameter to change for this specific need ?

I already prepared my testbed:
  • Angel 50S
  • Scorpion S4020-16 415U/V
  • 16x10 Prop
  • 6 Cell Lipo 4500 mAh
  • 90A ESC from HK
  • Unilog Datalogger + Telemetry

As soon as the weather is getting better here, I will try it out and publish the result

Best regards,
Wolfgang
wkorosec is offline Find More Posts by wkorosec
Last edited by wkorosec; Jun 23, 2013 at 12:32 PM. Reason: typo
Reply With Quote
Old Jun 23, 2013, 03:57 PM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by OwenD View Post
I have read fuses on some AVR chips, I cannot recall having done it on an ATMEGA8.
It is dealt with in the Atmega8 datasheet under the heading "Reading the Fuse and Lock Bits from Software".

Having just tried, it seems you may not have the code space available (unless the nop padding is available).

Owen
OwenD is offline Find More Posts by OwenD
Last edited by OwenD; Jun 23, 2013 at 05:52 PM.
Reply With Quote
Old Jun 23, 2013, 06:02 PM
Registered User
Canada, ON, Toronto
Joined Jan 2008
455 Posts
working now

Thnx Owen, I of course have been shorting esc's by touching I am sure.
I am covering the esc now, a lesson well learned.
BTW Owen, how does the multiwii firmware perform on these little 6a esc's.

I have some pancakes (nx from hobbyking ). Am I correct in saying that the multiwii firmware works more consistently on many of the high pole pancake motors?
thnx


Quote:
Originally Posted by OwenD View Post
Ok, but several firmware types follow the naming convention of bs.hex for that ESC. Perhaps you have used SimonK's ESC.

I have bs.hex from wii-esc on one of those ESCs.

So, I haven't told you anything you didn't already know. Wrap the ESC to protect it and the motor!!!

DId you read my notes about the grubscrews holding the mount on those motors?

Cheers
Owen
dowlinger is online now Find More Posts by dowlinger
Reply With Quote
Old Jun 23, 2013, 07:25 PM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by dowlinger View Post
BTW Owen, how does the multiwii firmware perform on these little 6a esc's.

I have some pancakes (nx from hobbyking ). Am I correct in saying that the multiwii firmware works more consistently on many of the high pole pancake motors?
thnx
In my tests on a small motor, the stock firmware was appalling (unreliable starting, rough running) whereas both tgy and wii-esc worked much better (reliable starting for one thing) and more efficient (less battery current for same load rpm.

Can't comment on the last question.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 24, 2013, 02:05 AM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
USBLinker.hex

I have spent quite a bit of time trying to resolve an issue with USBLinker.hex from the wii-esc file site.

USBLinker is a derivative of tgy's bootloader.

It turns out that, though it is not very far out of date, it is three or four commits behind today and that was enough... the problems had been fixed a couple of months ago by Simon.

So, a lesson in sourcing modules!

I also did some experiments with an EEPROM image with the same throttle cal as used by wii-esc for the Multiwii FC. The idea is to be able to program four ESCs with identical characteristics and suited to Multiwii's preferred throttle range (in case it makes any difference).

Name: Screenshot - 24_06_2013 , 16_59_19.png
Views: 102
Size: 91.7 KB
Description:

Above is a screenshot of the EEPROM image opened under a template in Hex Editor Neo. The values in the pulse fields are 16 times the PWM microsecond values.

I will give this a go with the lock bits not set and see if we damage the bootloader over time. I am loathe to do this normally, but since we don't use a protected bootloader, the risk is somewhat less.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 24, 2013, 04:12 AM
Registered User
France, IdF, Neuilly-sur-Seine
Joined Jan 2012
92 Posts
I built a custom firmware based on 2013-05-15 source version. It's a BS nfet custom firmware with COMP_PWM on, RC_CALIBRATION off, STOP_RC_PULS at 1100 and FULL_RC_PULS at 1900.
This custom firmware was uploaded to my 4 HobbyKing 20A BlueSeries esc.
I'm using those ESC with Arducopter, and when I change the min PWM to something like 1100, 3 motors are running and not 4, when I change it to 1101 all 4 motors are running and with 1099 2 are running, and 1098 stop all motors.
It's not a big deal to have this behavior, I'm just curious to know why not all motors start/stop at the same pulse when calibration is already set in the firmware ?
airmamaf is offline Find More Posts by airmamaf
Reply With Quote
Old Jun 24, 2013, 04:51 AM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by airmamaf View Post
I built a custom firmware based on 2013-05-15 source version. It's a BS nfet custom firmware with COMP_PWM on, RC_CALIBRATION off, STOP_RC_PULS at 1100 and FULL_RC_PULS at 1900.
This custom firmware was uploaded to my 4 HobbyKing 20A BlueSeries esc.
I'm using those ESC with Arducopter, and when I change the min PWM to something like 1100, 3 motors are running and not 4, when I change it to 1101 all 4 motors are running and with 1099 2 are running, and 1098 stop all motors.
It's not a big deal to have this behavior, I'm just curious to know why not all motors start/stop at the same pulse when calibration is already set in the firmware ?
So, you are talking about the difference of a microsecond or two.

The signal paths for each FC-ESC are not identical, and they do not share a common clock.

One of the more significant departures will be the effect of ESC input filtering.

The input circuit of an ESC will have some low pass filtering that modifies the rise and fall times of the pulses, and given the tolerance of circuit components, you might expect a little variation.

I haven't sought to measure the effects, but you can expect some small variation from channel to channel and it is naive to think they they will be identical.

The variation you observe is of insignificant effect when the motors are raised to working rpm.

Just make sure you don't set the FC 'on' value too close to the ESCs, allow a margin for tolerances and variation in the system.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 25, 2013, 09:11 PM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by OwenD View Post
I bought a Turnigy Multistar 10A ESC to evaluate, thinking that if all else fails I can re-flash it since Hobbyking state "Multistar ESC's feature an ATmega MCU that opens the door to customizable firmware".

The ESC would not automatically restart a motor that was stalled (unless the servo input was returned to 1000us for a while). When the motor stalled, the ESC just drew lots of current, but the motor shaft sat fairly still and the motor emitted lots of high frequency sound. After 2s to more than 10s, the ESC would cut out and current fell to a safe level.

...
So I made a little video to show the stall behaviour.

TgyMultstar10Stall (0 min 41 sec)


Other ESCs restarted the motor, or timed out and reduced current to 'OFF' level.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 26, 2013, 02:04 AM
Registered User
Belgium, Flemish Region, Geel
Joined Jun 2013
1,182 Posts
First, two short questions;

- Should I set the USBasp "Slow SCK " jumper?
- My USBasp also has a jumper for 3.3 and 5v. I am assuming I should set it to 5v? Or is it better to power the ESC externally and remove that jumper (no VCC to target) ?

When I receive my hobbywing flashing tool adapter, I will be trying to flash the increasingly common counterfeit Hobbywing Skywalker 20A. (more info here: http://www.rcgroups.com/forums/showthread.php?t=1817075). The default firmware causes a constant clicking sound, which Im told, is a loss of timing/synchronization. I will report back the results with SimonK.

You might want to add this ESC to the first post, this ESC is turning up everywhere on amazon, ebay, ..

Thanks for all your hard work, its much appreciated!
Vertigo72 is offline Find More Posts by Vertigo72
Reply With Quote
Old Jun 26, 2013, 02:33 AM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by Vertigo72 View Post
First, two short questions;

- Should I set the USBasp "Slow SCK " jumper?
It won't hurt, other than slowing the process... which might be an issue with the adapter you mention.

In more recent USPASP FW, you can use the -B parameter to slow the clock, and with more granularity than the jumper.

Quote:
Originally Posted by Vertigo72 View Post
- My USBasp also has a jumper for 3.3 and 5v. I am assuming I should set it to 5v? Or is it better to power the ESC externally and remove that jumper (no VCC to target) ?
If the ESC runs on 5V, use 5V.

Note that there are lots of USBASP on eBay with a 5V/3.3V capability but using an ATMEGA8, and it is not guaranteed at 12MHz clock on 3.3V.

Powering the target from the USBASP may have problems. The lowest risk path is to not power the target from USBASP. That said, I often do it, and it is very convenient!

Power the ESC from a current limited power supply. I have had instances where the ESC draws high current, and if running on a battery, damage might have ensued.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 26, 2013, 02:41 AM
Registered User
Belgium, Flemish Region, Geel
Joined Jun 2013
1,182 Posts
Quote:
Originally Posted by OwenD View Post
If the ESC runs on 5V, use 5V.
Im a total newbie. How would I know what voltage the ESC runs at?
Vertigo72 is offline Find More Posts by Vertigo72
Reply With Quote
Old Jun 26, 2013, 03:13 AM
Registered User
Australia, NSW, Bowral
Joined May 2013
845 Posts
Quote:
Originally Posted by Vertigo72 View Post
Im a total newbie. How would I know what voltage the ESC runs at?
You could measure it what you have in your hands, that is the most reliable way!

The Rapidesc database has some info IIRC, but note that some products have changed over time.

Owen
OwenD is offline Find More Posts by OwenD
Reply With Quote
Old Jun 26, 2013, 04:01 AM
Registered User
Belgium, Flemish Region, Geel
Joined Jun 2013
1,182 Posts
Quote:
Originally Posted by OwenD View Post
You could measure it what you have in your hands, that is the most reliable way!
Gotcha, to be clear, I should put the hobbyking clamp on the atmel and measure between pins 4 and 5 while the ESC is turned on (but disconnected from the FC), right?

I appreciate all the help thats being provided, but I have to say, this hobby has changed quite a bit over the past decades. Last time I flew, before I got in to QC's, it was just a matter of plugging in servo's in the receiver, nitro in the fuel tank, turn on your transmitter and off you were.

Nowadays I need to reprogram microcontrollers on the ESCs, flash and program a flightcontroller, my radio transmitter, heck Im even supposed to hook up the battery charger to my PC to monitor my batteries. I have to fight with soldering irons, software and drivers all day long. I guess my choice of a Multiwii board for my first build isnt exactly helping here, but oh well, Ill get there eventually!
Vertigo72 is offline Find More Posts by Vertigo72
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Rctimer 30A esc cutting out with KK board Efliernz Multirotor Talk 2 May 26, 2011 02:20 PM
Sold FS: Tricopter Parts- HK401b, Pentium 30A ESC, rctimer 750kv motors pwu_1 Aircraft - General - Miscellaneous (FS/W) 2 Jan 18, 2011 09:58 PM
Sold RCTimer 2826-6 + ESC 30A New in packaging will trade as well Pics Added! planebldr Aircraft - Electric - Power Systems (FS/W) 4 May 25, 2010 09:54 PM
Discussion RCTimer 30A Programmable ESC hunter7193 Power Systems 8 Jan 02, 2010 02:27 PM
For Sale Several New ESC's - 10a, 20a, 30a - Reduced Callen9345 Aircraft - Electric - Power Systems (FS/W) 0 Apr 20, 2009 02:31 PM