SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old May 30, 2011, 03:15 AM
Sudden Freak
c2po's Avatar
Atlanta, GA
Joined Oct 2006
330 Posts
Quote:
Originally Posted by Alexinparis View Post
thank you for this very useful info.
as the /4 will avoid the last 2 lst bits, I'm not sure about the usefulness of &0xFC
This should be equivalent, no ?
Code:
accADC[ROLL]  = - ((rawADC_BMA180[1]<<8) | rawADC_BMA180[0]) / 80;
accADC[PITCH] = - ((rawADC_BMA180[3]<<8) | rawADC_BMA180[2]) / 80;
accADC[YAW]   =   ((rawADC_BMA180[5]<<8) | rawADC_BMA180[4]) / 80;
Another thing, I noticed this code is smaller:
Code:
accADC[ROLL]  = - ((rawADC_BMA180[1]<<8) + rawADC_BMA180[0]) / 80;
accADC[PITCH] = - ((rawADC_BMA180[3]<<8) + rawADC_BMA180[2]) / 80;
accADC[YAW]   =   ((rawADC_BMA180[5]<<8) + rawADC_BMA180[4]) / 80;
Is the result equivalent or not ?
Yes, Alex, I think you're right in both cases, since we divide it anyway lower bits will be eliminated, I didn't think about it, good catch.
Adding should give the same result, but it might need some testing since it's a two's complement format, but I know for sure that OR gives proper result.

Update: I tried adding instead of OR - getting some weird results. So I would better leave bitwise OR (|), that works for sure, code savings shouldn't matter since we already passed the ATMega168 16K size.
c2po is offline Find More Posts by c2po
Last edited by c2po; May 30, 2011 at 05:30 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old May 30, 2011, 03:58 AM
Registered User
RCvertt's Avatar
Joined Aug 2007
4,185 Posts
On a ProMini 5v I get 4.35 volts from A4 which seams high for the ITG-3200 gyro I want to use. Is there anyway to reduce the voltage on that pin to something a 3.3v sensor can handle?
RCvertt is offline Find More Posts by RCvertt
RCG Plus Member
Last edited by RCvertt; May 30, 2011 at 09:02 AM.
Reply With Quote
Old May 30, 2011, 05:31 AM
Registered User
Norway Haugesund
Joined Jun 2010
329 Posts
Quote:
Originally Posted by RCvertt View Post
On a ProMini 5v I get 4.35 volts from A4 which seams high for the ITG-3200 gyro I want to use. Is there anyway to reduce the voltage on that pin to something a 3.3v sensor can handle?
Yes you have to use a LLC like this :
culexus is offline Find More Posts by culexus
Reply With Quote
Old May 30, 2011, 09:25 AM
Hamburger
hamburger's Avatar
Joined Jan 2010
860 Posts
possible asymetric quadplus?

Hi,
do we already have support for an asymetric quad plus?
I want the front and rear rotors to carry all/most of the weight with two little left/right rotors for roll. Something like 6 and 10 inch rotors (and two small and two larger motors)
The rotation would have to be as in the diagram to compensate for torque, right? This does not follow the rule of thumb provided for quads. What do you think, possible, been done?
Thanks, Hamburger
hamburger is offline Find More Posts by hamburger
Reply With Quote
Old May 30, 2011, 09:41 AM
Registered User
RCvertt's Avatar
Joined Aug 2007
4,185 Posts
Quote:
Originally Posted by culexus View Post
Yes you have to use a LLC like this :...
Great, thanks.

I was just testing my one gram arduino and it looks like the sparkfun gyro, accel and LLC combo will save me another gram of weight compared to the cut down wii sensors.
RCvertt is offline Find More Posts by RCvertt
RCG Plus Member
Latest blog entry: Chupacabra sighting !!!
Reply With Quote
Old May 30, 2011, 10:17 AM
Registered User
RCvertt's Avatar
Joined Aug 2007
4,185 Posts
Quote:
Originally Posted by hamburger View Post
Hi,
do we already have support for an asymetric quad plus?
I want the front and rear rotors to carry all/most of the weight with two little left/right rotors for roll. Something like 6 and 10 inch rotors (and two small and two larger motors)
The rotation would have to be as in the diagram to compensate for torque, right? This does not follow the rule of thumb provided for quads. What do you think, possible, been done?
Thanks, Hamburger
Your diagram looks good.

