Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Quad.Net Quadrocopter for .NETMF


  • Please log in to reply
119 replies to this topic

#41 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 January 2011 - 06:16 AM

Brandon, it's not fair to tease :) I'm looking forward to video! Chris

#42 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 25 January 2011 - 06:21 AM

youtube wasnt taking uploads and Luke went to bed, he says he has a stable hover take a look at source its a pretty simple control loop right now but it works

#43 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 25 January 2011 - 06:22 AM

im putting in my order for hardware tomorrow

#44 Luke Cummings

Luke Cummings

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationCalgary, AB

Posted 25 January 2011 - 03:53 PM

Well, not as good of new as I would hoped, watch around 1:20 for the best performance as of right now. Still not hovering for me but I think I'm having transmitter issues. Anyways as you can tell from the video I wont be flying again for a bit.
Cheap, Fast, Good... Pick two

#45 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 25 January 2011 - 03:57 PM

i thought we were a bit more stable, we still have some work to do then

#46 Luke Cummings

Luke Cummings

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationCalgary, AB

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.
Cheap, Fast, Good... Pick two

#47 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 27 January 2011 - 06:34 AM

I think you need to tone your control loop adjustments or your stick inputs down. It looks like it's doing too much and can't correct fast enough.

#48 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 06:38 AM

Or your control loop is slipping. You may also want to try and configure dual rates and expo on your TX.

#49 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 27 January 2011 - 06:42 AM

well we're dealing with some hardware issues but have just put in an rx scale to tone it down, basically a parabola on the stick control

#50 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 27 January 2011 - 06:47 AM

we think its tx, everything else looks good in code now we just need to cool the rx down, chris take a look at the scale PID and RX, we're cleaning it up now

#51 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 27 January 2011 - 06:49 AM

Chris, what do you mean by dual rates and expo on TX, we are trying to compensate for some odd things in tx right now, is there a concept we're missing

#52 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 27 January 2011 - 06:55 AM

understand it now, we just compensated in code rather than on tx, that will allow any tx to connect and we should be able to calibrate for it

#53 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 07:24 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.

#54 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 27 January 2011 - 07:33 AM

Have you flown an R/C plane or helicopter before? A common thing for beginner pilots is to give full stick corrections when only 1/10th of a stick movement is required, this leads to wild oscillating flight like you are seeing, the same as a control loop that is correcting too much at a time. Can you take off just by using throttle? If you can't, you have some trim issues which need to be corrected before anything else. You should be able to throttle up for takeoff, and hover with the flight computer keeping it still and level. Once you can do this, introduce small movements in one direction, then return to a hover. This is how beginner helicopter pilots are taught - as it saves the wild movements of going too far too fast. You may also want to consider the room you are using - make sure you don't have objects that will return the down draft to the quad creating turbulence or winds which can disturb the flight artificially.

#55 Luke Cummings

Luke Cummings

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationCalgary, AB

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
Cheap, Fast, Good... Pick two

#56 Brandon G

Brandon G

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationVancouver BC, Canada

Posted 27 January 2011 - 08:10 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);
        }
    }
}


#57 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

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 :) I know you are just being funny, but I want to make sure that Chris Seto feels welcome here too...

Chris

#58 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

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 Luke Cummings

Luke Cummings

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationCalgary, AB

Posted 27 January 2011 - 07:08 PM

While we are on the issue, I was thinking it might be nice to have a cheat sheet with major .Net features, and the performance hits involved. One this that has stood out to me is that the ms code rarely uses properties, relying on public variables instead. It would be nice to develop our own "Best Practices" especially as it relates to pseudo real-time code. One of the major things I seen thrown around a lot is this concept that you can never know how long .Net is going to take to execute any given line. I think with enough understanding we should be able to quantify every line. This is especially important to the success of this project. Just to keep you guys in the loop, I had a major hardware failure (blew out the bearing on a motor) that has stopped me for the moment from trying to fly again. I have every reason to believe that it could have actually flow. I think the only thing that was stopping me from doing so was what Seto and Mark both identified. Seto if you do have a quad that you would be willing to try on .net and an extra MCU I could provide you with the tools to get running on my platform. For that matter if anyone else out there is interested let me know and I will put together an architecture of how it works. That being said I did put in an order for replacement parts this morning, so hopefully i will be back up soon.
Cheap, Fast, Good... Pick two

#60 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 07:12 PM

I have a quadcopter and a uC but it's taking forever for hobbyking to get my motors and ESCs out. I'm grounded till those come. They have been on order for a month now #%#@$%$#@%#$.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.