Jump to content

  • Log In with Google      Sign In   
  • Create Account


shadowisadog

Member Since 16 Jun 2005
Online Last Active Today, 02:27 PM

Topics I've Started

Quadrotor Simulation Stabalization

03 May 2011 - 10:58 PM

Hello everyone! I have a math and physics problem that I could use some help with. I am currently working on a simulation of a Quadrotor helicopter using VPython and PyODE. The simulation consists of four motors connected at the ends of a plus sign. I can make the quadrotor rise into the air by increasing the speed of the motor rotations. The force generated by each motor is determined by the speed of the motor multiplied by a "motor constant".

The problem is that the quadrotor can become unstable. I need to maintain a level flying platform... The inputs to the system consist of four motor speeds and when the force generated by all four motors is greater then the downward gravitational force then we achieve flight. I can get a rotational matrix from ODE and VPython gives me the up axis..

I have investigated using PID control but I am unsure as to how to tune the various parameters and what to do with the output that such a routine would give. I tried a routine myself that consisted of simply comparing the Y coordinates and adjusting the motor speeds that way but this proved too unstable (Yes I know that technically this method was cheating as I used more knowledge of the system then I have given here...).

Screenshot of my system:

Posted Image


Any thoughts? I have had some thoughts involving taking the up axis of the main "body" of the quadrotor and taking a dot product with the desired up vector... and then what to do from there is sort of eluding me...

Here is a PID control pseduocode I adapted from wikipedia articles to prove that I am clueless:

Ku = 1
Tu = 2

Kp = 0.33*Ku
Ki = (2*Kp) / Tu
Kd = (Kp*Tu) / 3

previous_error = target - actual
integral = 0 

start:
        error = target - actual
        integral += error * dt
        derivative = (error - previous_error) /dt 
        output = (Kp * error) + (Ki * integral) + (Kd * derivative)
        previous_error = error

*Implements PID in Ideal Parallel Form from : http://en.wikipedia..../PID_controller

*Also implements the Ziegler–Nichols method for tuning: http://en.wikipedia....3Nichols_method using overshoot parameters.

P.S. : The entire code is open source and under a GNU GPL v3 license ... I am still actively developing the code... so it probably looks terrible (sorry about that!) but hopefully it will help others! here is a link: quadrotor simulation source

Shady (2D HLSL) Editor: Donald's Branch

23 August 2009 - 04:39 PM

The following is a post from the Ziggyware site that I just made. I am posting it here because not everyone reads Ziggyware and I want to make sure that anyone who wants this editor knows where to find it ;) : Hello everyone, I decided to put my time were my comments were on the Shady HLSL editor and create a revised version of it. This version has been developed for XNA 3.1. It includes the following: A) The ability to disable that annoying heart rate thing. B) The ability to stretch an image. C) The ability to turn off auto refreshing and refresh manually. D) Improved error checking and less crashing (I HOPE!) Here is the link: ShadyDonaldBranchRelease.zip Everything should be pretty self explanatory and all that except for the fact that you can now left click the view (the image) to make the image refresh. This is real handy if you disable the auto updating. Feel free to share any awesome HLSL pixel shaders you create, and I hope you enjoy! Thanks for reading :) . [Edited by - shadowisadog on August 23, 2009 11:49:14 PM]

Eclipse- Opening dos console instead of console tab?

27 June 2009 - 05:00 AM

Hey everyone. I am trying to play around with Python development using Eclipse and PyDev. I really like it a lot better then the IDLE IDE (Which is ok but there is absolutely no code completion), but I do have one nagging problem and that is that I would really like a traditional console to appear instead of the console tab when I run my applications. Is there a setting, plugin, or command-line argument to get this console to appear? My main annoyance with the console tab is that it is not automatically given focus when I run the app which is slightly annoying. Any ideas? Thank you for the help!

Blender 2.49 Projection painting without UV unwrap?

01 June 2009 - 04:02 PM

Hey everyone. I am fairly new to Blender and I was reading about how Blender version 2.49 supports projection texture painting without the need for Seams or for UV unwrap but I can not seem to make this work. Is there some trick to this? I make a new blender project and I go to "Texture Paint" mode but when I try to draw with a brush nothing happens. Project paint is selected so I am not sure what I need to do. If I do a UV unwrap and make a new image it works, but is this really necessary? If there was a way to skip UV unwrapping all together that would be great. Any help would be appreciated. Thanks.

Just to share, how to use XNA content in Silverlight

22 April 2009 - 05:51 AM

Hey everyone. I have used XNA for a long time but I have up until now not really played with the possibility of using XNA in a web application. I have been playing with it and I thought I would start a thread and post some of the steps I have done thus far so that if other people wanted to know how to do such a thing they will know :) . To use Silverlight without paying any money you will need to get Visual Web Developer 2008 Express You will also need the Silverlight tools: Silverlight 2 tools Once that is all setup you will need to download a third party library that has wrapped the XNA functionality for use in Silverlight. I have found SilverSprite although I am aware that others exist. SilverSprite can be downloaded from: SilverSprite Once you have that downloaded you make a new project in Visual Web Developer Express. Add the SilverArcade.SilverLight dll as a reference to your project (Not the web project, the one with App.xaml, and Page.xaml). I was then able to follow the instructions on the Silverlight homepage. You need to add all your code to the project (I made a new folder called XNA code) and replace all references to Microsoft.Xna.Framework with SilverArcade.SilverSprite. This is made much easier if you use the handy "Replace in Files" option (Ctrl+Shift+H). One thing that the homepage for SilverSprite does not mention is when adding your xnb files to your project make sure to put them in a folder called "Content". Otherwise the files will not be found. Here is an example of all of this put together: Chaser Web Demo Arrow keys move the player, mouse click makes a new enemy. Get close to the enemy the and the enemy will chase you. If you got any questions feel free to ask. Just thought I would share with you folks :) .

PARTNERS