Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Tridgell cc05de8e57 AP_FETtecOneWire: change comments to not use @param
these comments break the MissionPlanner param parser

see these errors in MissionPlanner.log

```
2022-12-30 08:28:42,641  INFO MissionPlanner.Utilities.ParameterMetaDataParser - using cache https://raw.oborne.me/ardupilot/ardupilot/master/libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp (D:\a\MissionPlanner\MissionPlanner\ExtLibs\Utilities\ParameterMetaDataParser.cs:503) [65]
2022-12-30 08:28:42,641 ERROR MissionPlanner.Utilities.ParameterMetaDataParser - Invalid MetaFrame Blimp (D:\a\MissionPlanner\MissionPlanner\ExtLibs\Utilities\ParameterMetaDataParser.cs:390) [70]
2022-12-30 08:28:42,641  INFO MissionPlanner.Utilities.ParameterMetaDataParser - using cache https://raw.oborne.me/ardupilot/ardupilot/master/libraries/AP_Proximity/AP_Proximity_Params.cpp (D:\a\MissionPlanner\MissionPlanner\ExtLibs\Utilities\ParameterMetaDataParser.cs:503) [71]
2022-12-30 08:28:42,642 ERROR MissionPlanner.Utilities.ParameterMetaDataParser - Bad Key - Value @param b blue brightness
*/
void AP_FETtecOneWire::led_color(const uint8_t r, const uint8_t g, const uint8_t b)
{
    for (uint8_t i=0; i<_esc_count; i++) {
        auto &esc = _escs[i];
        if (esc.state != ESCState::RUNNING) {
            continue;
        }
        transmit_config_request(PackedMessage<LEDColour>{esc.id, LEDColour{r, g, b}});
    }
}
```
2022-12-30 09:54:09 +11:00
Dr.-Ing. Amilcar do Carmo Lucas f7d21b63a7 AP_FETTecOneWire: Fix the recent change of NUM_SERVO_CHANNELS > 24 2022-06-22 11:51:23 +10:00
Andrew Tridgell c01e21dcb3 AP_FETtecOneWire: cleanup mask handling
use unsigned masks
2022-06-10 13:46:43 +10:00
Dr.-Ing. Amilcar do Carmo Lucas 95effd59ea AP_FETtecOneWire: Fix spelling in comments (NFC) 2022-01-06 09:15:54 +11:00
Jaaaky c7b1e05f1d AP_FETtecOneWire: Fix multi #include's 2021-12-21 10:38:46 +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 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