Odd navigation behaviour...

Hi,

I am attempting to put in a closed loop entry for T3 round 6 based around ArduPilot 2.6 code and FlightGear.
The model currently navigates directly to all waypoints, except those lying to the North of the previous waypoint. Here it seems to fly on a heading of around 333 degrees - whichcauses it to fly past waypoints to the East before swinging back West topick them up. See the attached .kml file for an example of this behaviour. This makes my sky-script worse than my handwriting... not good at all.
In all other cases navigation seems ok (given limited tuning).

I am sure that the problem will be in my code somewhere but I am hoping someone who is more familiar with 2.6 might be able to point me towards my mistake. Any ideas would be appreciated.

Supporting information -  I am running virtually stock 2.6 software from early April on Arduino Mega hardware not ArduPilot. Air starts only in AUTO mode so the ground start initialisation is missed.
The value of 333 degrees above is returned as -322 for ground_course by AP. The heading data supplied by flightgear is 33320 for the AP packet below. This is typical of the problem. 
!!!LAT:51172327,LON:-4677193,SPD:21,CRT:0,ALT:255,ALH:250,CRS:-322,BER:8,WPN:2,DST:228,BTV:0,RSP:0,TOW:468361700,***
This condition seems to be the only time I see negative values for ground_course (CRS). All other values seem reliable.

navtest.kml

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Sorted...

    I was supplying ArduPilot heading data with values 0-36000 ( 0-360 x100). ArduPilot treats IMU heading input as 16 bit signed integers so values from 32769 to 36000 were translated as -1 to -3232. D'oh!

    Attached .kml shows corrected behaviour. Gains still need some tweaking :)

    navtest3.kml

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…