Jump to content


osnwt

Member Since 26 Jul 2010
Offline Last Active Yesterday, 02:40 PM

Posts I've Made

In Topic: Qt 4.8 released

10 May 2012 - 12:17 PM

Please attach complete output of command:

$ make package 2>&1 | tee make_log.txt

as mentioned here in the end of the page.

In Topic: Astron's CC Guidance - full fixed wing UAV

03 May 2012 - 03:01 PM

Some details of implementation

Please note that not all details are clear for me too. I might polish the description after real tests. Volunteers are welcome of course  - os.
  • When RTB mode is engaged, the current course is fixed for the PeriodCorrectedBiasYaw and will only be updated after this time. Then, if flying speed is higher than GroundSpeedMinForCorrectBiasYaw, the correction between yaw and GPS course is calculated, it is averaged with the previous correction. Then updated course is calculated.
  • Then it is checked if the airframe is within base location with RadiusBase.

Quote

If it is outside, SpeedToRTB is calculated as (location - previous_location)/PeriodCorrectedBiasYaw.

Tacks processing: if SpeedToRTB is less than 1 m/s and TacksNum > 0, TacksAngle is added to the calculated course. After TacksNum*PeriodCorrectedBiasYaw time the tacks angle sign is changed (left tack to right or back).

Then new course is set, new PeriodCorrectedBiasYaw is started, logic continues to altitude and speed calculation.

Quote

If the airframe is within the base range, SpeedToRTB is set to GPS speed.

If circle flight is enabled, course is set as previous course + CircleAroundBaseAngle. Otherwise course is kept unchanged.
Then continue to calculate new course (no PeriodCorrectedBiasYaw delay and no gyro drift correction).
  • To calculate throttle, assumed airframe speed is mean value between GPS speed and SpeedToRTB.
    If automatic throttle control is enabled, the value will be increased or decreased by the (GroundSpeedMax - (Groundspeed + SpeedToRTB)*0.5) * Throttle[CCGUIDANCESETTINGS_TROTTLE_KP] with period of GPS updates, but not more than Throttle[StepMax] per step.
  • Altitude is calculated using GPS data as
    (altitude setpoint - current altitude) * Pitch[Kp] + Pitch[Neutral].
    Pitch[Climb] and Pitch[Sink] are used to bound the value.

    If SpeedToRTB is approaching to GroundSpeedMinForCorrectBiasYaw, Pitch[Climb] will approach to Pitch[Neutral]:
    Pitch[Climb] = (SpeedToRTB - GroundSpeedMinForCorrectBiasYaw) * 12
    But not higher than Pitch[Climb] and Pitch[Neutral].
Altitude and speed calculations are performed each time when GPS data are updated.
Course is updated every PeriodCorrectBiasYaw (only when airframe is outside of base location).

Sometimes GPS altitude does not follow the real altitude fast enough. So it is wise to have some extra to be safe, adding some altitude offset to the real base altitude (or better - above the ground during the flight).

In Topic: Astron's CC Guidance - full fixed wing UAV

03 May 2012 - 03:01 PM

