Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane: 4.4.1-beta1 preparation #24870

Merged
merged 25 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d0acd68
AP_UAVCAN: support Himark servo protocol
tridge Aug 21, 2023
89e8d75
AP_Logger: expand servo status logging
tridge Dec 2, 2022
97b4687
AP_PiccoloCAN: expand servo status logging
tridge Dec 2, 2022
c295eed
DroneCAN: updated DSDL
tridge Sep 2, 2023
12f1ca6
AP_UAVCAN: added Hobbywing ESC support
tridge Sep 2, 2023
6ae80ba
AP_UAVCAN: make himark servo optional in build
tridge Sep 2, 2023
09aeaf3
Tools: added himark servos and hobbywing ESCs to build options
tridge Sep 2, 2023
35a5a06
AP_Param: fixed parameter defaults array length handling
tridge Aug 19, 2023
de3aa9f
Tools: allow selection of sdcard storage
tridge Sep 4, 2023
3669d6f
GCS_MAVLink: fixed corruption of FTP reply component ID
tridge Aug 14, 2023
864c800
hwdef: add hwdef for SDMODELH7V1
peterbarker Jul 3, 2023
50c0594
bootloaders: add bootloader for SDMODELH7V1
peterbarker Jul 3, 2023
d6f002f
hwdef: qiotek: correct HAL_BATT_MONITOR_DEFAULT define name
peterbarker Aug 21, 2023
553d175
AP_HAL_ChibiOS: add 8 bi-directional dshot channels to KakuteH7-Wing
andyp1per Aug 21, 2023
b57cf09
AP_NavEKF3: Provide option to clip velocity and position innovations
priseborough Mar 7, 2023
d1c4177
AP_NavEKF3: increase innovation variance instead of clipping innovations
priseborough Jun 25, 2023
db3190a
AP_NavEKF3: Update EK3_GLITCH_RADIUS metadata
priseborough Jun 25, 2023
e6a9f7c
AP_BattMonitor: UAVCAN: allow battery reset if not using CAN SoC
IamPete1 Jun 23, 2023
83dad20
AP_HAL_Linux: update Navigator available GPIOs
Williangalvani Aug 31, 2023
5030f88
AP_HAL_ChibiOS: pull RTS lines low on Pixhawk6C to avoid glitches on …
andyp1per Jun 29, 2023
7d30c66
AP_Scripting: added log_file_content method
tridge Jun 1, 2023
7401dc2
AP_MotorsUGV: add asymmetry factor for skid-steering
Williangalvani Jun 28, 2023
a603de6
AP_HAL_ChibiOS: luminousbee5 hwdefs and default.parm update
Aug 11, 2023
57543a7
AP_Scripting: added docs for log_file_content
tridge Sep 5, 2023
5db56fe
Plane: release notes for 4.4.1-beta1
tridge Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ArduPlane/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Release 4.4.1-beta1 5th September 2023
--------------------------------------

Changes from 4.4.1

- support Himark DroneCAN servos
- support Hobbywing DroneCAN ESCs
- fixed control surface deflection on quadplanes in VTOL takeoff wait
- fixed bug in parameter default handling in SITL
- allow selection of mission sdcard storage on custom.ardupilot.org
- added support for SDMODELH7V1
- fixed battery monitor default for QiotekZealotF427 and QiotekZealotH743
- support 8 bit directional dshot channels on KakuteH7-wing
- improved handling of high vibration in EKF3 with new EK3_GLITCH_RADIUS options
- allow reset of battery SoC for DroneCAN battery monitors
- update GPIOs for Navigator board in HAL_Linux
- pull RTS lines low on Pixhawk6C on startup
- added log_file_content in scripting for aerobatics
- added asymmetry factor for skid steering on rovers
- updated defaults for luminousbee5 boards

Happy flying!

Release 4.4.0 18th August 2023
------------------------------

