SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Jan 28, 2013, 04:37 PM
Registered User
United Kingdom, England, Bristol
Joined Aug 2010
48 Posts
Discussion
Scratch built PID controller for Quad - some questions/discussion

Hello,

I am part way through building a quad more or less completely from scratch. I am now at the point where I have played around with my own 'off the top of my head' approaches to stabilising the flight - most of which just seem to overcompensate so it just keeps rocking instead of levelling (I have the quad set up as a 'see-saw' at the moment with only two motors/props running and no vertical movement).

It's probably important to mention that the aim of this project is purely to get the quad to hover autonomously in the air with no external user input (so no Tx/Rx). So as simple as: I hold it in the air indoors, switch it on, let it go and hover for a minute, then grab it and switch it off. So I'm pretty sure it's crucial that I make use of an accelerometer AND a gyro - I believe a lot of FCs just use a gyro.

So now it's time to get down to business and write some PID code which I have already done (although it's only very simple code atm), but I'm not sure of how best to use the output of the PID controller.

So my question: how do regular, simple, accelerometer & gyro flight controllers use the output of their PID controllers?

(in terms of; does the value obtained get multiplied by the speed value for a particular motor? or does the speed value of the motor get incremented or decremented by the value obtained? or does the PID controller generate the next actual speed value for the motor? or something else!)

Sorry for the 'round about' way of asking the question!
If any clarification is needed please let me know.
Many thanks,
James
xxJaRxx is offline Find More Posts by xxJaRxx
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 28, 2013, 06:38 PM
Registered User
JBPiantanida's Avatar
United States, FL, Tampa
Joined Mar 2006
275 Posts
Quote:
Originally Posted by xxJaRxx View Post
Hello,

I am part way through building a quad more or less completely from scratch. I am now at the point where I have played around with my own 'off the top of my head' approaches to stabilising the flight - most of which just seem to overcompensate so it just keeps rocking instead of levelling (I have the quad set up as a 'see-saw' at the moment with only two motors/props running and no vertical movement).

It's probably important to mention that the aim of this project is purely to get the quad to hover autonomously in the air with no external user input (so no Tx/Rx). So as simple as: I hold it in the air indoors, switch it on, let it go and hover for a minute, then grab it and switch it off. So I'm pretty sure it's crucial that I make use of an accelerometer AND a gyro - I believe a lot of FCs just use a gyro.

So now it's time to get down to business and write some PID code which I have already done (although it's only very simple code atm), but I'm not sure of how best to use the output of the PID controller.

So my question: how do regular, simple, accelerometer & gyro flight controllers use the output of their PID controllers?

(in terms of; does the value obtained get multiplied by the speed value for a particular motor? or does the speed value of the motor get incremented or decremented by the value obtained? or does the PID controller generate the next actual speed value for the motor? or something else!)

Sorry for the 'round about' way of asking the question!
If any clarification is needed please let me know.
Many thanks,
James
I have been playing around with the same thing... along with dozens of others in the Parallax forums. They released a quad with a Hoverfly Open FC board and many people have built their own variation on the board VERY cheaply and have been working (with varying degrees of success) with different coding to get the most out of it.

Personally I have been using the additive/subtractive approach and gotten somewhat stable hovers. My platform is a bit different though so I have other problems to work out (I am using quad EDF units... the ones commonly used in R/C Jets). One poster named JasonDorie has had a lot of success with the PID algorithms on the standard quads. You may want to look there, if nothing else to see the code and pick apart how people are doing things.

It is all open source, so reverse engineering is encouraged, and if you read through the threads there is a lot of good discussion on PID technique.

Hope it helps! You may have to hunt for the threads. Some are in the Projects section and some in the Propeller section. The Propeller is the CPU used.

--- John
JBPiantanida is offline Find More Posts by JBPiantanida
Reply With Quote
Old Jan 29, 2013, 01:29 PM
Registered User
United Kingdom, England, Bristol
Joined Aug 2010
48 Posts
Thanks for the reply John, very useful!

Interesting that you're using the additive/subtractive approach too, I'll give that a try and see what sort of results I come up with.

I will also head over to the Parallax forums and have a read of whatever useful stuff I can find. If you have any useful threads bookmarked feel free to paste them here

James
xxJaRxx is offline Find More Posts by xxJaRxx
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question Electronic for scratch built justin_friedman Foamies (Scratchbuilt) 16 Jan 26, 2013 02:18 AM
Build Log scratch built hex with camera gimbal for aeriel video biggles uk Aerial Photography 0 Jan 20, 2013 11:24 AM
Question What kind of propellers for a PID controlled quad? kulve Multirotor Talk 7 Dec 22, 2011 11:10 AM
Discussion Scratch-built quad, question about headlock jmdhuse Multirotor Talk 4 Sep 08, 2011 01:17 PM
Discussion Scratch built DLG, questions and hopefully some answers :) Mike_Y Hand Launch 46 Jun 24, 2006 02:00 AM