HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Oct 26, 2012, 10:48 AM
Registered User
Joined Jun 2006
1,065 Posts
MANY MANY THANKS to all who helped with suggestions.

Hi, Guys.
I had to post my thanks to all who helped me in my hour of need and also to thank Shane Colton for his fantastic modified software.
After getting my receiver to bind in and as I had already flashed his latest software onto my spare board I set it up today in a gusty cold wind because I just couldn't wait!.
I didn't alter any of PI controls, just used it straight off the computer into the board.
Considering that the wind was swirling round the houses here and I've been a bit sceptical that I would ever be able to have it under real control, it was GREAT.

I JUST COULD NOT BELIEVE THE IMPROVEMENT!

Thanks, Shane , a great piece of worK!

Old Man Ted(77!)
tedrobphoto is offline Find More Posts by tedrobphoto
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 26, 2012, 12:24 PM
Registered User
Son, Norway
Joined Sep 2004
3,267 Posts
Quote:
Originally Posted by HappySundays View Post
The regulators (two per ESC) don't have the normal current sharing resistors and are connected directly together. This means the even fight each other in the one ESC. Under load you can feel one heating up as it sources or sinks excess current to/from the other.

As such I would definitely recommend removing the power leads from M2 to M4.
This is quite common, sometimes just soldered on top of each other. However the only problem is that only one might contribute and heat up. When connected in parallel to a power bus, wires and connectors acts as current share resistors, providing perfect load sharing.


"DC errors are mainly determined by VREF accuracy and tolerance of the feedback resistors. When two like regulators are connected in parallel, a small difference in VREF will cause one regulator to source nearly all of the load current until it reaches the current limit. Then, its VOUT will droop until the second regulator, with slightly lower VREF, begins sourcing the remaining load current. Operation in this manner can be acceptable if dissipation and device temperatures remain low enough to avoid thermal cycling."

http://electronicdesign.com/article/...voltage-r-9270

Fred
flarssen is offline Find More Posts by flarssen
Reply With Quote
Old Oct 26, 2012, 01:07 PM
Quad Whisperer
Joined Jul 2008
942 Posts
Hey Fred, you just oped the "BEC can of worms" with that quote!

kapteinkuk is offline Find More Posts by kapteinkuk
Last edited by kapteinkuk; Oct 26, 2012 at 01:12 PM.
Reply With Quote
Old Oct 26, 2012, 01:44 PM
Registered User
Australia, QLD, Brisbane
Joined Nov 2011
949 Posts
Quote:
Originally Posted by flarssen View Post

"DC errors are mainly determined by VREF accuracy and tolerance of the feedback resistors. When two like regulators are connected in parallel, a small difference in VREF will cause one regulator to source nearly all of the load current until it reaches the current limit. Then, its VOUT will droop until the second regulator, with slightly lower VREF, begins sourcing the remaining load current. Operation in this manner can be acceptable if dissipation and device temperatures remain low enough to avoid thermal cycling."

http://electronicdesign.com/article/...voltage-r-9270




Fred
There is nothing wrong with this, one regulator is usually more than enough to supply a quad, that statement does not mean it's bad to put multiple regulators in parallel for convenience, it's just saying the other regulators wont be doing much.
Erknie is offline Find More Posts by Erknie
Reply With Quote
Old Oct 26, 2012, 02:11 PM
Quad Whisperer
Joined Jul 2008
942 Posts
Some thoughts on C converting:

I have been wrestling the ImageCraft C compiler for a few days now.

I know I said to use GCC, but after using many hours to get it to compile the most basic example code (GCC is very picky regarding compound expressions and requires a million parentheses, and also trying to get the list file was mostly unsuccessful) I decided to google "best C compiler for AVR". What a mistake, haha. After reading 10000000 different opinions for another X hours, I decided to try imageCraft.

Things I learned:

1: Each of the source files have their own scope, and requires endless* layers of header files to communicate. I know object oriented programming and see advantages with only exposing input and output variables, but it feels like overkill in this case.

2: Complicating stuff: Setting a single bit in I/O is done by "PORTA |= 1<<n" I know that a good C compiler recognizes this and uses the "SBI PORTA, n" instead of literally translating it to "in t, PORTA", "ori t, 2^n" and "out PORTA, t".

3: It would not let me write macros that sets single bits without nesting macros like the Russian Matryoshka dolls*. ASM does that with a single macro.

4: There where no delay function. I ended up writing my own in C and trying to calibrate it with a stop-watch like a noob. I prefer to count cycles.

5: I saw a "NOP" in the list file

