Commit Graph

26702 Commits

Author SHA1 Message Date
Dr.-Ing. Amilcar do Carmo Lucas
800414a1d0 AP_FETtecOneWire: Do not write to the UART buffer if the previous transfer did not complete yet
Required for stable operation on F4 processors
2021-12-13 10:49:32 +11:00
Andy Piper
5591ea2530 AP_HAL_ChibiOS: return correct value for tx_pending(). 2021-12-13 10:49:32 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
765bf35703 AP_HAL_ChibiOS: disable FETtec OneWire device driver 2021-12-13 10:49:32 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
0fe4a2573d AP_Arming: call fettec prearm checks 2021-12-13 10:49:32 +11:00
Peter Barker
ee4069921b SITL: add simulated FETtec ESC 2021-12-13 10:49:32 +11:00
Peter Barker
22809d1578 AP_HAL_SITL: add simulated FETtec ESC
do not overwrite FETTecESC telemetry data w/SITL ESC data
2021-12-13 10:49:32 +11:00
Peter Barker
bcea6fc806 AP_Math: move crc8_dvb_update into crc library 2021-12-13 10:49:32 +11:00
Pierre Kancir
ec4c4d0058 SRV_Channel: add FETtec support 2021-12-13 10:49:32 +11:00
Pierre Kancir
57ee2cb8d4 AP_SerialManager: add FETtecOneWire protocol 2021-12-13 10:49:32 +11:00
Torsten Z
2ca545a988 AP_FETtecOneWire: A serial-based ESC protocol with telemetry
Co-authored-by: Torsten Z <t.zunker@fettec.net>
Co-authored-by: Dr.-Ing. Amilcar do Carmo Lucas <amilcar.lucas@iav.de>
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>

- uses ArduPilot's coding guidelines and naming conventions
- control motor speed
- Use the AP_ESC_Telem base class to:
  - copy ESC telemetry data into MAVLink telemetry
  - save ESC telemetry data in dataflash logs
  - use RPM telemetry for dynamic notch filter frequencies
  - sum the current telemetry info from all ESCs and use it as virtual battery current monitor sensor
  - average the voltage telemetry info and use it as virtual battery voltage monitor sensor
  - average the temperature telemetry info and use it as virtual battery temperature monitor sensor
- Obey the safety switch. Keeps motors from turning
- Use `SERVO_FWT_MASK` to define which servo output should be routed to FETtec ESCs
- Use `SERVO_FWT_RVMASK` to define the rotation direction of the motors
  - `SERVO_FWT_RVMASK` changes only take effect when disarmed
- Can be compiled when `HAL_WITH_ESC_TELEM` is disabled. No telemetry data will be available but it saves a lot of memory
- pre-arm checks:
  - Check that UART is available
  - check that the desired motor channels parameter (`SERVO_FWT_MASK`) is valid
  - check that the desired motor poles parameter (`SERVO_FWT_POLES`) is valid
  - check that the all desired ESCs are found and configured
  - check that the ESCs are periodically sending telemetry data
- re-init and configure an ESC(s) if not armed (motors not spinning) when
  - telemetry communication with the ESC(s) is lost
- adds a serial simulator (--uartF=sim:fetteconewireesc) of FETtec OneWire ESCs
- adds autotest (using the simulator) to:
  - simulate telemetry voltage, current, temperature, RPM data using SITL internal variables
  - test the safety switch functionality
  - test ESC power outages
  - test `SERVO_FWT_MASK` parameter validation
  - fly a copter over a simulated serial link connection