Normal + config will do what you want. Yaw control will be coupled with pitch but the Cyber Surfer seams to do ok with this yaw coupling.
RCvertt is offline Find More Posts by RCvertt
RCG Plus Member
Last edited by RCvertt; May 30, 2011 at 10:26 AM.
Reply With Quote
Old May 30, 2011, 11:31 AM
Hamburger
hamburger's Avatar
Joined Jan 2010
860 Posts
Quote:
Originally Posted by RCvertt View Post
Your diagram looks good.

Normal + config will do what you want. Yaw control will be coupled with pitch but the Cyber Surfer seams to do ok with this yaw coupling.
you sure? My front and rear spin in opposite directions - I need this because the much larger front+rear rotors provide way more torque than the two small side rotors. so to compensate make them spin opposite (like with bi-copter).
The way I read the quadp code for yaw left+right and front+rear are coupled (same sign in front of yaw part. In the diagrams on the multiwii site that corresonds with rotation (front+rear CW, left+right CCW)
Code:
  #ifdef QUADP
    motor[0] = rcCommand[THROTTLE] + axisPID[PITCH] - YAW_DIRECTION * axisPID[YAW]; //REAR
    motor[1] = rcCommand[THROTTLE] - axisPID[ROLL]  + YAW_DIRECTION * axisPID[YAW]; //RIGHT
    motor[2] = rcCommand[THROTTLE] + axisPID[ROLL]  + YAW_DIRECTION * axisPID[YAW]; //LEFT
    motor[3] = rcCommand[THROTTLE] - axisPID[PITCH] - YAW_DIRECTION * axisPID[YAW]; //FRONT
  #endif
So I assume I need different coupling for yaw? To yaw left, my front+left would have to spin faster (and right+rear slower). What worries me, this does not provide symetrical lift (with reference to center), so copter may tilt diagonally when yawing?
hamburger is offline Find More Posts by hamburger
Reply With Quote
Old May 30, 2011, 12:25 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
NRW, Germany
Joined Sep 2010
3,534 Posts
Quote:
Originally Posted by hamburger View Post
you sure? My front and rear spin in opposite directions - I need this because the much larger front+rear rotors provide way more torque than the two small side rotors. so to compensate make them spin opposite (like with bi-copter).
The way I read the quadp code for yaw left+right and front+rear are coupled (same sign in front of yaw part. In the diagrams on the multiwii site that corresonds with rotation (front+rear CW, left+right CCW)
Code:
  #ifdef QUADP
    motor[0] = rcCommand[THROTTLE] + axisPID[PITCH] - YAW_DIRECTION * axisPID[YAW]; //REAR
    motor[1] = rcCommand[THROTTLE] - axisPID[ROLL]  + YAW_DIRECTION * axisPID[YAW]; //RIGHT
    motor[2] = rcCommand[THROTTLE] + axisPID[ROLL]  + YAW_DIRECTION * axisPID[YAW]; //LEFT
    motor[3] = rcCommand[THROTTLE] - axisPID[PITCH] - YAW_DIRECTION * axisPID[YAW]; //FRONT
  #endif
So I assume I need different coupling for yaw? To yaw left, my front+left would have to spin faster (and right+rear slower). What worries me, this does not provide symetrical lift (with reference to center), so copter may tilt diagonally when yawing?
The way I see it you need to scrap the 2 side motors and use 2 servos on the main rotors. something like a "BI" flying sideways. If you use the little motors for yaw you will also have a roll component. and also if one of the larger rotors spin faster you will have a pitch problem.. of course you could always add one more little motor ( Rotating in both directions ) only for yaw...
jhsa is online now Find More Posts by jhsa
Reply With Quote
Old May 30, 2011, 01:01 PM
Registered User
grumman5277's Avatar
Troy ,OH
Joined Jan 2004
1,813 Posts
Working at my wife's pace

Getting there still a little soldering to do. I'm sure I have an hr or so just setting up the initial trims etc.

I also wound the tail one less turn just to see if the extra rpm's help compensate for the lose.
grumman5277 is offline Find More Posts by grumman5277
Reply With Quote
Old May 30, 2011, 02:50 PM
MultiWiiHead
Centurian's Avatar
Corvallis OR
Joined Apr 2004
258 Posts
Quote:
Originally Posted by hamburger View Post
you sure? My front and rear spin in opposite directions - I need this because the much larger front+rear rotors provide way more torque than the two small side rotors. so to compensate make them spin opposite (like with bi-copter).
The way I read the quadp code for yaw left+right and front+rear are coupled (same sign in front of yaw part. In the diagrams on the multiwii site that corresonds with rotation (front+rear CW, left+right CCW)

So I assume I need different coupling for yaw? To yaw left, my front+left would have to spin faster (and right+rear slower). What worries me, this does not provide symetrical lift (with reference to center), so copter may tilt diagonally when yawing?
As drawn, I doubt it will fly in a controlled manner, yaw will be almost uncontrollable causeing pitch & roll. Pitch & roll commands will cause yaw.. You'll be much better off with "normal" prop rotation, same rotation front & rear / side to side. If you need more yaw authority on the small motors, tilt them slightly.
Centurian is offline Find More Posts by Centurian
Reply With Quote
Old May 30, 2011, 03:18 PM
Sudden Freak
c2po's Avatar
Atlanta, GA
Joined Oct 2006
330 Posts
Quote:
Originally Posted by musclera View Post
Very interesting that you should note this - I noticed the same previously:
http://www.rcgroups.com/forums/showp...ostcount=13828

But I had NK ack shenanigans that I attributed to my serial cable (I didn't say I was using a Nokia DKU-5 or CA-42 as it seemed like I was the only one doing so; it programs fine) or my pro mini. I've since received a nano instead of spending $15+ to get the FTDI USB serial board but have found that I need bigger props so I haven't looked at trying to get the NK working.
Strange that serial cable affects this, I would think it's totally unrelated.
Actually I also addeded i2c_stop() but that made things worse to the point that nunchuk stopped working, so I removed it and left all sequence as it was.
Anyway it's clear that some cheap clones require special attention and fine tuning of that simplified I2C sequence we are using in Alex MultiWii code.

Alex, thank you again, I really enjoy working with your code, I learned a lot.
c2po is offline Find More Posts by c2po
Reply With Quote
Old May 30, 2011, 04:08 PM
Sudden Freak
c2po's Avatar
Atlanta, GA
Joined Oct 2006
330 Posts
Quote:
Originally Posted by RCvertt View Post
Great, thanks.
I was just testing my one gram arduino and it looks like the sparkfun gyro, accel and LLC combo will save me another gram of weight compared to the cut down wii sensors.
You can save another gram if you disable internal Arduino pull-ups on A4 and A5 in the code, power gyro and accel from 3.3V, add pull-ups on the ITG3200 breakout, and connect them directly to Arduino.
Ask me how I know.
c2po is offline Find More Posts by c2po
Reply With Quote
Old May 30, 2011, 04:19 PM
Hamburger
hamburger's Avatar
Joined Jan 2010
860 Posts
Quote:
Originally Posted by Centurian View Post
As drawn, I doubt it will fly in a controlled manner, yaw will be almost uncontrollable causeing pitch & roll. Pitch & roll commands will cause yaw.. You'll be much better off with "normal" prop rotation, same rotation front & rear / side to side. If you need more yaw authority on the small motors, tilt them slightly.
if front+rear turn left and left+right spin right, then the 2 pairs need to produce even torque and therefore must be even sized? Or is a 6" + 10" combo still possible (maybe tilt the small left+right rotors as with tricopters)?
hamburger is offline Find More Posts by hamburger
Reply With Quote
Old May 30, 2011, 04:37 PM
MultiWiiHead
Centurian's Avatar
Corvallis OR
Joined Apr 2004
258 Posts
Quote:
Originally Posted by hamburger View Post
if front+rear turn left and left+right spin right, then the 2 pairs need to produce even torque and therefore must be even sized? Or is a 6" + 10" combo still possible (maybe tilt the small left+right rotors as with tricopters)?
You can just tilt the small motors a fixed amount as necessary to hover and it should fly OK. Start with the Yaw "I" term at 0 and trim it by tilting motors if necessary(might end up tilting the big motors). If you want to use sevo controlled tilt, I'd recomend tilting the large motors as they have more lever arm to control yaw.
Centurian is offline Find More Posts by Centurian
Reply With Quote
Old May 30, 2011, 05:17 PM
Sudden Freak
c2po's Avatar
Atlanta, GA
Joined Oct 2006
330 Posts
Quote:
Originally Posted by aadamson View Post
I followed the ball as Jussi put the FFIMU together and I picked up a couple recently... Here is a picture of one on a new pro mini shield that is available from the AQ store...
...
this shield would also run MWii, but I've not tried it.
...
Thanks Jussi for good stuff!
AeroQuad software is for sure a nice example of a very thorough and well thought approach to coding, a lot of people use it, and I myself learned a lot from it and used some pieces in my development, but... for example, a piece of code checking the battery voltage that is 9 (nine) kilobytes... please, I don't get it.
c2po is offline Find More Posts by c2po
Reply With Quote