Page 1 of 2

source code for revised RTOS pilot - v 0.51

PostPosted: Thu Dec 23, 2010 12:37 am
by TheBoD
Tom, do you have the source code for the revised version of the RTOS pilot project that you uploaded in mid-November to apply a fix with reading servo values.

The hex file I am referring to was compiled on Nov 10th and is 229KBin size . I would like to move to the quadrocopter version of the file and I want to make the appropriate source code changes. When I use the RTOS hex file with the quadrocopter setting in the project folder it works fine except I have been unable to make the switch in the source to delete ahrs_kalman_3x2.c file and add ahrs_simple_quaternion.c in MpLab so I get no pitch and roll response on the bench test.

Hoping to get the first part my quadrocopter built over the New Year break but I would like to do some early bench testing of the control system first.

Many thanks.

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Thu Dec 23, 2010 12:18 pm
by Tom
It's on the google code SVN server.
Tomorrow my christmas vacation starts, and I'll put a new .zip file with the latest code online :-)

Why can't you swap ahrs_kalman with ahrs_quaternion? Do you use MpLab?

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Thu Dec 23, 2010 8:59 pm
by TheBoD
Tom, thanks for the feedback. I will wait for the zip files. I do use MPLAB but when I imported the new file you put out in mid November I only picked up the hex file and so could not see any source code.

Thanks again.

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Tue Dec 28, 2010 11:37 am
by Tom
Sorry for the delay.

The latest development source code can be found here: http://code.google.com/p/gluonpilot/downloads/list

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Tue Dec 28, 2010 3:09 pm
by Tom
Some debug output was still present. I replaced the file with a better version.

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Sun Jan 02, 2011 4:39 am
by TheBoD
Tom, thanks for the latest posting.

I have been doing some initial testing work for the quadrocopter. I have four servos connected to the outputs 1 - 4 in order to test what I should see as the controls are operated. In Manual mode the 4 servos respond OK in line with the throttle adjustments with small changes when I move the elevator, aileron or rudder sticks. When I switch to stabilised mode and move the Gluonpilot board around , to simulate the quadrocopter moving, I can see the pitch and roll horizon moving on the display tab but I don't see any corresponding movement in any of the servos to simulate the motors adjusting their speed to correct to hold the attitude stable.

I know I am in the quadrocopter mode as I have set up an output message in the control initialization code to confirm this. I have max / min pitch settings as 25 degrees but I am not sure what other settings I should have as the initial setup. Would appreciate any suggestions ? My initial bench tests will be with two motors mounted on a see-saw arrangement to confirm the control scheme is working.

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Sun Jan 02, 2011 11:19 am
by Tom
Did you enter some "P"-pid values in the gluonconfig?

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Sun Jan 02, 2011 12:48 pm
by TheBoD
Tom, thanks for your note. I did not realize I needed to enter 'P" values - would these be in the gluonconfig.c file and if so how do I determine these. Thanks

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Sun Jan 02, 2011 1:24 pm
by Tom
You'll need to do a lot of tests with the quadrocopter. It depends on it's size, weight, size of props, ...

My values are around:
Pitch:
P = 0.15
Roll:
P = 0.12
Heading:
P = 0, I = 0, D = 2.4

Re: source code for revised RTOS pilot - v 0.51

PostPosted: Sun Jan 02, 2011 10:42 pm
by Mitch
Another caution here. The quadrocopter code implements turbopwm which is a high frequency pwm intended for the speed controls. The pwm frequency is too high for most servos. The servos may not function properly and may overheat.