Commit Graph

27 Commits

Author SHA1 Message Date
Andrew Tridgell 4da9c245d1 AP_FETtecOneWire: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Thomas Watson ae7170501d AP_FETtecOneWire: remove references to legacy UART order 2023-12-19 06:53:15 +11:00
Andrew Tridgell 4c2ca1e028 AP_FETtecOneWire: fixed build on periph 2023-08-24 13:06:40 +10:00
Andrew Tridgell 8c6aa02b86 AP_FETtecOneWire: removed set_blocking_writes 2023-07-12 17:06:02 +10:00
Peter Barker 14c839780a AP_FETtecOneWire: don't check MINIMIZE_FEATURES when also checking BOARD_FLASH_SIZE
we have an assertion that no board with >1MB of flash is minimized
2023-04-15 09:33:35 +10:00
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
jackhong12 4a4f361a17 all: use CLASS_NO_COPY() macro 2022-10-04 11:23:04 +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
Ruffalo-sunghwan 746e85740f AP_FETtecOneWire : correct comment spelling 2022-05-24 20:27:45 +09:00
Andy Piper ac7ee37b20 AP_FETtecOneWire: nuke clang warnings 2022-03-03 16:34:14 +11:00
murata 3eb0fca212 AP_FETtecOneWire: correct spelling mili -> milli 2022-01-31 08:55:29 +09: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 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