HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jan 13, 2013, 07:40 AM
Life begins at transition
Australia, WA, Perth
Joined May 2007
3,523 Posts
To measure it, that means you're programming with the battery (or BEC, or RX) supplying power?
Odysis is offline Find More Posts by Odysis
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 13, 2013, 08:00 AM
Registered User
United States, NC, Raleigh
Joined Oct 2011
687 Posts
Quote:
Originally Posted by idonasch View Post
****programmer question/warning! ****
since I bricked my V1, could that be because the programmer uses 5V on the data pins and the chip runs only on 3.3V? according to the data sheet the max voltage for miso/mosi/sck is Vcc+0.5V? any atmel guru around to confirm my suspicion?
I don't consider myself an Atmel guru but the issue is not specific to Atmel so let me try.

CMOS devices can be damaged by having either excessive voltage (above design breakdown) or reverse polarity voltage applied. What is normally done during design is to add protection (clamp) diodes on each input and output pin. Typical silicon diodes have a voltage drop of about 0.6V. These diodes are connected in such a way that if the voltage exceeds the positive voltage (VCC) supplied to the device, the diode connected to the VCC rail will turn on an attempt to clamp the maximum voltage at the pin to VCC + 0.6V. If a negative voltage (below GND) is applied the other diode will conduct clamping the voltage to GND - 0.6V.

The normal VCC for IC's on the RS3X is 3.3V so even if you drive a pin from a device that has a 5V output the voltage the pin sees will be 3.9V provided that the driving device has some impedance to drop the 1.1V. The driving device may heat up a little but hopefully no damage to the driving device.

However, if the programming device is also supplying 5V power to the device to be programmed, the positive clamp voltage will now be 5.6V. Not a problem for the Atmel ATmega168PA as it can run at 5V. Big problem for the InvenSense Gyro, it can only tolerate 3.6V so the danger is destroying the Gyro.

Not relevant but interesting info.

These clamp diodes also have a side affect. If you fail to provide power to the device to be programmed but you have active signals coming from the programmer (attempting to program a device), the signals via the clamp diodes will attempt to actually charge up all of the capacitors connect to VCC on the device to be programmed. Depending on the driving currents available from the programmer, the number of programmer signals going positive and impedance that VCC has to ground, the VCC can actually be raised to a high enough voltage to allow the device to function as if you had supplied VCC (however at a lower voltage than normal). Since CMOS is low power I have seen entire devices run without VCC applied being powered only by the input signal lines that are above ground. Really weird the first time you see it.
JohnRB is offline Find More Posts by JohnRB
Reply With Quote
Old Jan 13, 2013, 08:13 AM
Registered User
United States, NC, Raleigh
Joined Oct 2011
687 Posts
Quote:
Originally Posted by Odysis View Post
To measure it, that means you're programming with the battery (or BEC, or RX) supplying power?
Yes, the device to be programmed (RX3S in this case) should have 5V applied from a BEC or RX. The RX3S has a 5V to 3.3V linear regulator on board and the VCC (or VDD) for both the Atmel and the Gyro are connected to the regulator 3.3V output.

The problem is that the regulator is a linear regulator and they are normally designed to only source current, not sink it. When the regulator detects that the output voltage is too low it will partially turn on a device connected to the 5V supply to raise the output until it is 3.3V. It the regulator detects that the voltage is above 3.3V is just turns off the device connected to 5V and depends on the load connected to 3.3V to draw enough current to get it back down to 3.3V. If you connect a 5V power supply to the 3.3V line in the RX3S (via a programmer), the linear regulator just turns off and the voltage rises to the 5V applied. That may well be the end of the Gyro that is not designed to withstand more than 3.6V.
JohnRB is offline Find More Posts by JohnRB
Reply With Quote
Old Jan 13, 2013, 08:49 AM
Registered User
Joined Dec 2006
1,427 Posts
Quote:
Originally Posted by Cesco View Post
I have flashed a 3.3V atmega (openlrs) many times with usbasp device, the 5V jumper removed from the usbasp. No problems yet.
One important thing is to put that connector in the right place with the correct orientation, and NOT mess with the fuses.
i think this is key.

