Commit Graph

13 Commits

Author SHA1 Message Date
Peter Barker bd63ce3eb6 AP_FETtecOneWire: rely on AP_FETTEC_ONEWIRE_ENABLED being set in hwdef.h 2021-11-24 12:01:22 +11:00
Peter Barker 1590fcf0bf AP_FETtecOneWire: rename HAL_AP_FETTEC_ONEWIRE_ENABLED to AP_FETTEC_ONEWIRE_ENABLED 2021-11-24 12:01:22 +11:00
torsten 14c9de4d95 AP_FETtecOneWire: reset buf_used
if byte is missing due to electrical noise it can now resync
2021-11-11 07:44:57 +11:00
Dr.-Ing. Amilcar do Carmo Lucas d907328f80 AP_FETtecOneWire: README.md clarity improvements 2021-08-25 16:05:05 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 7498d5c296 AP_FETtecOneWire: Fix compilation on some exotic compilers 2021-08-19 17:57:58 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 92a75661e0 AP_FETtecOneWire: Fix state of CRC error counters after _fast_throttle_cmd_count overflow 2021-08-19 17:57:58 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 2f4c79fd1e AP_FETtecOneWire: only check for telemetry if it has been requested at some point
Only check for telemetry after sending a fast-throttle request for that particular ESC
Added more debug information from message handling state machine
2021-08-19 17:57:58 +10:00
TunaLobster 8cd47433ed AP_FETtecOneWire: Remove @RebootRequired: False 2021-08-19 10:00:16 +10:00
Dr.-Ing. Amilcar do Carmo Lucas a3d9a1d463 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-08-13 16:22:37 +10:00
Peter Barker ea7c7f9d19 AP_FETtecOneWire: complete rewrite of the ESC-configuration state machine
Co-authored-by: Dr.-Ing. Amilcar do Carmo Lucas <amilcar.lucas@iav.de>

tidy message sending using templates
Calculate and enforce the minimum update period.
Disable unused features to save flash
forced time gaps between all transmits
correct ESC reset functionality
Avoid re-initialization repeatition
Make sure we stop FETtec if safety is on (ignore reverse) this reduces duplicated code
Error count calculation changed
   as the telemetry error count is absolute only the overflow status can be safed and used for the percentage calculation
Update the README to add autotests information
FETtec needs a time gap between frames
  This allows running at high fast_loop_rates
do not send fast_throttle data if a configuration command just got sent
Example parameter configuration file is for a Quadcopter with ESCs connected to Telem2
remove two FIXME
fix compilation in master
Fix the ESC not re-initializing issue.
  Now we re-init whenever we loose connection
RVMASK parameter changes only take effect when not armed
Improve documentation
Always use the same wording when referring to fast-throttle commands
fix pre-arm check message
assure the length of the memmove is positive
Set HAL_AP_FETTEC_CONFIGURE_ESCS to 0 when no ESC hardware is available and you want to test the UART send function
2021-08-13 16:22:37 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 1b7b705856 AP_FETtecOneWire: Convert into an ArduPilot device driver
Co-authored-by: Torsten Z <t.zunker@fettec.net>
    Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>

- use ArduPilot's coding guidelines and naming conventions
- control motor speed
- 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
- report telemetry communication error rate in the dataflash logs
- warn the user if there is a gap in the bitmask parameter.
- re-enumerate all ESCs if not armed (motors not spinning) when
  - there is a gap in their address space IDs
  - communication with one of the ESCs is lost
  - some of the configured ESCs are not found
  - some of the configured ESCs are not correctly configured
- allows the user to configure motor rotation direction per ESC (only gets updated if not armed)
- adds a serial simulator of FETtec OneWire ESCs
- adds autotest (using the simulator) to fly a copter over a simulated serial link connection
2021-08-13 16:22:37 +10:00
Pierre Kancir 6346739466 AP_FETtecOneWire: Conversion to C++ and initial ArduPilot support 2021-08-13 16:22:37 +10:00
Torsten Z 35861ab616 AP_FETtecOneWire: Initial protocol implementation in C provided by FETtec 2021-08-13 16:22:37 +10:00