Posts tonen met het label 9dof. Alle posts tonen
Posts tonen met het label 9dof. Alle posts tonen

vrijdag 15 februari 2013

Arducopter on the bench!

Finaly I got most components working for this project. The arducopter firmware is ported to my seeeduino mega board and is connect to all my other exothic hardware. Now I'm ready to go for some PID tuning on the testbench.

In the movie you can see the these components
- Seeeduino mega 1280 (loaded with arducopter firmware version 2.5.3, with my personal changes)
- Razor 9dof imu (loaded with my own firmware, raw sensor data output)
- Lantronix B/G wifi module
- voltage regulation board to power the wifi module.

The gps is not mounted because I have no signal inside. I currently have only 2 ESC available. These 2 are my spare parts, the other one's are mounted on my Mini-H-Quad. So currently I'm only driving 2 motors. In the video you will see some basics tests, PID tuning will be for next time.



dinsdag 24 juli 2012

First flight

My project is progressing very slowly. But here it is. Proof of concept. My multicopter can fly.


As you can see, it still needs some PID tuning. And I really need to learn how to fly and land this thing. I got the impression that there is some latency on my control input/uplink. The copter responds to my controls but I feel that I don't really have it under control.

Equipment quadcopter:
- Alu Quad + frame 60cm square tube 15x15x1.5mm (~ 53cm from motor center to oposit motor center)
- 4 x Motors AX-2210N 1000kv from hobbyking
- 4 x EPP 1045 props from lipoly (2xcw &  2xccw)
- 4 x Blueseries ECS 12 amp from hobbyking
- 4 x homemade vibration reduction motor mount (see previous blog)
- Seeeduino Mega v1.1 board (arduino compatible)
- Razor 9DOF IMU from sparkfun
- LantroniX Matchport wifi module
- Turnigy 3000mAh 3S 20C Lipo Pack from hobbyking 

total weight: ~ 1200 grams

Equipment groundstation:
- wifi router
- laptop
- usb gamepad


The Seeeduino Mega board has my own custom code (written in arduino).  Ok, I did not reinvent fire. I read a lot on the internet. I took the basics and made my own program that controls the quad. The 9DOF imu is equiped with a modified version of the AHRS firmware. Note that it is not the version I upload in one of my previous blogposts. The version I currently use will be uploaded later.

The lantronix B/G wifi module translates wireless ip based UDP/TCP packets to serial uart. I can send commands from my laptop via UDP to the quad copter. The usb gamepad is used to control/fly the quadcopter. The copter sends its data from sensors/batt status/motorspeed/... via the wifi module in realtime back to my laptop. The program on the laptop that controls all this is written in VB.Net (2003)

dinsdag 3 april 2012

Vibration troubles

Indeed, the Razor 9DOF imu is really sensitive to vibrations. Motor vibrations cause that much noise on the sensors that this board really can't be used in a multicopter. But you can fix this with some tips & tricks.

I really have tested everything to reduce vibrations. Nylon spacers/srews, foam, rubbers, rubber band,... just everything you can imagine. The only thing that really helps to reduce vibration noise is to make a motor mount that is completely saperated from the frame by some rubbers. I will give more details on this in my next blog.


With homemade motormount I was able to
- reduce GYRO noise to 1%
- reduce ACC noise with 90%




I noticed that the MAG on this IMU board is sensitive to EMF caused by motors and/or current. When motors spin up the data on the MAG shifts up or down. I'll investigate this later and try to find a fix for this problem. So Currently I can't use the DCM algoritme. But using GYRO and ACC raw data should be enough to get my quadcopter stable.


I also noticed that increasing the ACC update rate increases the noise on the raw data. I currently update my ACC at 12hz to get a good result.
But by using the GYRO (100hz) data and ACC (12hz) data in one formula I still have an output rate at 100hz!

donderdag 2 februari 2012

IMU Source Code

Finaly I have the time to post my current Razor 9DOF IMU 100hz firmeware source code.

