Jul 30, 2012, 04:37 AM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by careyer Hi TS00, thank you so much.. Moving AUX2 from D8 to D12 is no problem - also activating the Voltage monitoring in the code is a piece of cake. Though my skills in electronics are so bad... Could you please draw a sketch (cuircuit diagram) on how to build this potential divider? Thank you so much! Best regards careyer Update: Okay Wikipedia helps a bit here =). I know now how to build this potential divider... I'm just curious why one has to devide the volate to 4,95V and 7,65V .... isn't there a way to do that without dividing .. like with a single resistor or something like that?

A potential divider is the simplest way to provide a 0-5V input to the microcontroller. It's just a couple of resistors. Here's a diagram:

 Jul 30, 2012, 05:08 AM member of TheBlindHawks Joined Feb 2011 185 Posts Thank you very much TS00... but I guess you have mixed up the order of the two Resistors =) I guess R1 must be 33k and R2 = 51k... otherwise Pin A3 would get 7,6 instead of the 4,9 Volts, right`?
Jul 30, 2012, 05:12 AM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by careyer Thank you very much TS00... but I guess you have mixed up the order of the two Resistors =) I guess R1 must be 33k and R2 = 51k... otherwise Pin A3 would get 7,6 instead of the 4,9 Volts, right`?
No, they're right :-) The voltage is between the middle wire and ground (you have to connect the ground to battery ground, which will also be connected to your multiwii ground via your BEC).

With a potential divider, you get the higher voltage across the higher resistor. So in this case, you get ~5v across the 33k, and ~7v across the 51k.

Does that make sense?
 Jul 30, 2012, 06:39 AM member of TheBlindHawks Joined Feb 2011 185 Posts Does that mean i want to have those 7V go to the Crius Board? I thought i'd want to have the 5V go there...
Jul 30, 2012, 06:41 AM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by careyer Does that mean i want to have those 7V go to the Crius Board? I thought i'd want to have the 5V go there...
You want the 5v going to the board. Just make the potential divider, and put a voltmeter on it, you'll see what I mean :-)
 Jul 30, 2012, 06:43 AM member of TheBlindHawks Joined Feb 2011 185 Posts O.K.! I trust you =) Thank you very much for your help... will try this tomorrow when I've got the right resistors and report back.
Jul 30, 2012, 06:49 AM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by careyer O.K.! I trust you =) Thank you very much for your help... will try this tomorrow when I've got the right resistors and report back.
Most welcome. Don't forget, you're measuring the voltage between the centre point (where the two resistors join) and ground.
 Jul 30, 2012, 09:41 AM Registered User Joined Apr 2012 9 Posts careyer. pls. be very careful with that. it could damage your atmega328 pin if not properly connected. do not get confused. just follow TS00's instruction.
Jul 30, 2012, 05:46 PM
Registered User
Joined Jul 2011
280 Posts
Quote:
 Originally Posted by TS00 If you want to use the buzzer, you're going to have to move AUX2 to pin12 instead of pin8. This is in config.h, look for #define RCAUXPIN12. You then connect your buzzer to pin8....
Do you connect the buzzer accross pin8 and ground? or pin8 and V+? ie, when buzzer is active, does pin8 go high or does it go low?
Jul 30, 2012, 05:51 PM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by Candu1 Do you connect the buzzer accross pin8 and ground? or pin8 and V+? ie, when buzzer is active, does pin8 go high or does it go low?
Between pin8 and ground. When active pin8 goes to 5v. The buzzer needs to be a buzzer, not just a piezo transducer.
Jul 30, 2012, 06:23 PM
Registered User
Joined Jul 2011
280 Posts
Quote:
 Originally Posted by TS00 Between pin8 and ground. When active pin8 goes to 5v. The buzzer needs to be a buzzer, not just a piezo transducer.
Got it. Thanks for lightning fast response!
Jul 31, 2012, 02:33 PM
Registered User
Joined Jun 2012
17 Posts
Quote:
 Originally Posted by TS00 You have quite high P and D. This will result in a more stable machine, unless they are two high, in which case you'll start seeing oscillations. The best way to PID tune a machine is to fly it on a still day, and see how it behaves. Post your findings, and a video if you can, and we can advise on where to go from there.
Hi TS00,
you was right, looks like my PID settings is too high - i'm getting oscillations.
 Hexacopter Oscillation (0 min 38 sec)

It's GLB650 Hex-Rotor HexCopter 650 mm
Weight with battery: 49.5 ounces (1400 grams or 1.4 kg)
Motors: XXD 2212 1000kv brushless motor
Props are: GEMFAN Carbon Nylon 10x4.5

My current PID settings on the attached picture.
Can you give me advice what settings should i tweak to get more stable flight?
(i don't need aerobatics at the moment, i look for beginners pilot stability)

# Images

Last edited by Vadique; Jul 31, 2012 at 02:40 PM.
Jul 31, 2012, 02:43 PM
Ape-pilot Extraordinaire
Joined Jun 2011
1,508 Posts
Quote:
 Originally Posted by Vadique Hi TS00, you was right, looks like my PID settings is too high - i'm getting oscillations. (please see the video bellow) http://www.youtube.com/watch?v=f9k_7O_RrTU It's GLB650 Hex-Rotor HexCopter 650 mm Weight: 49.5 ounces (1400 grams or 1.4 kg) Motors: XXD 2212 1000kv brushless motor Props are: GEMFAN Carbon Nylon 10x4.5 My current PID settings on the attached picture. Can you give me advice what settings should i tweak to get more stable flight? (i don't need aerobatics at the moment, i look for beginners pilot stability)
Ok, I don't think it's that far off.

First, drop Level P to 3. Otherwise you're trying to tune out two sets of wobbles, acc wobbles and gyro wobbles.

Now start reducing Pitch P and Roll P (together, keeping them the same as each other) by 1 point at a time, until that oscillation disappears.

You can leave I and D alone for now.

Jul 31, 2012, 03:03 PM
Registered User
Joined Jun 2012
17 Posts
Quote:
 Originally Posted by TS00 Now start reducing Pitch P and Roll P (together, keeping them the same as each other) by 1 point at a time, until that oscillation disappears.
Thank you for lightning fast reply!

By reducing Pitch P and Roll P by 1 point at a time you mean:
to go from 8.1 to 7.1 and to 6.1 etc?
or
to go from 8.1 to 8.0 and to 7.9 etc?
Jul 31, 2012, 03:11 PM
Ape-pilot Extraordinaire