Surprising but true - no blue screen of death and it didn't do a spiral of death into the rolling hills of Hertfordshire.
Hardware:
Netduin Mini - Code in C#
DiyDrones Mux
ArduImu v2
No fancy pid loops just some ugly code and lots of hot glue.
Since it worked well enough at bringing it all back to level flight i will try some way point fluff next.
Did i mention how ugly it was:
private static void Stabalize()
{
bool pitchUp = _pitch > 0;
bool rollRight = _roll > 0;
_elevatorServo.Degree = pitchUp ? 90 + ServoAngle(_pitch, 0) : 90 - ServoAngle(_pitch, 0);
_aileronServo.Degree = rollRight ? 90 + ServoAngle(_roll, 0) : 90 - ServoAngle(_roll, 0);
}
private static Int16 ServoAngle(double currentAngle, double desiredAngle)
{
double error = Abs(Abs(desiredAngle) - Abs(currentAngle)); if (error < 1) return 0;
if (error < 2) return 5;
if (error < 5) return 10;
if (error < 10) return 30;
if (error < 20) return 50;
if (error < 30) return 70;
return 90;
}
Justin
Comment by Roman Krashanitsa on April 15, 2011 at 6:10pm Very nice and clean spartan setup! :)
So what happens if desiredAngle=+45 and currentAngle=-45 ?
Comment by Justin Wilson on April 15, 2011 at 11:19pm
Comment by Hyon Lim on April 20, 2011 at 9:36pm
Comment by Justin Wilson on April 21, 2011 at 12:46am
Comment by Ritchie on April 21, 2011 at 2:00am
Comment by Justin Wilson on April 21, 2011 at 2:07am
Comment by Ritchie on April 21, 2011 at 4:29am
Comment by Justin Wilson on April 21, 2011 at 4:34am Comment
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.1282 members
115 members
183 members
87 members
673 members
© 2013 Created by Chris Anderson.
Powered by

You need to be a member of DIY Drones to add comments!
Join DIY Drones