baseFlightPlus Development - RC Groups
Thread Tools
This thread is privately moderated by jihlein, who may elect to delete unwanted replies.
Jun 09, 2012, 11:47 AM
Registered User
Discussion

baseFlightPlus Development


This thread is for discussion on the development and troubleshooting what for now I'm calling baseFlightPlus. This way we don't clog up the original thread with this development.
Sign up now
to remove ads between posts
Jun 09, 2012, 11:56 AM
Registered User
Regarding the newMagData, the idea behind it to eliminate "phantom drift". The AHRS updates at 200Hz, the mag at 10Hz. Movement of the body between the 10 Hz mag update looks like drift to the algorithm. So I only wanted run the mag compensation on the frames when mag was updated. Now that's not to say I've got it implemented correctly....

When I look at the 200 Hz AHRS data, mine look okay with this implementation. I'm going to try to get the whole frame together and see what things look like with some vibration.

There are a few other things with this algorithm that bother me. Need to gather my thoughts on them and I'll post them.
Jun 09, 2012, 08:20 PM
Suspended Account
subscribed
By the way, what do you use to build your code? Just drop contents of .zip into src\ and use the makefile?
Jun 09, 2012, 08:52 PM
Registered User
I'm using the 2.3 version of TrueStudio Lite, the last version to have unlimited code size.

BTW - the PID P gain values look like they should be closer to 200 than 100 to keep the nominal loop gain the same.
Jun 10, 2012, 01:08 AM
Registered User
Suscribed too.I've compiled it using my CrossStudio eval version. I had to add the extern keyword to all the variables in the headers, in order to avoid a lot of 'multiple definition' errors. I while try to run the code later today.
Thanks!
Jun 10, 2012, 01:23 AM
Registered User
Subscribed!

I build baseflightPlus on eclipse using the same things as in TC baseflight.


I will try to mess a litlle with it this afternoon. Trying to make the serial.c more comunicative (using the baseflight protocol maybe). And if I discover how TC use the config stuff I will try to do the same. This way changing params would be easier.
Jun 10, 2012, 04:37 AM
Registered User
Quote:
Originally Posted by jihlein
Regarding the newMagData, the idea behind it to eliminate "phantom drift". The AHRS updates at 200Hz, the mag at 10Hz. Movement of the body between the 10 Hz mag update looks like drift to the algorithm. So I only wanted run the mag compensation on the frames when mag was updated. Now that's not to say I've got it implemented correctly....

When I look at the 200 Hz AHRS data, mine look okay with this implementation. I'm going to try to get the whole frame together and see what things look like with some vibration.

There are a few other things with this algorithm that bother me. Need to gather my thoughts on them and I'll post them.
i asked seb to do so.
basically you rise the error on the yaw component..
and that is explainable as well.

sensorConfig.accelCutoff = 1.0f;
sensorConfig.beta = 0.1f;

beta should be function of the accel+mag measurements (especially fixed wing important to correct the algorythm during centripetal periods).
the same is valid for using mahonys algorythm (openpilot, ardupilot, arducopter).

if you look at openpilot and arducopter you 'see' the integral gain. i dislike the integrator because it collects everything - not only what it is designed for (gyro drift). from this point an integral implementation results in a system which is no longer inherently stable.
this is why is would go for a proprtional gain.

you produce a video showing a flip.
that proves everything.
Jun 10, 2012, 05:00 AM
Registered User
you should also look at the lower boundary of the motor output.
the i-term will rise the motor command dynamically if required.
causes less problem on fast descends.

Code:
    ///////////////////////////////////
   int16_t minMotor = systemConfig.maxThrottle;
    // this is a way to still have good gyro corrections if any motor reaches its max.

    maxMotor = motor[0];

    for (i = 1; i < numberMotor; i++)
    {
        int16_t val =  motor[i];
        if (val > maxMotor)
            maxMotor = val;
        if (val < minMotor)
            minMotor = val;
    }
    int16_t delta = 0;
 
    if (maxMotor > systemConfig.maxThrottle)
        delta = maxMotor - systemConfig.maxThrottle;
    if (minMotor < systemConfig.minThrottle)
        delta = minMotor - systemConfig.minThrottle;

    for (i = 0; i < numberMotor; i++)
    {
        if ( delta)
	motor[i] -= delta;
        motor[i] = constrain(motor[i], systemConfig.minThrottle, systemConfig.maxThrottle);

//        if ((rxCommand[THROTTLE]) < systemConfig.minCheck)
//        {
//            motor[i] = systemConfig.minThrottle;
//        }

        if ( armed == false )
            motor[i] = (float)MINCOMMAND;
    }
}
Jun 10, 2012, 11:02 AM
Registered User
flight dynamics

Code:
    // Check for low throttle
    if ( rxCommand[THROTTLE] < systemConfig.minCheck )
    {
		// Zero PID integrators at low throttle setting
		zeroIntegralError();
during the flight the pid intergrals should NEVER be zeroed.
there is a reason why they are set.
for quads you produce flips if the throttle is accidently set to zero.
at least use the arming timer.
and for fixed also a problem unless you have an easystar.
Jun 10, 2012, 01:55 PM
Registered User
wish list:
- add fixed wing type of flying vehicle
- midrc equal to 1520 for futaba users

looks nice going to add a some fixed wing fly by wire stuff.
Jun 10, 2012, 02:57 PM
Registered User
Robert, 1520 midrc could be a feature configurable. ;-)

I managed to do a mini gui, to read the pid values, I'm trying to be able to send the data to the board. I modify a little serial.c with no succes for now, I will see tomorrow why is not working.
Jun 10, 2012, 11:39 PM
Suspended Account
Quote:
Originally Posted by sbaron
I had to add the extern keyword to all the variables in the headers, in order to avoid a lot of 'multiple definition' errors.
Something is really screwed up if a compiler allows this to happen.
I wonder what version of GCC is in truestudio or whatever he uses.
I had to edit like 20 files to extern stuff and then move actual variables into .c files.
Jun 11, 2012, 12:05 AM
Registered User
I have no problems building with eclipse and sourcery lite.
Jun 11, 2012, 12:09 AM
Suspended Account
Right, but its technically wrong.
Variable gets re-defined in every header. Normal compilers do NOT like that.
Jun 11, 2012, 12:30 AM
Registered User
Quote:
Originally Posted by nicodh
Robert, 1520 midrc could be a feature configurable. ;-)

I managed to do a mini gui, to read the pid values, I'm trying to be able to send the data to the board. I modify a little serial.c with no succes for now, I will see tomorrow why is not working.
that would be great.
need some gui tool to tune the pid settings.
thanks!


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion RC EYE 650 - Development Thread RCLogger.Com Multirotor Drone Talk 6 Jan 03, 2013 04:49 PM
New Product FPVCommander for DragonOSD (In Development) flyandi FPV Talk 97 May 15, 2012 07:38 PM
Discussion In a world of generic chargers... who is actually developing their own stuff? sosidge Batteries and Chargers 4 Mar 31, 2012 09:18 AM
Wanted Luftwaffe Camouflage and Markings, 1933-45, Volume 1: Pre-War Development, Paint Syst Greybranch Non R/C Items (FS/W) 0 Mar 14, 2012 02:16 PM
Discussion Development of materials associated with aero-modelling rcDawson The Builders Workshop 4 Mar 08, 2012 11:04 AM