Commit Graph

3333 Commits

Author SHA1 Message Date
Andrew Tridgell
589b8cdb58 AP_HAL: added voltage_average_ratiometric() call to AnalogIn
this is for ratiometric sensors such as the 3DR airspeed sensor and
the Maxbotix analog sonar
2013-05-13 15:12:43 +10:00
Andrew Tridgell
a17b85c661 AP_AHRS: use vectors for ground vector complimentary filter 2013-05-13 11:27:55 +10:00
Paul Riseborough
9f309a2aa6 AP_L1_Control: Remove potential nan errors
If WP A and B were the same or ground speed was exactly zero, then the
previous code would produce a nan output.  Protection against these
two cases has been added.

If WP A and B are equal, we track directly to the target waypoint
2013-05-13 11:27:51 +10:00
Randy Mackay
55235630b6 Copter: bug fix for slow loiter repositioning 2013-05-12 14:51:02 +09:00
Andrew Tridgell
9bdbd6bfbd MAVLink: update to latest common.xml from upstream 2013-05-11 21:07:27 +10:00
Randy Mackay
61288fcb90 WPNav: make get_stopping_point method public 2013-05-11 16:05:42 +09:00
Randy Mackay
80bd458f29 Compass: update parameter description
We do not want people modifying the COMPASS_MOTCT manually
2013-05-11 14:50:36 +09:00
Andrew Tridgell
172faeea26 HAL_PX4: moved rc.APM to new ROMFS directory 2013-05-10 06:16:54 +10:00
Andrew Tridgell
b3e21c6add HAL_PX4: include visibility.h
needed for new nuttx structure
2013-05-10 06:16:53 +10:00
Andrew Tridgell
220e7b019c SITL: use PACKED attribute in fdm structure 2013-05-09 20:10:31 +10:00
Andrew Tridgell
416fef73a8 AP_Param: use PACKED attribute in examples 2013-05-09 20:10:31 +10:00
Andrew Tridgell
ed918dc6bc SITL: use PACKED attribute instead of pragma pack 2013-05-09 20:10:31 +10:00
Andrew Tridgell
06b6f4b04e AP_GPS: use PACKED attribute instead of pragma pack 2013-05-09 20:10:31 +10:00
Andrew Tridgell
62b9a580e8 AP_Common: make PACKED depend on architecture
this will remove lots of warnings when building with arduino
2013-05-09 20:10:31 +10:00
Randy Mackay
ed5ddfd9db WPNav: initialise desired roll, pitch
bug-fix to resolve 1/10th second twitch when loiter or waypoint
controller are first engaged
2013-05-09 18:32:02 +09:00
Andrew Tridgell
fefbeacf86 AP_InertialSensor: use SEVERITY_USER_RESPONSE for accel cal messages
thanks to the suggestion from Kevin
2013-05-09 09:28:25 +10:00
Andrew Tridgell
11bf6f40f7 GCS_MAVLink: moved gcs_severity to library header 2013-05-09 09:27:58 +10:00
Andrew Tridgell
9a87b3f3c1 AP_Compass: use const on more functions and remove old calculate_heading()
the calculate_heading() based on roll/pitch is not needed anywhere
2013-05-09 09:24:06 +10:00
Andrew Tridgell
f78de63a09 AP_Compass: more efficient calculate_heading() implementation
Thanks to piersh for this improvement. See