6: Writing inline assembly is a pain. Also the usr manual says I can not reserve spesific registers for my own use and I can only access the low byte of a C variable...

On a positive note, the text editor is really good. Much better than Atmel's stone-age editor. Does anybody know of a similar editor for AVR? I do not dare to google it

Until now I had only written the hardware initialization in C and already reached 5 files...

...so I think I will descend into the dark again and improve the resolution of my math library and have another go at the damn AHRS.





*: May be an exaggeration.
kapteinkuk is offline Find More Posts by kapteinkuk
Reply With Quote
Old Oct 26, 2012, 02:25 PM
Stop me before I build again!
United States, NY, Albany
Joined Sep 2012
1,320 Posts
1. I think Simon said keep it in one file

2/3. http://www.nongnu.org/avr-libc/user-..._avr__sfr.html

4. http://www.nongnu.org/avr-libc/user-...__cpufunc.html but really you should be using one of the delay_loop functions which take either cycles, us, or ms as input.

Maybe hit up simon to see if he has any more pointers.
brontide is offline Find More Posts by brontide
Reply With Quote
Old Oct 26, 2012, 02:29 PM
Registered User
Joined Jun 2011
365 Posts
I'd be happy to help you kapteinkuk but this is far above my intelligence.

Take your time and give us what you can. Most of us know you are the KK boss.
oyibox is offline Find More Posts by oyibox
Reply With Quote
Old Oct 26, 2012, 03:05 PM
Registered User
scolton's Avatar
United States, MA, Cambridge
Joined Aug 2012
30 Posts
Quote:
Originally Posted by kapteinkuk View Post
Some thoughts on C converting:

I have been wrestling the ImageCraft C compiler for a few days now.

I know I said to use GCC, but after using many hours to get it to compile the most basic example code (GCC is very picky regarding compound expressions and requires a million parentheses, and also trying to get the list file was mostly unsuccessful) I decided to google "best C compiler for AVR". What a mistake, haha. After reading 10000000 different opinions for another X hours, I decided to try imageCraft.

Things I learned:

1: Each of the source files have their own scope, and requires endless* layers of header files to communicate. I know object oriented programming and see advantages with only exposing input and output variables, but it feels like overkill in this case.

2: Complicating stuff: Setting a single bit in I/O is done by "PORTA |= 1<<n" I know that a good C compiler recognizes this and uses the "SBI PORTA, n" instead of literally translating it to "in t, PORTA", "ori t, 2^n" and "out PORTA, t".

3: It would not let me write macros that sets single bits without nesting macros like the Russian Matryoshka dolls*. ASM does that with a single macro.

4: There where no delay function. I ended up writing my own in C and trying to calibrate it with a stop-watch like a noob. I prefer to count cycles.

5: I saw a "NOP" in the list file

6: Writing inline assembly is a pain. Also the usr manual says I can not reserve spesific registers for my own use and I can only access the low byte of a C variable...

On a positive note, the text editor is really good. Much better than Atmel's stone-age editor. Does anybody know of a similar editor for AVR? I do not dare to google it

Until now I had only written the hardware initialization in C and already reached 5 files...

...so I think I will descend into the dark again and improve the resolution of my math library and have another go at the damn AHRS.





*: May be an exaggeration.
So you are definitely not going to use AVRStudio / GCC?

AVR is the only micro I know of that uses the REGNAME |= (1<<BITNAME) style for setting bits. All others I've used (PIC, MSP430, STM32) have something more like REGNAME |= BITNAME and BITNAME is already defined as 2^n instead of just n. So that's just an AVR-specific quirk - not really a C quirk.

Best of luck! Can't wait to see the new AHRS code.
scolton is offline Find More Posts by scolton
Reply With Quote
Old Oct 26, 2012, 03:06 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
2,906 Posts
Quote:
Originally Posted by flarssen View Post
"DC errors are mainly determined by VREF accuracy and tolerance of the feedback resistors. When two like regulators are connected in parallel, a small difference in VREF will cause one regulator to source nearly all of the load current until it reaches the current limit. Then, its VOUT will droop until the second regulator, with slightly lower VREF, begins sourcing the remaining load current. Operation in this manner can be acceptable if dissipation and device temperatures remain low enough to avoid thermal cycling."
Sorry but that's not right. The assumption has been made that the problem is that only one reg is actually supplying power. Partly true, but not the actual problem.
This is the actual problem:
Let's imagine one reg wants to output 4.90V and the other 5.1V. Lets also imagine that some cheap-ass fool has tied them together directly.
The higher one tries to pull up the lower one and the lower one pulls down the higher one. And how does this actually manifest?
Linear regulators regulate by sinking and sourcing current. The lower one will sink current to try and pull it down, the higher one sources it to pull it up.
So the result is that both regulators pour as much current as they have available into getting the output voltage that they want (but can never have).
Eventually, one will shutdown through either over current or overheating and the other will temporarily "win". Briefly.
It may be that cabling helps current sharing but I would hardly call it perfect. More like "lucky".
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Oct 26, 2012, 03:17 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
2,906 Posts
KK, some notes on using GCC...

