

Quad.Net Quadrocopter for .NETMF
#41
Posted 25 January 2011 - 06:16 AM

#42
Posted 25 January 2011 - 06:21 AM
#43
Posted 25 January 2011 - 06:22 AM
#44
Posted 25 January 2011 - 03:53 PM
#45
Posted 25 January 2011 - 03:57 PM
#46
Posted 25 January 2011 - 05:00 PM
i thought we were a bit more stable, we still have some work to do then
I add much more success last night, I've had a few hard crashes so I need to spend some time on the hardware.
#47
Posted 27 January 2011 - 06:34 AM
#48
Posted 27 January 2011 - 06:38 AM
#49
Posted 27 January 2011 - 06:42 AM
#50
Posted 27 January 2011 - 06:47 AM
#51
Posted 27 January 2011 - 06:49 AM
#52
Posted 27 January 2011 - 06:55 AM
#53
Posted 27 January 2011 - 07:24 AM
#54
Posted 27 January 2011 - 07:33 AM
#55
Posted 27 January 2011 - 07:57 AM
Brandon, you may want to avoid making multiple posts in a row. It makes it very difficult to read the thread.
As for DR&Expo, if you have a computer radio, you can program that in.
I recommend you get a computer radio so you can switch back and forth between multiple DR&Expo settings. I use gentle settings for departure and tighter settings for cruising.
Chris, you may want to avoid being a dbag too many times in a row. It makes it very difficult to read the thread.
- Mattster likes this
#56
Posted 27 January 2011 - 08:10 AM
Chris thank you for the forum etiquette reminder. The posts were fast given we we had discovered the algo at the exact same time i replied and implemented it in code, i've attached our algo. i think you might be on to something as far as making it a scaling variable that can change as the flight conditions change.
using System; namespace Quad.Net.Commons.Utilities { public class Scale { private readonly double[] _coefficients; private readonly double _offset; public Scale(double offset, params double[] coefficients) { _coefficients = coefficients; _offset = offset; } public double Calculate(double value) { double output = 0; for (int i = 0; i < _coefficients.Length; i++) { output += Math.Pow(value + _offset, i) * _coefficients[_coefficients.Length - i - 1]; } return output; } } } namespace Quad.Net.Tests { [TestFixture] public class ScaleTests { [Test] public void TestQuadratics() { Scale scale = new Scale(-1500, 0.0000008, 0, 0, 0); Assert.AreEqual(scale.Calculate(1000),-100); } } }
#57
Posted 27 January 2011 - 08:51 AM
Chris, you may want to avoid being a dbag too many times in a row. It makes it very difficult to read the thread.
Hey Luke... Clever, but let's all be polite

Chris
#58
Posted 27 January 2011 - 09:16 AM
Thanks Mark that makes sense, we need to just concentrate on throttle and throttle alone.
Chris thank you for the forum etiquette reminder. The posts were fast given we we had discovered the algo at the exact same time i replied and implemented it in code, i've attached our algo. i think you might be on to something as far as making it a scaling variable that can change as the flight conditions change.
using System; namespace Quad.Net.Commons.Utilities { public class Scale { private readonly double[] _coefficients; private readonly double _offset; public Scale(double offset, params double[] coefficients) { _coefficients = coefficients; _offset = offset; } public double Calculate(double value) { double output = 0; for (int i = 0; i < _coefficients.Length; i++) { output += Math.Pow(value + _offset, i) * _coefficients[_coefficients.Length - i - 1]; } return output; } } } namespace Quad.Net.Tests { [TestFixture] public class ScaleTests { [Test] public void TestQuadratics() { Scale scale = new Scale(-1500, 0.0000008, 0, 0, 0); Assert.AreEqual(scale.Calculate(1000),-100); } } }
Move your _coefficients.Length statement to it's own local variable, before you loop and then reference that. It's much faster in netMF than referencing the property.
Also, underscores are against most best practices for .Net

#59
Posted 27 January 2011 - 07:08 PM
#60
Posted 27 January 2011 - 07:12 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users