- avoid reverse polarity.
- the atmel is designed to work with 3.3v-5v vcc, the gyro is not. so avoid sending 5v to vcc on the isp
- definitely avoid messing with the fuses
- if possible, just get a usbasp programmer that is capable of 5v and 3.3v. ebay has a few. search for "usbasp 3.3v" and check in the description that it supports both voltages. they don't cost much (roughly a cup of decent coffee).

good info about the avrdragon. if it detects the operating voltage through the vcc line, can also power the chip through the same line as an option?
noobee is offline Find More Posts by noobee
Reply With Quote
Old Jan 13, 2013, 09:21 AM
Better to burn out, than fade
SlimTom's Avatar
Slovenia, Ljubljana
Joined Sep 2012
29 Posts
Quote:
Originally Posted by noobee View Post
  • stick proportional channel gain. stabilization gain reduces as stick position departs from neutral position, which prevents the stabilizer from overcorrecting or "fighting" the control stick during manoeuvres.
have question regarding this: my servo's dont' use full travel and I have to set max travel to 40% (for elevator etc) to fly my model.

how proportional ch. gain affects this configuration?

I move stick full, servo moves 40% and prop.gain=?
because from models perspective - this is 100% allowed/healthy travel but servo ppm timming is just 40%. I assume prop.ch.gain is not 0% in this case, but should be?

hope I made myself clear...

Quote:
Originally Posted by noobee View Post
...working on the rx3s first is a good start, though.
...and it's a great work!
Just upgraded my V1 and all went smoothly. Just stick to manuals, that are surprisingly well written and no questions open regarding upgrade!
SlimTom is offline Find More Posts by SlimTom
Last edited by SlimTom; Jan 13, 2013 at 09:31 AM.
Reply With Quote
Old Jan 13, 2013, 09:26 AM
Registered User
Joined Dec 2006
1,427 Posts
the original project goal was to use the pro mini 328p + mpu6050 (which has a gyro and accel), all for about $20-ish. this combo has more flash, more ram and more sensors - almost matching the guardian. importantly, it can be very small too (many of the multicopter boards are just too large and squarish to install into a small pylon racer).

working on the rx3s first is a good start, though.

Quote:
Originally Posted by flightdeck View Post
This is great work. Except for the accelerators(self levelers) your closing in on the Guardian 2D/3D for 17.99.
noobee is offline Find More Posts by noobee
Reply With Quote
Old Jan 13, 2013, 10:02 AM
Registered User
Joined Dec 2006
1,427 Posts
you are right.

the rx3s has no idea what are the channel endpoints and can only make an assumption of the "standard" ones, which is around [1100us-1900us].

so, in your case at full ele stick, the gain factor due to the stick is around 1.0-0.4 = 0.6, so the gyro corrections will be 60% of what they would be if the stick was neutral.

the small detail is in in the "neutral" position. if you applied any elevator trim, then the ppm will not be at 1500us (middle of 1100 and 1900) on neutral stick. on every power up, the rx3s will calibrate by reading the ppm positions assuming sticks are neutral (it will also check that they are still). thus stick deviation is taken from the measured neutral position rather than assuming 1500us. the result is slightly more symmetrical behaviour.

thanks.

Quote:
Originally Posted by SlimTom View Post
have question regarding this: my servo's dont' use full travel and I have to set max travel to 40% (for elevator etc) to fly my model.

how proportional ch. gain affects this configuration?

I move stick full, servo moves 40% and prop.gain=?
because from models perspective - this is 100% allowed/healthy travel but servo ppm timming is just 40%. I assume prop.ch.gain is not 0% in this case, but should be?