b5f0635455 (commitcomment-3171806)
2013-05-09 09:24:06 +10:00
Randy Mackay
9f735c8d03 WPNav: add fast waypoints flag
Waypoint is considered "reached" when the intermediate point reaches the
destination
2013-05-09 00:18:02 +09:00
Randy Mackay
4704b729c2 WPNav: reduce max acceleration to 2.5m/s
Also includes bug fix to ramp up of speed of intermediate point
2013-05-08 23:20:29 +09:00
Andrew Tridgell
095505129c DataFlash: hopefully fixed cause of frequent dataflash erase
Wait for 0.1s after erase and before we start writing parameters to
the log

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-05-08 17:00:36 +10:00
Andrew Tridgell
7fdf1b6f78 DataFlash: fixed example build 2013-05-08 16:45:40 +10:00
Andrew Tridgell
8f57b72e3f AP_InserialSensor: fixed example build 2013-05-08 16:45:31 +10:00
Andrew Tridgell
c3738ed344 AP_InertialNav: fixed example build 2013-05-08 16:45:21 +10:00
Andrew Tridgell
ed93f80ba9 AP_Baro: fixed example build 2013-05-08 16:45:07 +10:00
Andrew Tridgell
55d148abdd AC_WPNav: fixed example build 2013-05-08 16:44:59 +10:00
Andrew Tridgell
56694fd9b1 AC_Fence: fixed example build 2013-05-08 16:44:50 +10:00
Andrew Tridgell
2ddeaa7f4d AP_InertialSensor: show calibration offsets for success and failure
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-05-08 16:19:06 +10:00
Andrew Tridgell
f3f4b7205c AP_InsertialSensor: added support for MAVLink user interaction
allows APM to ask user to print enter to continue via MAVLink messages
during accel calibration
2013-05-08 16:18:40 +10:00
Andrew Tridgell
4bc53acbda SITL: support vsnprintf with %S on SITL 2013-05-08 16:17:36 +10:00
Andrew Tridgell
9cd0af1132 HAL_PX4: make PX4 snprintf support %S format
just maps it to %s for normal printf
2013-05-08 16:17:06 +10:00
Andrew Tridgell
223dfe4de5 AP_Rangefinder: added units for settle time 2013-05-08 14:21:32 +10:00
Randy Mackay
328d900647 WPNav: flexible loiter speed
Also includes bug fix to allow speeds > 10m/s during missions
2013-05-07 17:11:24 +09:00
Randy Mackay
1f8161b493 AC_WPNav: remove unnecessary speed constraint 2013-05-07 11:58:04 +09:00
priseborough
aee23361dd APM_Control: Corrected typographical error in APM_Control/TuningGuide.txt 2013-05-07 11:00:57 +10:00
Andrew Tridgell
6f1cee6406 AP_AHRS: fixed position estimate with 2D fix or low satellite count
we should still use the GPS for position fixes when we have a low
number of satellites, but we should stop using it for velocity
estimates and attitude correction.
2013-05-07 10:52:14 +10:00
Andrew Tridgell
055da3c4b6 SITL: added SIM_GPS_NUMSATS parameter
this allows testing of the DCM code with less than 6 satellites
2013-05-07 10:38:36 +10:00
Randy Mackay
ceda7d26b0 AHRS: add correct_centrifugal and flags structure 2013-05-06 15:32:06 +09:00
Andrew Tridgell
46c6aa8a9a APM_Control: tweak the parameter names 2013-05-05 21:51:09 +10:00
Andrew Tridgell
400777b059 APM_Control: support inverted flight in AP_PitchController
auto-reverse pitch control when inverted. This is useful not just for
inverted flight mode, but also for recovering from poor manual flight

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-05-05 21:51:09 +10:00
Andrew Tridgell
604bfd0700 APM_Control: adjust recommended ranges 2013-05-05 21:51:09 +10:00
Andrew Tridgell
7af3c667a5 APM_Control: added roll controller parameter docs 2013-05-05 21:51:09 +10:00
Andrew Tridgell
52c3f8841f APM_Control: added yaw parameter docs 2013-05-05 21:51:09 +10:00
Andrew Tridgell
b618d1d81f APM_Control: added inline docs to pitch controller 2013-05-05 21:51:09 +10:00
Andrew Tridgell
6c6c0079ee APM_Control: improved formatting of tuning guide
be a bit more web friendly
2013-05-05 21:51:09 +10:00
Andrew Tridgell
742df0ac05 APM_Control: rename to avoid spaces in filenames 2013-05-05 21:51:09 +10:00
Andrew Tridgell
23d9c31b0a APM_Control: fixed build and merge errors 2013-05-05 21:51:08 +10:00
Paul Riseborough
10ecffce01 APM_Control: ROLL and PITCH controllers
These changes reduce height variation in turns and improve
robustness. the specific changes are:

1) Linked roll and pitch integrator protection to the final output
value so that if final output is on upper limit, the integrator is
prevented from increasing and vice-versa. This improves wind-up
protection.

2) Modified rate feedback in roll and pitch controllers to use body
rates rather than Euler or earth rates.

3) Changed the roll to pitch compensation to use measured roll angle
and estimated airspeed to calculate the component of turn rate
(assuming a level coordinated turn) around the pitch axis. This a
mathematically correct calculation and will work over a range of bank
angles and aircraft with minimal (if any) tuning required.

4) The integrator in the roll and pitch loop is clamped when the
estimated speed is below the minimum FBW speed

5) The noise filter in the pitch and roll loop has been changed to use
a FOH discretisation. This gives improved noise rejection and less
phase loss when compared to the previous filter that used a ZOH or
equivalent discretisation.

This has been flown on the rascal in the SITL and on a X-8 with
limited flight testing. Initial results have been encouraging with
reduced height variation in turns.  Compare to standard PIDS, the
revised pitch and roll controllers allow the use of rate feedback
(effectively the same as the old D term) without beating the servos to
death.  The bank angle compensation in the pitch loop works
effectively over a much larger range of bank angles and requires
minimal tuning compared to the old calculation.

YAW CONTROLLER

Currently testing the a 3-loop acceleration autopilot topology for the
yaw loop with feed forward yaw rate for turn compensation. This 3-loop
topology is commonly used in tactical skid to to turn missiles and is
easy to tune. The following block diagram shows the general signal
flow

Note that the acceleration measurement has to pass through an
integrator before it gets to the actuator. This is a important feature
as it eliminates problems of high frequency noise and potential
coupling with structural modes associated with direct feedback of
measured acceleration to actuator.

The high pass filter has been inserted to compensate for airspeed and
bank angle measurement errors which will cause steady state errors in
the calculation of the turn yaw rate.

The yaw controller flies SITL well, but hasn't been flight tested
yet. It can be configured either as a simple yaw damper, or the
acceleration and integral term can be turned on to allow feedback
control of lateral acceleration/sideslip.

TO DO:

Need to reduce number of tuning parameters and provide consistent
naming Need to provide guidance on tuning these loops with definitions
for all the gain terms.  Need to check signs and units into and out of
lateral loops.

DESIGN DECISIONS PENDING:

1) Can we remove the noise filters? Provided the mpu6k noise filter is
running they are of limited benefit given the 25Hz Nyquist frequency

2) If we do remove them and rely on the mpu6k noise filter, what is
the apprporiate default cutoff frequency for plane use. 20Hz is
probably OK for most setups, but some noisy/high vibration setups
would require as low as 10Hz

3) The inverted flight logic looks like a crash waiting to
happen. It's problematic to test and even if implemented correctly
would still crash a plane with poor inverted flight capability. We
should either implement it properly and fully tested or delete it.
2013-05-05 21:51:08 +10:00
priseborough
205397d030 APM_Control: Modified calculation of bank compensation rate offset to prevent climb if speed > max fbw speed
The previous calculation constrained the speed used to calculate the
bank compensation rate offset between the min and max fbw speeds. This
would result in an unwanted climb if flown above the max fbw speed
(this could happen in fbw-a mode)
2013-05-05 21:51:08 +10:00