2021-12-13 10:49:32 +11:00
Andrew Tridgell
5e4de872ac HAL_ChibiOS: use a 16 bit sysinterval_t on 16 bit timers
prevent mixed size subtraction errors
2021-12-13 10:49:32 +11:00
Peter Barker
559387c864 AC_Fence: void index when overwriting fence count on fencepoint-close 2021-12-13 10:49:32 +11:00
Andrew Tridgell
3a52bc29a3 AC_Fence: fixed fence count for old upload
when uploading a fence that is smaller than an old fence we were not
correctly setting the inclusion fence size.
2021-12-13 10:49:32 +11:00
Andrew Tridgell
ce2d77dc39 APM_Control: make 2nd reduction of P smaller
this prevents severe P reductions when we get a small oscillation
glitch after we've already got the primary P gain
2021-11-25 15:00:12 +11:00
李孟晓
e99e0f941d CUAV-X7: Add servo voltage detection pin 2021-11-25 14:57:18 +11:00
Andrew Tridgell
6cf92b4726 AP_AHRS: fixed switching airspeed sensor based on EKF3 affinity (for 4.1)
we need to use the EKF selected airspeed sensor when the EKF is setup
to run a different sensor on each lane
2021-11-25 14:52:17 +11:00
Andrew Tridgell
9defb72733 AC_AttitudeControl: fixed limiting of throttle mix values
use constrain instead of reset to keep as much of user requested value
as possible

also raise limit for MIX_MIN to 0.5 after discussion with Leonard
2021-11-23 15:51:01 +11:00
Andrew Tridgell
157f4593da RC_Channel: added QRTL mode on a switch 2021-11-22 07:46:13 +11:00
Andrew Tridgell
28e5f255b7 hwdef: added alternative Durandal 20602 IMU 2021-11-11 08:29:39 +11:00
Andrew Tridgell
4e4a9083d4 RC_Channel: added fixed wing autotune rc option 2021-11-09 20:35:38 +11:00
Andrew Tridgell
bb60c7280c AP_ADSB: bugfix vertical velocity sign was backwards 2021-11-09 07:49:05 +11:00
Andrew Tridgell
cfbbeea1ec AP_NavEKF3: fixed switch to non-zero primary on disarm
if EK3_PRIMARY is not zero then we were not switching to it when
disarmed
2021-11-09 07:44:41 +11:00
Andrew Tridgell
9f5b91036c AP_UAVCAN: added CAN_Dn_UC_OPTION parameter
this allows for 2 ways of controlling conflicts in the UAVCAN DNA
database. The first is to set CAN_Dn_UC_OPTION to 1, which resets the
DNA database, thus clearing any node conflicts.

The second is to set CAN_Dn_UC_OPTION to 2, which ignores node
conflicts in the DNA database

These options are useful for vehicles with UAVCAN smart batteries
where the node ID is fixed but the hwid changes and you want to do
battery swapping (possibly without rebooting)
2021-11-03 05:51:27 +11:00
Mohammad Hefny
4d3dde9d30 AP_Notify: link to notify module 2021-11-01 10:51:58 +11:00
Mohammad Hefny
316a0e3d11 AP_Batt: link to battery monitor 2021-11-01 10:51:58 +11:00
Mohammad Hefny
ffa8412df5 AP_HAL_Linux: define board features on Linux module 2021-11-01 10:51:58 +11:00
Mohammad Hefny
565b6f5ef9 AP_HAL: define board features 2021-11-01 10:51:58 +11:00
Andrew Tridgell
0404b7cb4f APM_Control: suppress roll/pitch D term in ground_mode
prevent oscillations which are quite common
2021-10-30 18:49:34 +11:00
Samuel Tabor
ab74913c83 AP_Landing_Slope: Log height used for flare timing. 2021-10-26 10:49:00 +11:00
Ben Wolsieffer
1d634cc2be AP_Control: apply pitch rate limit to turn coordination
At high bank angles, for example when rolling to/from inverted, a large turn
coordination pitch rate offset is requested. Before this patch, this offset was
not subject to the configured pitch rate limit, which could result in pitch
controller integrator windup.
2021-10-16 19:52:45 +11:00
Andrew Tridgell
5cc1345ca5 AP_RCProtocol: check for RC protocol switching enable
by default don't allow protocol switching after initial protocol is
found
2021-10-16 19:52:45 +11:00
Andrew Tridgell
3812469b33 RC_Channel: added RC_OPTION bit for allowing RC protocol switching
this is meant to prevent accidential switching to a disconnected pin
2021-10-16 19:52:45 +11:00
bugobliterator
874a610255 AP_HAL_ChibiOS: account for TXFIFO when doing flow control detection 2021-10-15 20:01:25 +11:00
Andy Piper
aa0f01005c AP_Filesystem: fix ftp burst read with credit to deanharken 2021-10-15 20:01:25 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
8a038418a9 GCS_MAVLink: add ESC_TELEMETRY_1_TO_4 to the mavlink_id_to_ap_message_id table 2021-10-15 20:01:25 +11:00
Andrew Tridgell
691794bb41 AP_NavEKF3: added EK3_PRIMARY parameter
allows for selection of which IMU to use on startup
2021-10-13 18:09:56 +11:00
Andrew Tridgell
15de5b49e1 APM_Control: only save autotune gains when P finished
this prevents saving values which are temporarily high due to tuning
process