Please pay attention to the following:
  • CAUTION: If the board is Armed AND TrottleControl=TRUE AND FaileSaveRTB=TRUE, if you turn off the Tx, after 4 seconds the motors will be turned on. Be careful!
  • If wind is stronger than model can handle - just land and wait, no solution yet found.
  • Wind adds some error of yaw gyro drift correction calculation. More wind speed/airframe speed ratio - more error.
  • If airframe doesn't have a rudder - just mix rudder to ailerons. This will add roll, and attitude stabilization will correct pitch. Tested using AeroSimRC.
  • When target approaching speed is decreased to GroundSpeedMinForCorrectBiasYaw, maximum elevator deflection is limited by the Neutral (to keep heading towards the base and prevent the tail forward flight). The limiting is smooth.
  • When circling around the base for a long time the flight direction can be changed from CW to CCW or vice versa. That's by reason of yaw gyro drift since course correction withing the base radius isn't being performed.
  • Don't forget that airframe can't change course instantly. Even if heading is correct this doesn't mean correct course yet. This means that PeriodCorrectedBiasYaw should not be too low even if GPS has high update rate. For particular plane 5 seconds was enough. Low value - more yaw error - more swinging. It is more actual for VTOLs since they can change heading very fast.
  • It was not tested on VTOLs but should work if you give them some time to change flight direction (here is assumed that if you can hold the altitude and add some pitch, any VTOL will fly forward which should give it a GPS data for course calculation. It was not tested yet, do it on your own risk - os).
  • For VTOL the Neutral pitch value should be set so to give it some forward flight speed, say, 30km/h or more. Max = 0, Min - to have descent. With minimum throttle and pitch set to Neutral it should fly horizontally keeping the altitude. Set maximum throttle so you still can control the pitch. Since there was no real tests (author didn't have any multirotor), try on your own risk.
A lot of testing was done, and plane always had returned to the base except one case where base location wasn't set correctly. It wasn't a big problem though since flight path was over the real base.

It is still a work in progress, more like a beta. There is no GUI yet - all settings are accessible via UAVObjBrowser only.

In Topic: Astron's CC Guidance - full fixed wing UAV

03 May 2012 - 02:58 PM

The firmware branch is origin/andrey/CC_Guidance.

Prerequisites:
  • In Attitude mode the fixed wing should be stabilized for normal level flight (attitude stabilization settings);
  • It is desired for the airframe to be able to continue level flight with zero pitch command w/o altitude loss with some minimum throttle value.
CC_Guidance module settings.
Please note that I translate them as is (I understand not all of them yet even in Russian). More details will be available after I try it for myself.
  • Yaw - neutral rudder position in degrees
  • Pitch "Kp, Climb, Sink, Neutral" - some Kp, and elevator values (max deviations) for climbing, sinking and level flight. For VTOLs the latter should provide some level flight as well (but I am not sure if that will work for VTOL at all - os' note)
  • Roll "Max, Neutral" - neutral and maximum aileron values. Max is currently only used for emergency circling if GPS 3D fix is lost.
  • Throttle "Kp, StepMax, Max, Min" - some Kp, maximum throttle change step, and max and min throttle values allowed when in autopilot mode.
  • ReturnToBaseAltitudeOffset - altitude error relative to the base or target location.
  • RadiusBase - within this radius the gyro drift correction is not calculated, new course is set on each GPS data update.
  • CircleAroundBaseAngle - difference angle between course and direction to the base.
  • CircleAroundBase - if FALSE, then instead of circling the base will be passed with the last course calculated at the moment of entering the base radius.
  • TacksAngle - extra angle to be added to the course if flying speed is less than GroundSpeedMinForCorrectBiasYaw.
  • TacksNums - number of PeriodCorrectBiasYaw while the tacks mode will be active since activation.
  • PeriodCorrectBiasYaw - time for new course fix. After course is changed, the wing can change heading but new course is not detected yet. More time - higher error of setting the new course.
  • GroundSpeedMinForCorrectBiasYaw - minimum required GPS (ground) speed required to update the Yaw. This probably means that when you have low ground speed, you can't be sure that GPS course is correct. This speed is required to assume the GPS course is valid - os.
  • GroundSpeedMax - maximum GPS speed. Should be correct when in the base radius. In other cases it depends on the flying speed. When calcluated, it is assumed that current speed is equal to (positionActual.Groundspeed + SpeedToRTB)*0.5), where SpeedToRTB is the return to base speed.
  • FaileSaveRTB - if TRUE, 4+ seconds failsafe will trigger the RTB mode.
  • TrottleControl - if TRUE, throttle is controlled automatically. From the Tx otherwise.
  • HomeLocationEnableRequestSet - if TRUE, the base location can be set more than once after power up using the Tx. To set base location switch to the RTB mode when disarmed.
  • HomeLocationSet - if FALSE, it is assumed that the base location is not valid, and RTB mode will hold the current position instead.
  • HomeLocationLatitude, HomeLocationLongitude, HomeLocationAltitude - obvious (used in RTB mode).
  • TargetLocationSet - similar to the HomeLocationSet. If FALSE, flight to target mode will hold the current position instead.
  • TargetLocationLatitude, TargetLocationLongitude, TargetLocationAltitude - obvious (used in FlightToTarget mode).
  • UpdatePeriod - limits the CCGuidance GPS data processing frequency in case the GPS provides faster updates.
Note: data field names are long and not always clear/correct. We are planning to choose another once and also optimize data storage later.

In Topic: Astron's CC Guidance - full fixed wing UAV

03 May 2012 - 02:18 PM

I am not a native English, so let me drop lyrics from original post and keep only technical info.
Also the translation is not direct - I add some extras where I think they are needed.

The OpenPilot project is wonderful project with great ability to be improved and extended. But the 1st hardware result of it - the CopterControl board - wasn't designed with navigation in mind. It had own niche for stabilization of any kind of airframe. And this job it does well. Being popular for VTOLs, it is also able to stabilize fixed wing airframes. And some GPS connected with telemetry allows to monitor the system behavior and location. But that's all, the CC hardware has not enough resources (both RAM and flash memory) to anything else not sacrificing the sound system architecture.

Anyway, some attempts were done to add simple fixed wing guidance feature to make possible the RTB (return to the base). CorvusCorax was the first who did that with CC. But his implementation could be improved. And that's what basically was done by Astron.

His firmware branch was forked from the origin/corvuscorax/OP-472_CC_Guidance branch.

The following system was used for his tests:
  • fixed wing airframe САМ5БИС2 (drawings from rc-aviation.ru);
  • DT750 motor;
  • 2200 mAh battery;
  • ZX4125 1Hz GPS module;
  • APC220 telemetry (with hand-made ground aerial);
  • MD80 on-board camera;
  • Turnigy 9X2 radio with ER9X firmware.
The main difference between Corvus' firmware and this one is that the course is stabilized using existing yaw attitude stabilization. New system uses the difference between the heading and GPS course and makes only corrections to guide to the target location.

Implemented features and changes:
  • All navigation settings are in a single UAV object, CCGuidanceSettings. This frees some RAM.
  • Base location can be set/updated either using Tx (switching to RTB mode when disarmed) or using map on the PC and telemetry link.
  • Failsafe during 4+ seconds automatically activates RTB mode.
  • Automatic or manual flying speed selection (only ground speed measured by the GPS).
  • Two position hold modes: circles or straight lines till the base border defined.
  • Automatic tacks in RTB mode if flying speed is less than 1 m/s.
  • One optional target location. You can choose from the Tx either return to base mode or flying to the target location mode.
  • GCS feature: base location is automatically centered on the map. You can set target point or base location using map and telemetry.
  • If GPS fix is lost in RTB mode, ailerons can be set to the predefined position. This should mean circle flight. Throttle is controlled by hand.
  • Position Hold mode: current location at the time of activation of PH will be set as a hold point.
For sample videos I refer to the original thread.