hope I made myself clear...
noobee is offline Find More Posts by noobee
Reply With Quote
Old Jan 13, 2013, 10:30 AM
Better to burn out, than fade
SlimTom's Avatar
Slovenia, Ljubljana
Joined Sep 2012
29 Posts
Quote:
Originally Posted by noobee View Post
....
the small detail is in in the "neutral" position. if you applied any elevator trim, then the ppm will not be at 1500us (middle of 1100 and 1900) on neutral stick. on every power up, the rx3s will calibrate by reading the ppm positions assuming sticks are neutral (it will also check that they are still). thus stick deviation is taken from the measured neutral position rather than assuming 1500us. the result is slightly more symmetrical behaviour.....
Would be good to add this to manual/properties? Good to know IMHO.

So - endpoint compensation would require some calibration routine
SlimTom is offline Find More Posts by SlimTom
Reply With Quote
Old Jan 13, 2013, 12:07 PM
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
353 Posts
I wanted to flash mine, but I got stuck at reading the fuse/lock bits. In the readme it says, that the values should be like this:
Code:
    lo=0xf7
    hi=0xdf
    ext=0xf9
    lock=0xfc
    cal=0xffffff95
Mine reads
0xF6 as low fuse and 0xFFFFFFA5 as calibration (the other values mach). Can I still flash it, or is there something wrong with my stabilizer?
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jan 13, 2013, 01:16 PM
Registered User
Joined Dec 2006
1,427 Posts
the calibration byte doesn't have to be the same (i'll update the readme).

but i think the lo fuse (0xf7 vs 0xf6) should. however, the difference (CKSEL0) seem to affect the type of oscillator and the startup time, which the programmer should not modify. it should only modify the lock fuse as part of the erase step. so, in theory, if the chip was running before, it "should" still run after, as those fuse settings are unchanged.

- are you using the v1 or v2 device?
- what programmer h/w and s/w are you using?
- just curious, how are you powering the device?

thanks


Quote:
Originally Posted by Hasi View Post
I wanted to flash mine, but I got stuck at reading the fuse/lock bits. In the readme it says, that the values should be like this:
Code:
    lo=0xf7
    hi=0xdf
    ext=0xf9
    lock=0xfc
    cal=0xffffff95
Mine reads
0xF6 as low fuse and 0xFFFFFFA5 as calibration (the other values mach). Can I still flash it, or is there something wrong with my stabilizer?
noobee is offline Find More Posts by noobee
Last edited by noobee; Jan 13, 2013 at 01:22 PM.
Reply With Quote
Old Jan 13, 2013, 02:18 PM
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
353 Posts
Quote:
- are you using the v1 or v2 device?
The V1.

Quote:
- what programmer h/w and s/w are you using?
I am using this one.

Quote:
- just curious, how are you powering the device?
From the programmer. I know I shouldn't do this, but it shouldn't change the fuses. Or do you think it does?
Hasi is offline Find More Posts by Hasi
Last edited by Hasi; Jan 13, 2013 at 02:28 PM.
Reply With Quote
Old Jan 13, 2013, 07:03 PM
Registered User
Joined Dec 2006
1,427 Posts
which s/w are you using? avrdude or extremeburner or something else? if extremeburner , can you try reading just the fuses again? click on the "fuse bits/settings" tab and then "read all". see if the read back is always consistent.

i don't think any programmer would rewrite the fuses unless you explicitly ask it to do so (eg. erase chip or write to fuse). writing to flash or eeprom will not change the fuses.

next is to try to disconnect the vcc line and power the device externally. better still, buy a usbasp capable of 3.3v and 5v


Quote:
Originally Posted by Hasi View Post
The V1.

I am using this one.

From the programmer. I know I shouldn't do this, but it shouldn't change the fuses. Or do you think it does?
noobee is offline Find More Posts by noobee
Reply With Quote
Old Jan 14, 2013, 02:59 AM
Registered User
Hasi's Avatar
Austria, Stmk., Graz
Joined Sep 2011
353 Posts
Quote:
Originally Posted by noobee View Post
which s/w are you using? avrdude or extremeburner or something else? if extremeburner , can you try reading just the fuses again? click on the "fuse bits/settings" tab and then "read all". see if the read back is always consistent.