Quote:
Originally Posted by kapteinkuk View Post
1: Each of the source files have their own scope, and requires endless* layers of header files to communicate.
I just use one header file to expose externals.

Quote:
2: Complicating stuff: Setting a single bit in I/O is done by "PORTA |= 1<<n" I know that a good C compiler recognizes this and uses the "SBI PORTA, n" instead of literally translating it to "in t, PORTA", "ori t, 2^n" and "out PORTA, t".
Have a look at the macro pinched from AVRfreaks that is in Mike and my code. Setting bits then is like LED = 1... and compiles as you'd expect.

Quote:
3: It would not let me write macros that sets single bits without nesting macros like the Russian Matryoshka dolls*. ASM does that with a single macro.
Same. See above.

Quote:
6: Writing inline assembly is a pain. Also the usr manual says I can not reserve spesific registers for my own use and I can only access the low byte of a C variable...
Have a look at the C to Assembler technique used in OpenAero. No nasty inline assembler as it combines REAL assembler files with C. Inline assembler looks ugly.

Quote:
Until now I had only written the hardware initialization in C and already reached 5 files...
...so I think I will descend into the dark again and improve the resolution of my math library and have another go at the damn AHRS.
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Oct 26, 2012, 03:28 PM
It's Just a Hobby!
Sudsy's Avatar
United States, MD, Lusby
Joined May 2012
834 Posts
Quote:
Originally Posted by scolton View Post
So you are definitely not going to use AVRStudio / GCC?

AVR is the only micro I know of that uses the REGNAME |= (1<<BITNAME) style for setting bits. All others I've used (PIC, MSP430, STM32) have something more like REGNAME |= BITNAME and BITNAME is already defined as 2^n instead of just n. So that's just an AVR-specific quirk - not really a C quirk.

Best of luck! Can't wait to see the new AHRS code.
Hey, What do you use AHRS to represent? I know it as Attitude Heading Reference System. (real airplanes)

Sudsy
Sudsy is offline Find More Posts by Sudsy
Reply With Quote
Old Oct 26, 2012, 04:42 PM
Dixie Normious
Eastcoast78's Avatar
Can A da....Ehh!!
Joined May 2010
5,321 Posts
Quote:
Originally Posted by tedrobphoto View Post
Hi, Guys.
I had to post my thanks to all who helped me in my hour of need and also to thank Shane Colton for his fantastic modified software.
After getting my receiver to bind in and as I had already flashed his latest software onto my spare board I set it up today in a gusty cold wind because I just couldn't wait!.
I didn't alter any of PI controls, just used it straight off the computer into the board.
Considering that the wind was swirling round the houses here and I've been a bit sceptical that I would ever be able to have it under real control, it was GREAT.

I JUST COULD NOT BELIEVE THE IMPROVEMENT!

Thanks, Shane , a great piece of worK!

Old Man Ted(77!)
Was your Entire flight with AL on?
Eastcoast78 is offline Find More Posts by Eastcoast78
RCG Plus Member
Old Oct 26, 2012, 04:50 PM
Registered User
CO2X2010's Avatar
United States, CA, Hayward
Joined Oct 2010
2,092 Posts
Mini me tri

MINI-KK2.0-1.2V TRICOPTER....MINI ME !!! (2 min 52 sec)




....need tuning and cleaning up !!!
CO2X2010 is offline Find More Posts by CO2X2010
RCG Plus Member
Last edited by CO2X2010; Oct 26, 2012 at 04:51 PM. Reason: MORE
Reply With Quote
Old Oct 26, 2012, 05:12 PM
Registered User
CO2X2010's Avatar
United States, CA, Hayward
Joined Oct 2010
2,092 Posts
Mini tri with big brother

....size comparison with his BIG brother !!!
CO2X2010 is offline Find More Posts by CO2X2010
RCG Plus Member
Old Oct 26, 2012, 05:25 PM
Registered User
Joined Jun 2011
365 Posts
Sold my KK2 quad today because someone just wanted to buy it.

thanks you all for your help. I move to something else now.

packaging almost ready.
oyibox is offline Find More Posts by oyibox
Reply With Quote