Pages

vendredi 20 avril 2012

quelques sujets intéressant à explorer

http://diydrones.com/page/uav-devboard
http://diydrones.com/forum/topics/wind-estimation-without-an
http://www.diydrones.com/forum/topics/maximum-safe-servo-pwm-pulse

Yes, understanding IMU is complexe !

Just a post to talk a bit about my recent attempts to get into Arduino and more specifically in Ardupilot Mega.

I was hopping to find a pre-programmed pde file (the firmware you upload into your arduino board) that would  be ready out of the box.

Why ? because Ardupilot Mega v2 (APMv2) includes already all the electrical components that you had to buy separatly before with APMv1 (that is : a gyroscope, a GPS, accelerometer, magnometer). When you buy the ArduPilot Mega v2 hardware, everything is intgrated and you don't have to buy the complementary arduIMU board you had to buy before with APM v1.

I looked into the manual of APMv2, I found a test program (IMU test) that prints out values in the command line interpreter/shell of Arduino.

But then what ? I'm having a hard time to understand the block diagram that describes the whole chain starting from "getting values from the sensors" to "servo moving in such or such direction to compensate".


The compensation movement a sensor must make is dependant on the structure you're playing with. If you're playing with a multicopter, the compensation (variation of engines speed) will be different that if you're playing with an aircraft (motion compensation is produced by ailerons/rudder/pitch compensation, thus servo motion.

You have to imagine how complexe it is to program the variation of engines speed in order to maintain heading/altitude or in order to maintain stability.

Also, in an aircraft problem is a little easier, because the axis you want to compensate is well defined : yaw, pitch, roll

In my case, it's about the same : I have pitch and roll of the camera inside the basket, and yaw outside the basket


Anyway, at this point, I still need to understand how to route the values acquired by the DCM to servos, but I really have this crazy feeling that I'm trying to do stuff that is already programmed somewhere.

I will be writing a post specifically on my understanding of IMU problems



Some documentation
http://www.youtube.com/watch?v=bWDXsKlHvIs
http://www.youtube.com/watch?v=yAVCZstkORY&feature=related

A tutorial on kalman filter
http://www.youtube.com/watch?v=37ZoeVqouc8&feature=channel&list=UL
http://www.youtube.com/watch?v=8R0Ny1l1o1Q&feature=related

A description of DCM algorithm


A code understandable to create stabilization : http://ardupilot.googlecode.com/svn/trunk/Ardupilot_25/attitude.pde
http://ardupilot-kit.googlecode.com/svn-history/r9/trunk/ArduPilotSIM_2_6/attitude.pde

Compass test
http://code.google.com/p/ardupilot-mega/source/browse/libraries/AP_Compass/examples/AP_Compass_test/AP_Compass_test.pde?r=cefe1a07bc82c346bb5f99a7e1425de3a9298229


Some information about understanding how a servo is put into rotation :
http://arduino.cc/fr/Main/LibrairieServo


Here's a test about driving a servo into rotation :
http://api.ning.com/files/XwPN7URDsnkplTraVMr-7sjgFznrv7VhulKe60zoO95*kYBeXvrIoTiax7I8S-9lynBUKK940lFTo0Ghyw5HO6XsaelWJZqR/RCTest.pde


mardi 17 avril 2012

Using Ardupilot to answer the needs

Questions I am working on : 

* How do I change from a flight mode to another in ardupilot mega, if I plan on sending commands from my PC on the ground ?

* How do I define which channel is used for auto stabilization of tilt & roll ?

* How do I specify what kind of movement is required on the servo to stabilize my camera gimball ?

* How do I setup headlock and how do I define servo movement associated to Z axis ? (must support continuous rotation)

According to this article : http://code.google.com/p/arducopter/wiki/AC2_Camera, if I load a arducopter firmware,

By default, quad and hex mutlicopters have stabilization turned on. APM's Out 5 and Out 6 pins will drive tilt/roll servos to auto-stabilize a camera. Out 5 is pitch and Out 6 is roll.
The default is that you can also control the pitch of your camera (but not the roll) with your RC transmitter. 
You can reverse the direction of either servo in the Mission Planner by changing the MAVLink parameters for that channel  
According to the description of the arducopter main page (arducopter.com), it seems that all needed is available under the arducopter firmware :


ArduCopter Platform Feature List
    • 6 Degree of Freedom IMU stabilized control
    • Gyro stabilized flight mode enabling acrobatics (loops and barrel rolls)
    • GPS for position hold
    • Magnetometer for heading determination




  • What is a sketch file ? what is a PDE file ?
    • sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to and run on an Arduino board.
    • pde is the extension of a sketch file



  • How do I modify the behavior of arducopter ?
    • According to this tutorial, I have to modify the arducopteur.pde  file.


My first test :

I want to move my APM around the Z axis clockwise, and have a unique servo go counterclockwise, at the same angular speed.





Playing with Arduino (ardupilot mega v2)

After a while of thinking and preparing the electronic part, here I come again to write about our needs for AHRS : altitude and heading reference system

As explained before, the payload will be stabilized so that the images that we film do not suffer from turbulences.

We use an arduino plateforme named Ardupilot Mega (I bought the latest version APMv2), which comes with gyroscopes and magnometer, so that I am able to program the main heading, and so that the plateform maintain it's heading in gusty winds (usually causing the payload to spin around the axis of the parachute).





Need :


  • To manage different modes of heading and autonomous modes, pre programmed before launch and selectable by sending a remote command.
    • Mode 1 shoud consist in programming a fixed heading
    • Mode 2 shoud consist in programming an autonomous rotation of 45° heading every minute
    • Mode 3 shoud consist in programming an autonomous rotation of 45° heading every 15 secondes
    • Mode 4 shoud consist in programming a rotation of 180° heading
  • At any time, I should be able to change the heading using my transmitter (or by sending manually a value as a new heading)
  • The plateform should be gyrostabilized, meaning that if the wind generates an angular speed of 5°/seconde, the servo should apply a rotation of -5°/seconde. The only axis concerned is the Z axis.
  • The two other axis are stabilized only to compensate gusty wind meaning a relatively slow degree of motion (and no need of 360° rotation)
That's it

Now, I will be looking deeper into the manual of ardupilot mega in order to find out more about how to answer those needs. Next post is about that.