Expand Down
Binary file added Tools/bootloaders/SDMODELH7V1_bl.bin
Binary file not shown.
Binary file added Tools/bootloaders/SDMODELH7V1_bl.elf
Binary file not shown.
1,007 changes: 1,007 additions & 0 deletions Tools/bootloaders/SDMODELH7V1_bl.hex

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Tools/scripts/build_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def __init__(self,
Feature('Other', 'NMEA_OUTPUT', 'HAL_NMEA_OUTPUT_ENABLED', 'Enable NMEA Output', 0, None),
Feature('Other', 'BARO_WIND_COMP', 'HAL_BARO_WIND_COMP_ENABLED', 'Enable Baro Wind Compensation', 0, None),
Feature('Other', 'ADVANCED_FAILSAFE', 'AP_ADVANCEDFAILSAFE_ENABLED', 'Enable Advanced Failsafe features', 0, None),
Feature('Other', 'SDCARD_MISSION', 'AP_SDCARD_STORAGE_ENABLED', 'Enable storing mission on microSD cards', 0, None),

Feature('GPS Drivers', 'UBLOX', 'AP_GPS_UBLOX_ENABLED', 'Enable u-blox GPS', 1, None),
Feature('GPS Drivers', 'SBP2', 'AP_GPS_SBP2_ENABLED', 'Enable SBP2 GPS', 0, 'SBP'),
Expand Down Expand Up @@ -280,6 +281,8 @@ def __init__(self,
Feature('Actuators', 'Volz_DroneCAN', 'AP_DRONECAN_VOLZ_FEEDBACK_ENABLED', 'Enable Volz DroneCAN Feedback', 0, None),
Feature('Actuators', 'RobotisServo', 'AP_ROBOTISSERVO_ENABLED', 'Enable RobotisServo Protocol', 0, None),
Feature('Actuators', 'FETTecOneWire', 'AP_FETTEC_ONEWIRE_ENABLED', 'Enable FETTec OneWire ESCs', 0, None),
Feature('Actuators', 'HimarkServo', 'AP_DRONECAN_HIMARK_SERVO_ENABLED', 'Enable Himark DroneCAN servos', 0, None),
Feature('Actuators', 'HobbywingESC', 'AP_DRONECAN_HOBBYWING_ESC_ENABLED', 'Enable Hobbywing DroneCAN ESCs', 0, None),

]

Expand Down
5 changes: 5 additions & 0 deletions Tools/scripts/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def __init__(self, filename, nm="arm-none-eabi-nm"):
('AP_NOTIFY_PROFILED_ENABLED', r'ProfiLED::init_ports'),
('AP_NOTIFY_PROFILED_SPI_ENABLED', r'ProfiLED_SPI::rgb_set_id'),
('AP_NOTIFY_NEOPIXEL_ENABLED', r'NeoPixel::init_ports'),

('AP_DRONECAN_HIMARK_SERVO_ENABLED', 'AP_UAVCAN::SRV_send_himark'),
('AP_DRONECAN_HOBBYWING_ESC_ENABLED', 'AP_UAVCAN::hobbywing_ESC_update'),

('AP_SDCARD_STORAGE_ENABLED', 'StorageAccess::attach_file'),
]

def progress(self, msg):
Expand Down
40 changes: 34 additions & 6 deletions libraries/AP_BattMonitor/AP_BattMonitor_UAVCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,22 @@ void AP_BattMonitor_UAVCAN::read()
}
}

// Return true if the DroneCAN state of charge should be used.
// Return false if state of charge should be calculated locally by counting mah.
bool AP_BattMonitor_UAVCAN::use_CAN_SoC() const
{
// a UAVCAN battery monitor may not be able to supply a state of charge. If it can't then
// the user can set the option to use current integration in the backend instead.
// SOC of 127 is used as an invalid SOC flag ie system configuration errors or SOC estimation unavailable
return !(option_is_set(AP_BattMonitor_Params::Options::Ignore_UAVCAN_SoC) ||
_mppt.is_detected ||
(_soc == 127));
}

