Ardu-IMU-Pilot firmware ready for beta test!

I have completed ground testing on the new firmware I have written for ArduPilot to use ArduIMU in place of the thermopiles. It has been snowing here and I probably won't get to fly the code for a bit, but figured others might be interested in giving it a try at this point. This firmware will probably exist on a temporary basis, with the code getting incorporated into the regular ArduPilot firmware in the future. If there is sufficient interest in this approach I will consider working on a ArduPilot shield board that would add the pressure sensors to ArduIMU and package it all as a shield.

I will maintain the code for a while in a repository at http://code.google.com/p/ardu-imu-pilot/

If you try it out give me your feedback. It is similar to ArduPilot 2.4 but uses a different header file.

To interface ArduIMU to ArduPilot you connect the gps (ublox only) to ArduIMU, provide common power and ground to ArduPilot and ArduIMU, and connect the serial output pin of ArduIMU to the serial input pin of ArduPilot.

Views: 405

Tags: ArduIMU, ArduPilot, Code>/source/browse/#svn/trunk

Comments are closed for this blog post

Comment by Benjamin Lanehart on December 8, 2009 at 12:57pm
@Mark

Are you getting the "Last_error" error that I am getting?

Developer
Comment by Mark Colwell on December 8, 2009 at 1:18pm
No errors, 13400 bytes, and just loaded to both ATm168 (900 bytes free) & ATm328 ArduPilots now to build a wiring harness & load IMUv1 with code.
Comment by Benjamin Lanehart on December 8, 2009 at 1:36pm
Hmmm, I wonder what is going on then... Here's a pic of what I'm seeing.
error pic
Comment by Benjamin Lanehart on December 8, 2009 at 1:45pm
It's gotta be something simple that I am overlooking. I'm by no means a proficient programmer at all, just dabbing here and there.

I can say, in the ArduIMUPILOT tab/file(underlined):

/***************************************************************************
General variables
**************************************************************************/

const float kp[]={head_P,roll_P,airspeed_P,altitude_P}
,ki[]={head_I,roll_I,airspeed_I,altitude_I}
,kd[]={head_D,roll_D,airspeed_D,altitude_D}; //PID gains

const float Integrator_max[]={head_Integrator_max,roll_Integrator_max,airspeed_Integrator_max,altitude_Integrator_max};

float Integrator[]={0,0,0,0,0}; //PID Integrators
int Last_error[]={0,0,0,0,0}; //PID last error for derivative


The Last_error array is initialized, it has 5 values...

In the AIP_Control tab/file, the PID calculation looks for the Last_error[PID_case] value?

/*****************************************
* Proportional Integrator Derivative Control
*****************************************/

int PID(int PID_error, int dt, int PID_case)
{

int output;
float derivative=float(float(PID_error)-float(Last_error[PID_case])/dt);

Developer
Comment by Doug Weibel on December 8, 2009 at 2:37pm
@benjamin - I'm going to take a stab here and say it has something to do with the way you renamed the files. I believe Arduino wants the main file to be named the same name as the folder containing it. Thereby it knows that stuff in that file (where the declaration of Last_error[] is) is global. Rename the main file and the folder containing it the same name, and when you specify the sketchbook, use the main file and not some other, and see if that solves the problem.
Comment by Benjamin Lanehart on December 8, 2009 at 3:01pm
@Doug, yep it works now. It must have been that extra tab in the IDE... My bad... Photobucket
Comment by Patrick Mccabe on December 8, 2009 at 3:13pm
@benjamin, doing any ground test soon? maybe a flight ;)
Comment by Patrick Mccabe on December 8, 2009 at 3:14pm
so the code will only support the ublox, is that correct? also is it still using the airspeed sensor?
Comment by Benjamin Lanehart on December 8, 2009 at 3:25pm
@Patrick,

My ardupilot is home in Michigan, and I'm in Washington for work, where I have both IMU's, and my Superstar EP w/ailerons in my hotel room. lol I'm kinda screwed either way you look at it(for the moment, thank you shipping companies). I'll be home this week getting things together for testing over Christmas vacation, as long as my Shield V2 arrives with some time to spare. For ground testing I'll be using my DX7, probably going to setup a 3 position switch on the Ardupilot so I can switch between receiver power, and straight battery power, & I have some Hitec HS-55's laying around. When it comes to a flight test, I think I'm going to shelve the Superstar, and get an Easy Star... I'd say a month or so and I'll see if I can get it up in the air.

Developer
Comment by Doug Weibel on December 8, 2009 at 4:10pm
I am ready to fly as soon as the weather permits.... It snowed Monday, Tuesday, and today. Supposed to be cold Thursday and Friday. The snow may start melting Saturday... I'm starting to consider trying to hand launch my SuperStar - LOL

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service