See this bug report
https://discuss.ardupilot.org/t/plane-4-1-0-stable/76507/45
2021-10-10 18:04:55 +11:00
Andrew Tridgell
8572595dfa HAL_ChibiOS: fixed orientation of ICM42605 on QiotekZealotF427 2021-10-08 13:21:18 +11:00
Andrew Tridgell
edfb18877e AP_Scripting: fixed bug in string logging with logger.write()
this dereferenced a bad pointer, leading to crash and watchdog

thanks to Charlie for finding this!
2021-10-08 13:18:21 +11:00
Andrew Tridgell
9328fae953 AP_Scripting: avoid a error in lua with gcc 10.2 on STM32 with -Werror 2021-10-08 13:14:09 +11:00
Andrew Tridgell
67ebee599e AP_InertialSensor: fixed build warning 2021-10-08 13:14:09 +11:00
Andrew Tridgell
8450f02c2f AP_Compass: fixed build warning on g++ 10.2 2021-10-08 13:14:09 +11:00
lthall
e69875a2bc AC_AttitudeControl: Fix initialize bug 2021-10-08 13:14:09 +11:00
Andy Piper
657e72ce07 AP_SerialManager: correct docs for SERIAL8 2021-10-08 13:14:09 +11:00
lthall
1e84144d33 AC_AttitudeControl: AC_PosControl: Update PSC logging to include desired 2021-10-08 13:14:09 +11:00
Leonard Hall
455cea443b AP_Logger: Update PSC logging to include desired 2021-10-08 13:14:09 +11:00
Peter Barker
209d7dda0c AP_Logger: specify frames on PSC fields 2021-10-08 13:14:09 +11:00
Iampete1
27701e9525 AP_Proximity: lower SF45B update rate 2021-10-08 13:14:09 +11:00
Andy Piper
8af0e2684a AP_RCTelemetry: don't enter parameter mode while armed.
exit parameter mode quickly on ping
construct and respond to ping frames correctly
2021-10-08 13:14:09 +11:00
mateksys
8297ac3f17 ChibiOS: add icm42605 as substitution for icm20602 2021-09-28 07:06:06 +10:00
Paul Riseborough
bc5efb6cd2 AP_NavEKF3: fix wind speed covariance initialisation bug 2021-09-21 13:33:52 +10:00
Andrew Tridgell
564ea5e521 HAL_ChibiOS: fixed RTSCTS flow control issue
this fixes an issue reported on MatekH743, but also applies to other
boards. When not using DMA if there have been bytes written before the
auto flow control detection was enabled then these must be cleared
from _total_written so the flow control detection can work correctly
2021-09-15 14:18:41 +10:00
Andrew Tridgell
436fe6b0de HAL_ChibiOS: disable soarding on FlywooF745 for flash space 2021-09-10 17:14:43 +10:00
Andrew Tridgell
a60a1fcd3f AP_RCProtocol: increase CRSF frame timeout to account for scheduling delays 2021-09-10 17:07:04 +10:00
Leonard Hall
a3b6f33cf1 AC_WPNav: Fix calculation of _scurve_jerk_time using radians. 2021-09-10 17:07:04 +10:00
Andy Piper
5df4266f95 AP_HAL_ChibiOS: bdshot version of CUAVv5 2021-09-10 17:07:04 +10:00
Andy Piper
47bf40c415 AP_HAL_ChibiOS: bdshot version of CUAVv5Nano 2021-09-10 17:07:04 +10:00
Leonard Hall
32a9ba0c91 AC_AttitudeControl: AC_PosControl: Change set_correction_speed_accel_z to use input arguments 2021-09-10 17:07:04 +10:00
Andrew Tridgell
a58f61a29c AC_WPNav: cope with negative WPNAV_SPEED_DN
a user set WPNAV_SPEED_DN to a negative value, with odd results. Take
absolute value to cope. Even though the param docs clearly say range
should be positive, it is one where it is easy to think it should be
negative
2021-09-10 17:07:03 +10:00
Peter Barker
747f03c8de AC_WPNav: monitor WPNAV_SPEED for changes 2021-09-10 17:07:03 +10:00
Josh Henderson
169f1b2d7a AC_WPNav: simplify get_wp_destination_loc 2021-09-10 17:07:03 +10:00
Randy Mackay
332848e29d AC_WPNav: protect against divide-by-zero 2021-09-10 17:07:03 +10:00
Randy Mackay
9e866449e1 AC_WPNav: move definitions to .cpp file 2021-09-10 17:07:03 +10:00
Randy Mackay
82ef14a692 Copter: terrain spelling fix 2021-09-10 17:07:03 +10:00
Randy Mackay
dbba55d779 AC_WPNav: terrain spelling fix 2021-09-10 17:07:03 +10:00
Leonard Hall
3e65570b36 AC_AttitudeControl: AC_PosControl: Remove const float 2021-09-10 17:07:03 +10:00
Leonard Hall
b16ce057c1 AC_WPNav: Separate landing and terrain following. 2021-09-10 17:07:03 +10:00
Leonard Hall
2441f88072 AC_Autotune: Separate landing and terrain following. 2021-09-10 17:07:03 +10:00
Leonard Hall
ce6b336f7d AC_AttitudeControl: AC_PosControl: Separate landing and terrain following. 2021-09-10 17:07:03 +10:00
Iampete1
f13ab11c88 SRV_Channel: call update_aux_servo_function in function_assigned 2021-09-10 17:07:03 +10:00
Andrew Tridgell
1b398d6956 HAL_ChibiOS: use more USB buffers on higher end F7 chips 2021-09-10 17:07:03 +10:00
Andrew Tridgell
991352b76b HAL_ChibiOS: reduce the impact of UART DMA contention
this changes the heuristics for UART TX DMA allocation to greatly
reduce the chances of DMA contention causing long delays on other
devices