/// capacity_remaining_pct - returns true if the percentage is valid and writes to percentage argument
bool AP_BattMonitor_UAVCAN::capacity_remaining_pct(uint8_t &percentage) const
{
if ((uint32_t(_params._options.get()) & uint32_t(AP_BattMonitor_Params::Options::Ignore_UAVCAN_SoC)) ||
_mppt.is_detected ||
_soc == 127) {
// a UAVCAN battery monitor may not be able to supply a state of charge. If it can't then
// the user can set the option to use current integration in the backend instead.
// SOC of 127 is used as an invalid SOC flag ie system configuration errors or SOC estimation unavailable
if (!use_CAN_SoC()) {
return AP_BattMonitor_Backend::capacity_remaining_pct(percentage);
}

Expand All @@ -316,6 +323,27 @@ bool AP_BattMonitor_UAVCAN::capacity_remaining_pct(uint8_t &percentage) const
return true;
}

// reset remaining percentage to given value
bool AP_BattMonitor_UAVCAN::reset_remaining(float percentage)
{
if (use_CAN_SoC()) {
// Cannot reset external state of charge
return false;
}

WITH_SEMAPHORE(_sem_battmon);

if (!AP_BattMonitor_Backend::reset_remaining(percentage)) {
// Base class reset failed
return false;
}

// Reset interim state that is used internally, this is then copied back to the main state in the read() call
_interim_state.consumed_mah = _state.consumed_mah;
_interim_state.consumed_wh = _state.consumed_wh;
return true;
}

/// get_cycle_count - return true if cycle count can be provided and fills in cycles argument
bool AP_BattMonitor_UAVCAN::get_cycle_count(uint16_t &cycles) const
{
Expand Down
7 changes: 7 additions & 0 deletions libraries/AP_BattMonitor/AP_BattMonitor_UAVCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class AP_BattMonitor_UAVCAN : public AP_BattMonitor_Backend

void mppt_set_powered_state(bool power_on) override;

// reset remaining percentage to given value
bool reset_remaining(float percentage) override;

private:
void handle_battery_info(const BattInfoCb &cb);
void handle_battery_info_aux(const BattInfoAuxCb &cb);
Expand All @@ -85,6 +88,10 @@ class AP_BattMonitor_UAVCAN : public AP_BattMonitor_Backend
static const char* mppt_fault_string(const MPPT_FaultFlags fault);
#endif

// Return true if the DroneCAN state of charge should be used.
// Return false if state of charge should be calculated locally by counting mah.
bool use_CAN_SoC() const;

AP_BattMonitor::BattMonitor_State _interim_state;
BattMonitor_UAVCAN_Type _type;

Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/KakuteH7-Wing/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ PD0 CAN1_RX CAN1
PD1 CAN1_TX CAN1

# Motors
PA8 TIM1_CH1 TIM1 PWM(1) GPIO(50)
PA8 TIM1_CH1 TIM1 PWM(1) GPIO(50) BIDIR
PE11 TIM1_CH2 TIM1 PWM(2) GPIO(51)
PE13 TIM1_CH3 TIM1 PWM(3) GPIO(52)
PE13 TIM1_CH3 TIM1 PWM(3) GPIO(52) BIDIR
PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53)
PD14 TIM4_CH3 TIM4 PWM(5) GPIO(54) BIDIR
PD15 TIM4_CH4 TIM4 PWM(6) GPIO(55)
Expand Down
11 changes: 6 additions & 5 deletions libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6C/hwdef.dat
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# hw definition file for processing by chibios_hwdef.py
# for the HolybroV6C hardware


# default to all pins low to avoid ESD issues
#DEFAULTGPIO OUTPUT LOW PULLDOWN

# MCU class and specific type
MCU STM32H7xx STM32H743xx

Expand Down Expand Up @@ -35,9 +39,6 @@ SERIAL_ORDER OTG1 UART7 UART5 USART1 UART8 USART2 USART3 OTG2
# default the 2nd interface to MAVLink2
define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2

# default to all pins low to avoid ESD issues
DEFAULTGPIO OUTPUT LOW PULLDOWN

# USB
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
Expand All @@ -50,13 +51,13 @@ PA14 JTCK-SWCLK SWD
# telem1
PE8 UART7_TX UART7
PE7 UART7_RX UART7
PE9 UART7_RTS UART7
PE9 UART7_RTS UART7 LOW PULLDOWN
PE10 UART7_CTS UART7

# telem2
PC12 UART5_TX UART5
PD2 UART5_RX UART5
PC8 UART5_RTS UART5
PC8 UART5_RTS UART5 LOW PULLDOWN
PC9 UART5_CTS UART5

# GPS1
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotF427/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ PB1 BATT2_VOLTAGE_SENS ADC1 SCALE(2)
PC4 VDD_5V_SENS ADC1 SCALE(2)
PC5 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(12)

define HAL_BATT_MONITOR 4
define HAL_BATT_MONITOR_DEFAULT 4
define HAL_BATT_VOLT_PIN 13
define HAL_BATT_CURR_PIN 12
define HAL_BATT_VOLT_SCALE 20
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/QioTekZealotH743/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ PC5 PRESSURE_SENS ADC1 SCALE(2)
PB1 RSSI_IN ADC1 SCALE(2)

# setup the parameter for the ADC power module
define HAL_BATT_MONITOR 4
define HAL_BATT_MONITOR_DEFAULT 4
define HAL_BATT_VOLT_PIN 16
define HAL_BATT_CURR_PIN 17
define HAL_BATT_VOLT_SCALE 20.000
Expand Down
183 changes: 183 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SDMODELH7V1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
## SDMODEL SDH7 V1

![SDH7V1](SDH7V1_top.png)

![SDH7V1](SDH7V1_bottom.png)

above image and some content courtesy of SDMODEL

## Specifications¶

Processor
STM32H743 32-bit processor
AT7456E OSD
128 MByte flash for logging

Sensors
BMI270 IMU (accel and gyro only, no compass)
BMP280 barometer

Power
2S - 8S Lipo input voltage with voltage monitoring
9V, 1.5A BEC for powering Video Transmitter

Interfaces
9x PWM outputs (9th pwm output is for NeoPixel LED string via the LED pad)
1x RC input
6x UARTs/serial for GPS and other peripherals
1x I2C port for external compass
USB-C port
Switchable VTX power
All UARTS support hardware inversion. SBUS, SmartPort, and other inverted protocols work on any UART without "uninvert hack"
External current monitor input

## Pinout

PADS

========= ===================
Pin Function
========= ===================
VTX 9v 9V for HD System or other VTX, by default ON/OFF is controlled by RELAY2. See Relay Switch Can be controlled by RELAY2
SDA, SCL I2C connection (for peripherals)
5V 5v output (1.5A max)
3v3 3.3v output (0.25A max)
Vi Video input from FPV camera
Vo Video output to video transmitter
CAM To camera OSD control
G or GND Ground
RSI Analog RSSI (0-3.3v) input from receiver
R3, T3 UART3 RX and TX
R4, T4 UART4 RX and TX
R6, T6 UART6 RX and TX (UART6 RX is also located in the SH plug)
LED WS2182 addressable LED signal wire
Z- Piezo buzzer negative leg
========= ===================

Connectors

ESC PORT1 (JST-SH-8P-1)
========= ===================
Pin Function
========= ===================
B+ Battery positive voltage (2S-8S)
R7 UART7 RX
GND Ground
CURRENT CURRENT
M1 Motor signal output 1
M2 Motor signal output 2
M3 Motor signal output 3
M4 Motor signal output 4
========= ===================

ESC PORT2 (JST-SH-8P-2)
========= ===================
Pin Function
========= ===================
B+ Battery positive voltage (2S-8S)
R7 UART7 RX
GND Ground
CURRENT CURRENT
M5 Motor signal output 5
M6 Motor signal output 6
M7 Motor signal output 7
M8 Motor signal output 8
========= ===================

DJI Connector JST-SH-6P-3
========= ===================
Pin Function
========= ===================
Vtx+ 9V for HD System or other VTX, by default ON/OFF is controlled by RELAY2. See Relay Switch
G Ground
T1 UART1 TX
R1 UART1 RX
G Ground
R6 UART6 RX
========= ===================

## UART Mapping¶

The UARTs are marked Rn and Tn in the above pinouts. The Rn pin is the receive pin for UARTn. The Tn pin is the transmit pin for UARTn.

- SERIAL0 -> USB
- SERIAL1 -> UART1 (Telem1) DMA-enabled
- SERIAL2 -> not available externally, internally connected to currently unsupported BT-LE module
- SERIAL3 -> UART3 (SmartAudio VTX protocol by default)
- SERIAL4 -> UART4 (GPS) DMA-enabled
- SERIAL5 -> not available
- SERIAL6 -> UART6 (Setup for serial RX Protocol SBUS by default) DMA-enabled
- SERIAL7 -> UART7 (RX7 only available, normally used for ESC telemetry protocol by default)

The SERIAL7 port (UART7) is normally for ESC telemetry, and has an R7 pin on both of the ESC connectors.

Any UART may be re-tasked by changing its protocol parameter.

## Copter Default Frame Type¶

For Copter firmware the FRAME_TYPE is already defaulted to type "12" (BetaFlight X) allowing existing BetaFlight configurations with ESCs attached to have the correct motor ordering without changes to the FRAME_TYPE and FRAME_CLASS parameters or ESC wiring.

## RC Input¶

RC input is configured on the R6 (UART6_RX) pin. It supports all RC protocols except PPM. See Radio Control Systems for details for a specific RC system. SERIAL6_PROTOCOL is set to "23", by default, to enable this.

- SBUS/DSM/SRXL connects to the R6 pin.
- FPort requires connection to T6 and SERIAL6_OPTIONS be set to "7".
- CRSF also requires a T6 connection, in addition to R6, and automatically provides telemetry. Set SERIAL6_OPTIONS to "0".
- SRXL2 requires a connecton to T6 and automatically provides telemetry. Set SERIAL6_OPTIONS to "4".

Any UART can be used for RC system connections in ArduPilot also, and is compatible with all protocols except PPM. See Radio Control Systems for details.
FrSky Telemetry¶

FrSky Telemetry is supported using the Tx pin of any UART. You need to set the following parameters to enable support for FrSky S.PORT (example shows SERIAL2).

- SERIAL2_PROTOCOL 10
- SERIAL2_OPTIONS 7

## OSD Support¶

The SDH7V1 supports OSD using OSD_TYPE 1 (MAX7456 driver). The defaults are also setup to allow DJI Goggle OSD support on UART1.
PWM Output¶

The KakuteH7 supports up to 8 PWM outputs. Outputs are available via two JST-SH connectors. All 8 outputs support DShot and bi-directional DShot, as well as all PWM types.

The PWM is in 3 groups:

- PWM 1, 2 in group1
- PWM 3, 4 in group2
- PWM 5, 6 in group3
- PWM 7, 8 in group4
- PWM 9 (LED) in group5

Channels within the same group need to use the same output rate, whether PWM or Dshot. If any channel in a group uses DShot then all channels in the group need to use DShot.

## LED Output¶

The LED output is configured by default to support NeoPixel LED strings.
Battery Monitoring¶

The board has a built-in voltage sensor via the B+ pin, but no internal current sensor. An external current sensor can be connected to the CUR pin.

The correct battery setting parameters are:

- BATT_MONITOR 4
- BATT_VOLT_PIN 10
- BATT_CURR_PIN 11
- BATT_VOLT_MULT 10.1
- BATT_AMP_PERVLT varies depending on external current sensor

## Compass¶

The SDMODEL SDH7V1 does not have a built-in compass, however you can attach an external compass using I2C on the SDA and SCL pads.
Firmware¶

## Loading Firmware¶

Initial firmware load can be done with DFU by plugging in USB with the bootloader button pressed. Then you should load the "with_bl.hex" firmware, using your favourite DFU loading tool.

Once the initial firmware is loaded you can update the firmware using any ArduPilot ground station software. Later updates should be done with the *.apj firmware files.

## Connection Diagram

![SDH7V1](SDH7V1_connection.png)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SDMODELH7V1/defaults.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include ../KakuteH7v2/defaults.parm
4 changes: 4 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SDMODELH7V1/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include ../KakuteH7v2/hwdef-bl.dat

# board ID for firmware load
APJ_BOARD_ID 1111
4 changes: 4 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SDMODELH7V1/hwdef.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include ../KakuteH7v2/hwdef.dat

# board ID for firmware load
APJ_BOARD_ID 1111
Loading
Loading