i don't think any programmer would rewrite the fuses unless you explicitly ask it to do so (eg. erase chip or write to fuse). writing to flash or eeprom will not change the fuses.

next is to try to disconnect the vcc line and power the device externally. better still, buy a usbasp capable of 3.3v and 5v
I followed exactly the readme and used eXtreme burner. I also tried to to ckick read all in the fuse bits tab. I got the same results. It is always the same, I tried it 3 times, but nothing changed.

IŽm not shure, but I think my USBASP does support 3.3V, but IŽll have to add a switch or a jumper. IŽll try that and inform you about the results!
Hasi is offline Find More Posts by Hasi
Reply With Quote
Old Jan 14, 2013, 02:49 PM
Registered User
United States, NC, Raleigh
Joined Oct 2011
687 Posts
WARNING V2 Processors Damaged Easily

WARNING

I received new ATmega168PA parts today and replaced the damaged one that was one my RX3S V2 (MISO pin open). I loaded the most recent version of noobee's V2 firmware to test and the processor was working but the output pulses were too wide. I decided to try an older version of firmware. Once again, I attempted to program the 168PA without first connecting the battery to my ESC (As my Mother used to tell me Haste makes Waste). I waited for the eXtreme Burner to quick complaining and then I connected the battery to the ESC without disconnecting the programmer first. (It is possible 168 was already damaged before I connected the battery - I don't know).

Another bad ATmega168PA. Good thing these things are cheap, but they are not easy to change. This time the MOSI pin was being held at about 1V and would not move with a signal applied.

The moral of this story is to always be careful how you connect and disconnect your programmer. If you using the HK programmer (here) like I am, do the following in this order:
1. Remove Jumper J1 from the programmer so it does not provide 5V to the device.
2. Connect Power to the RX3S (normally battery to ESC, ESC to RX, RX channel cable (any) to RX3S).
3. Connect programmer USB cable to PC
4. Connect programmer to RX3S with 6 pin cable (V2 boards may require an adapter like this). I know, connecting to something with power applied goes against all we were taught!
5. Program RX3S.
6. Disconnect programmer from RX3S.
7. Disconnect power to RX3S.

NEVER connect programmer to RX3S that is not powered unless the programmer provides the power .
NEVER disconnect RX3S power while programmer is attached.
JohnRB is offline Find More Posts by JohnRB
Last edited by JohnRB; Jan 14, 2013 at 03:52 PM. Reason: Add additional information
Reply With Quote
Old Jan 14, 2013, 09:32 PM
Registered User
Joined Dec 2006
1,427 Posts
just a comment that if you replaced the chip, the fuse settings are factory default and you would need to program the fuses for the new chip accordingly. the values on my v1 and v2 are the same, and should be the following:

lo=0xf7
hi=0xdf
ext=0xf9
lock=0xff

this will set the correct clock source, etc. be extra careful with the lock fuse, make sure it is 0xff before updating any fuses.



Quote:
Originally Posted by JohnRB View Post
WARNING

I received new ATmega168PA parts today and replaced the damaged one that was one my RX3S V2 (MISO pin open). I loaded the most recent version of noobee's V2 firmware to test and the processor was working but the output pulses were too wide.
noobee is offline Find More Posts by noobee
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Sold Flight Stabilization System with Programing Card Woody_99 Aircraft - Electric - Helis (FS/W) 1 Mar 23, 2012 12:50 PM
Sold Flymentor Flight Stabilization with Field Programmer Woody_99 Aircraft - General - Radio Equipment (FS/W) 0 Mar 17, 2012 07:43 AM
Sold Totally Tricked out 400 size with flight stabilization installed, BNF Woody_99 Aircraft - Electric - Helis (FS/W) 2 Mar 12, 2012 06:56 AM
Wanted FY-30A Flight Stabilization System Casey_S FPV Equipment (FS/W) 0 Mar 05, 2012 02:40 PM