This fixes issues with FETTec driver output and gimbal status messages
as reported by Amilcar and OlliW. The problem is particularly bad when
no GPS is connected to GPS1 on fmuv3 and derived boards (such as
CubeBlack)

key changes:

 - remember the contention_counter across begin() calls, as the GPS
   calls begin with new baudrates regularly

 - added a is_shared() API to Shared_DMA, allowing the UART driver to
   avoid TX DMA on shared streams when at low baudrates.
2021-09-10 17:07:03 +10:00
Andrew Tridgell
f4266463c9 GCS_MAVLink: check for null comm_port before writing
this was found when adding debug code to write to a specific channel
2021-09-10 17:07:03 +10:00
Pierre Kancir
98bc5969b0 AP_Rangefinder: fix override in constructor 2021-09-10 17:07:03 +10:00
Andrew Tridgell
d2aeeb6bad AP_DAL: fixed a bug in RMGH logging 2021-09-10 09:26:44 +10:00
Andrew Tridgell
ee24310a95 AP_InertialSensor: fixed locking issue in delta accumulation
this fixes a bug in calculating delta velocity and delta acceleration
between threads.
2021-09-10 09:12:34 +10:00
Andrew Tridgell
3c1a3201c6 HAL_ChibiOS: fixed GPIO lines for QioTekZealotF427 2021-09-03 18:25:13 +10:00
Andrew Tridgell
febca7a952 AP_Declination: added a test suite for AP_Declination
use test vectors from MAVProxy mavextra
2021-09-03 14:45:38 +10:00
Andrew Tridgell
907d044c89 AP_Declination: fixed rounding in mag field
thanks to Angela for noticing this
2021-09-03 14:45:35 +10:00
QioTek
69d7a7c1e4 AP_HAL_ChibiOS: add Icm42605 as a backup to replace icm20649
AP_HAL_ChibiOS: add Icm42605 as a backup to replace icm20649
2021-08-29 11:24:18 +10:00
Hwurzburg
41e753ea47 AP_HAL_Chibios: Change RC in to RCINT to free a DMA channel 2021-08-29 11:24:18 +10:00
Andrew Tridgell
3d0ee4fead HAL_ChibiOS: allow FlywooF745 to build again 2021-08-28 12:50:32 +10:00
Andy Piper
0431d43a40 AP_HAL_ChibiOS: add FlywooF745Nano board definition 2021-08-28 12:50:32 +10:00
Leonard Hall
78dd9e2a49 AC_AttitudeControl: AC_PosControl: Non functional clean up 2021-08-28 12:50:32 +10:00
Leonard Hall
9a0b9407a8 AC_WPNav: Fix Jerk units 2021-08-28 12:50:32 +10:00
Leonard Hall
052524728b AC_AttitudeControl: AC_PosControl: limit initial acceleration 2021-08-28 12:50:32 +10:00
Leonard Hall
1c2655f565 AC_AttitudeControl: AC_PosControl: fix stopping point initialization 2021-08-28 12:50:32 +10:00
Iampete1
4fe9a34308 AC_PosControl: init_z_controller_stopping_point: remove duplicate set_integrator 2021-08-28 12:50:32 +10:00
Randy Mackay
380f3aece2 AP_Scripting: copter-fast-descent.lua example script 2021-08-28 12:50:32 +10:00
Randy Mackay
d17e88aa88 AP_Vehicle: add virtual set_target methods 2021-08-28 12:50:32 +10:00
Randy Mackay
432de2cdcf AP_Scripting: add AP_Vehicle set_target_pos_NED and posvelaccel_NED bindings 2021-08-28 12:50:32 +10:00
Randy Mackay
3ccdc69855 AP_Scripting: minor reorder of AP_Vehicle bindings
this is a slightly better grouping
2021-08-28 12:50:32 +10:00
Randy Mackay
056cb073be AP_Scripting: add AHRS:get_relative_position_NED_origin binding 2021-08-28 12:50:32 +10:00
Randy Mackay
9edb44151e AP_Scripting: add copter-circle-speed.lua example
Co-authored-by: Iampete1 <iampete@hotmail.co.uk>
2021-08-28 12:50:32 +10:00
Randy Mackay
aeba1dba93 AP_Scripting: add bindings for get_circle_radius, set_circle_rate 2021-08-28 12:50:32 +10:00
Randy Mackay
b8a1662ce1 AP_Vehicle: add get_circle_radius, set_circle_rate 2021-08-28 12:50:32 +10:00
Iampete1
4cf67b2888 AP_Vehicle: #ifdef scripting specific functions 2021-08-28 12:50:32 +10:00
Iampete1
c1e4ed6512 AC_AttitudeControl: check for zero rate Y max before taking min 2021-08-28 12:50:32 +10:00
Randy Mackay
88ebcffc73 AP_NavEKF2: init rngOnGnd to 5cm to avoid div-by-zero 2021-08-28 12:50:32 +10:00
Pierre Kancir
73efa895e2 AP_InertialSensor: fix externalAHRS detection
'A = B >= C' kind. The expression is calculated as following: 'A = (B >= C)'
2021-08-28 12:50:32 +10:00