Some things you will have to do and also keep in mind before uploading my code to your own IMU:
  • use only on the same IMU hardware version or make sure it's compatible to mine.
  • use only at your own risc! :)
  • make sure your arduino i2c works @ 400kbps. Check this howto. (find twi.h change speed)
  • I compiled my sketch with arduino v0.22. Other arduino versions migth give errors while compiling and/or will give less performance (fps).
  • after uploading my firmeware to the IMU you can't read the output with arduino serial monitor. So you will have to test the output with another arduino board or a pc application that can handle 250kbps serial communication.
  • I have changed the output function to get beter performance to my own needs. Output is DCM Euler angles and Raw Gyro data. Currently in my PID calculations I use DCM euler angles in my P term and use de raw gyro data in my D term.
  • Notice that my output is euler_angle*100. When using this value you will first need to divide it by 100. Also consider that maybe you will have to inverse some of my values in your own application.


If you would first like to test my firmware with the arduino serial monitor, you just have to change the serial baud rate to 115200. Then you can read the output string with the arduino serial monitor. Notice that you will not have 100hz (fps) when using the serial on 115kbps.

download the firmware: SF9DOF_AHRS_WIPO.zip

donderdag 12 januari 2012

IMU 100hz Firmware

I finally got my Razor 9D0F IMU running at 100hz. The problem with the 8mhz atmega328p is that DCM calculations take more than 5ms. Knowing that 1 loop cycle can max be 10ms to get a 100hz output it's very hard to get all other things done withing this time. DCM code itself is to much math for me so I'm only able to tune output/input speeds.


The original Razor 9Dof AHRS firmware has a main loop running at 50hz. This main loop contains an subloop running at 10hz for compas readings. All i2c data is read at 100000bps and uart output is at 57600bps. So every 20ms this board pushes an update over the serial.




My own new AHRS firmware  has a main loop running at 100hz. So every 10ms my firmware pushes an update over the serial. To achieve the 100hz rate all i2c data comunication is at 400000bps and uart output is at 250000bps! I also tuned the serial output code. The original AHRS output code is simple arduino style, but it is really slow that way. Main loop runs at 100hz and my subloop runs at 50hz. My firmware has a faster update rate and should also be more accurate.

zondag 27 november 2011

IMU firmware

Today I managed to upload the AHRS firmeware to the Razor 9DOF IMU. To achieve this you need to download the arduino platform software and of course the new firmeware (see link in previeous post). You also need to connect the 9dof IMU to the pc via a usb to serial uart (FTDI) converter.

The converter I use is this one: http://www2.conrad.be/goto.php?artikel=197326. This converter can operate in 3.3v or 5v TTL signal. The razor 9DOF IMU uses a 3.3v signal on the TX and RX pin. To power the IMU board you can connect the vbus pin from this converter to the external powerconnector on the razor imu board. So no need for an external power supply because all boards will be powered by the usb connection (max 100ma for this ftdi board). 

More info about uploading the new firmeware to the 9DOF IMU can be found on this step by step tutorial: razor firmaware upload

zaterdag 26 november 2011

Inertial measurement unit (IMU)

To get my quadrocopter stabelized I use the Razor 9 Degrees of Freedom inertial measurement unit. This 9DOF IMU is AHRS (Attitude and heading reference system) compatible. More info about this imu: Razor 9DOF

My first test with this board learned me that the data from the original firmeware is very sensitive for external noise.

A quadrocopter has 4 motors. And that is a lot of vibrations. The original firmeware for this board sends raw data comming from the sensors. When my motors are on > 60% power, this raw data can't be used and the need for a good software filter (algoritme) is essential.

The new AHRS firmeware for this board uses the DCM (Direction Cosine Matrix) algoritme. This should reduce error (noise) in data and eliminate drift. Test result for new firmeware will be posted in next blog. The AHRS firmeware can be downloaded here: Razor 9DOF IMU AHRS code