T4 actuators and T4 AOA now usable in Paparazzi master (#3401)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled

* T4 actuators and T4 AOA now usable in Paparazzi master

* Rename ACTUATORS_T4_UART_DEV to ACTUATORS_T4_UART_PORT

since build failure on semaphore test  gave:
modules/actuators/actuators_t4_uart.c:194:19: error: ‘ACTUATORS_T4_PORT’ undeclared

* Rename ACTUATORS_T4_UART_PORT to ACTUATORS_T4_PORT

Wrongly named, FYI since for the future plans port could be as well CAN or I2C type no specific reference to UART device just plain ACTUATORS_T4_PORT
This commit is contained in:
OpenUAS
2025-10-19 19:55:09 +02:00
committed by GitHub
parent f6b8c3f798
commit b4ba0dac47
20 changed files with 2369 additions and 36 deletions
+9
View File
@@ -265,6 +265,15 @@
<field name="stamp" type="uint32_t" unit="us"/>
<field name="relpos" type="struct RelPosNED *"/>
</message>
<message name="ACTUATORS_T4_OUT" id="40">
<field name="actuators_t4_out_ptr" type="struct ActuatorsT4Out *">Pointer pointing at the actuators_t4_out struct</field>
<field name="actuators_t4_extra_data_out_ptr" type="float *">Pointer pointing at the actuators_t4_extra_data_out array</field>
</message>
<message name="ACTUATORS_T4_IN" id="41">
<field name="actuators_t4_in_ptr" type="struct ActuatorsT4In *">Pointer pointing at the actuators_t4_in struct</field>
<field name="actuators_t4_extra_data_in_ptr" type="float *">Pointer pointing at the actuators_t4_extra_data_in array</field>
</message>
</msg_class>
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="actuators_t4" dir="actuators" task="actuators">
<doc>
<description>
Intermediate Actuators Driver when using a T4 actuators board
</description>
</doc>
<dep>
<depends>actuators</depends>
<provides>actuators</provides>
</dep>
<header>
<file name="actuators_t4.h"/>
</header>
<makefile>
<file_arch name="actuators_t4_arch.c"/>
</makefile>
</module>
+42
View File
@@ -0,0 +1,42 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="actuators_t4_uart" dir="actuators" task="actuators">
<doc>
<description>
Actuators Driver using T4 protocol to a T4 actuators board via UART bus.
If you have a T4 Actuator Board, use this module to set serialbus servos, PWM ESC's, DShot ESC's and PWM servos connected to a T4 Actuators Board.
Prominent use-case is that one can use status information that is returned in the autopilot control loop.
All the information like: RPM, Angle, Torque, Temperature, Current, usable state information for more precisly contolled flights.
For the hardware and software used to make your own T4 Actuators board, find all information here: https://github.com/tudelft/t4_actuators_board/
</description>
<configure name="ACTUATORS_T4_PORT" value="UARTX" description="UART port the T4 board is connected to (default uart2)"/>
<configure name="ACTUATORS_T4_BAUD" value="B921600" description="Baudrate for the Flightcontroller to T4 actuators board, make they are the same (default B1500000)"/>
</doc>
<header>
<file name="actuators_t4_uart.h"/>
</header>
<init fun="actuators_t4_uart_init()"/>
<event fun="actuators_t4_uart_event()"/>
<makefile target="ap|fbw">
<configure name="ACTUATORS_T4_PORT" default="uart2" case="upper|lower"/>
<configure name="ACTUATORS_T4_BAUD" default="B1500000"/>
<define name="USE_$(ACTUATORS_T4_PORT_UPPER)"/>
<define name="USE_$(ACTUATORS_T4_PORT_UPPER)_TX" value="TRUE"/>
<define name="ACTUATORS_T4_PORT" value="$(ACTUATORS_T4_PORT_LOWER)"/>
<define name="$(ACTUATORS_T4_PORT_UPPER)_BAUD" value="$(ACTUATORS_T4_BAUD)"/>
<file name="actuators_t4_uart.c" dir="modules/actuators"/>
</makefile>
<makefile target="sim|nps">
<define name="ACTUATORS_T4_SIM" value="TRUE"/>
<configure name="ACTUATORS_T4_PORT" default="UART4" case="upper|lower"/>
<configure name="ACTUATORS_T4_BAUD" default="B1500000"/>
<define name="ACTUATORS_T4_PORT" value="$(ACTUATORS_T4_PORT_LOWER)"/>
<file name="actuators_t4_uart.c" dir="modules/actuators"/>
<test>
<define name="USE_UART2"/>
<define name="PERIODIC_FREQUENCY" value="500"/>
<define name="ACTUATORS_T4_PORT" value="uart2"/>
</test>
</makefile>
</module>
+75
View File
@@ -0,0 +1,75 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="aoa_t4" dir="sensors">
<doc>
<description>
Angle of Attack (AOA) sensor using angle input from a modiefied hall servo connected to a T4 Actuators Board.
For the hardware and software used to make your own T4 Actuators board, find all information here:
https://github.com/tudelft/t4_actuators_board/
To make it work, the motor of the servo needs to be removed, only the hall sensors is used for angle feedback.
If the MOTOR is NOT REMOVED from the servo there will be to much friction and the sensor will NOT WORK properly.
Budget wise it is a flexible solution for angle of attack sensor if one uses a T4 Actuators Board already.
Aditionall a second servo can added to be assigned to fuction as a SideSlip angle (SSA) sensor.
If SSA is added, it is assumed that both sensors are the same, offset and direction can be set to different values.
A Servo modified for sensor use which works well is a Feetech STS3032. It is a 360 degree serial bus servo with hall sensor feedback.
Simply add the "aoa_t4" module to your myname_airframe.xml file to be able to use this solution.
Also for initial offset determination, enabeling the SYNC message is very helpfull. Just add the SYNC_SEND_AOA_T4 define.
For a 3D design of a vane that can be 3D printed and mounted on the servo used, download it here:
</description>
<define name="AOA_T4_SERVO_ID" value="10" description="Set the Servo ID of servo to use as an Angle Of Attack(AOA) sensor."/>
<define name="AOA_T4_ANGLE_OFFSET" value="3.14" description="How the sensor is physically mounted, a global offset in radian corresponding to the sensor mounting (default: 3.14)"/>
<define name="AOA_T4_OFFSET" value="-0.123" description="Initial offset on the neutral angle value."/>
<define name="AOA_T4_REVERSE" value="TRUE|FALSE" description="Set to TRUE to reverse AOA output rotation direction (sign)"/>
<define name="AOA_T4_USE_FILTER" value="TRUE|FALSE" description="Filter the AOA angle sensor output to avoid to much angle fluctuation"/>
<define name="AOA_T4_FILTER" value="0.08" description="If filtered is true, then set how much to filter the output"/>
<define name="AOA_T4_SYNC_SEND" value="TRUE|FALSE" description="Enable telemetry report from AOA or SSA sensor, best set to TRUE to determine the neutral angle to set in offset"/>
<define name="AOA_T4_USE_COMPENSATION" value="TRUE|FALSE" description="Compensate the output"/>
<define name="USE_AOA" value="TRUE|FALSE" description="Enable AOA sensor values to the state (default: TRUE)"/>
<define name="AOA_T4_COMP_A1" value="0.0" description=""/>
<define name="AOA_T4_COMP_B1" value="0.0" description=""/>
<define name="AOA_T4_COMP_A2" value="-0.34" description=""/>
<define name="AOA_T4_COMP_B2" value="0.0" description=""/>
<!-- Optionally if a SideSlip Angle(SSA) sensor is available -->
<define name="SSA_T4_SERVO_ID" value="9" description="Set the Servo ID of servo to use as an SideSlip Angle(SSA) sensor"/>
<define name="SSA_T4_ANGLE_OFFSET" value="3.14" description="How the sensor is physically mounted, a global offset in radian corresponding to the sensor mounting (default: 3.14)"/>
<define name="SSA_T4_OFFSET" value="-0.456" description="Initial offset on the neutral angle value."/>
<define name="SSA_T4_REVERSE" value="TRUE|FALSE" description="Set to TRUE to reverse AOA output rotation direction (sign)"/>
<define name="SSA_T4_USE_FILTER" value="TRUE|FALSE" description="Filter the AOA angle sensor output to avoid to much angle fluctuation"/>
<define name="SSA_T4_FILTER" value="0.15" description="If filtered is true, then set how much to filter the output"/>
<define name="USE_SIDESLIP" value="TRUE|FALSE" description="Enable SSA sensor values into the state"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="AOA T4">
<dl_setting var="aoa_send_type" min="0" max="1" step="1" shortname="Send AOA or SSA" module="modules/sensors/aoa_t4" values="AOA|SIDESLIP"/>
<dl_setting var="aoa_t4.offset" min="-3.14" max="3.14" step="0.01" shortname="AOA Offset" module="modules/sensors/aoa_t4" param="AOA_OFFSET" unit="rad" alt_unit="deg"/>
<dl_setting var="aoa_t4.filter" min="0.0" max="0.95" step="0.01" shortname="AOA Filter" module="modules/sensors/aoa_t4" param="AOA_FILTER"/>
<dl_setting var="ssa_t4.offset" min="-3.14" max="3.14" step="0.01" shortname="SSA Offset" module="modules/sensors/aoa_t4" param="SSA_OFFSET" unit="rad" alt_unit="deg"/>
<dl_setting var="ssa_t4.filter" min="0.0" max="0.95" step="0.01" shortname="SSA Filter" module="modules/sensors/aoa_t4" param="SSA_FILTER"/>
<dl_setting var="aoa_t4_a1" min="-1" max="1" step="0.001" shortname="Comp A1" />
<dl_setting var="aoa_t4_b1" min="-1" max="1" step="0.001" shortname="Comp B1" />
<dl_setting var="aoa_t4_a2" min="-1" max="1" step="0.001" shortname="Comp A2" />
<dl_setting var="aoa_t4_b2" min="-1" max="1" step="0.001" shortname="Comp B2" />
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="aoa_t4.h"/>
</header>
<init fun="aoa_t4_init()"/>
<periodic fun="aoa_t4_update()" freq="200."/>
<makefile target="ap|sim|nps">
<file name="aoa_t4.c"/>
</makefile>
</module>
+1 -2
View File
@@ -50,7 +50,7 @@
<configure name="UBX2_GPS_BAUD" default="$(GPS2_BAUD)"/>
<define name="USE_$(UBX2_GPS_PORT_UPPER)" cond="ifneq ($(UBX2_GPS_PORT)$(SECONDARY_GPS),)"/>
<define name="UBX2_GPS_PORT" value="$(UBX2_GPS_PORT_LOWER)" cond="ifneq ($(UBX2_GPS_PORT)$(SECONDARY_GPS),)"/>
<define name="$(UBX2_GPS_PORT_UPPER)_BAUD" value="$(UBX2_GPS_BAUD)" cond="ifneq ($(UBX2_GPS_BAUD)$(SECONDARY_GPS),)"/>
<define name="$(UBX2_GPS_PORT_UPPER)_BAUD" value="$(UBX2_GPS_BAUD)" cond="ifdef SECONDARY_GPS"/>
<raw>
ifdef SECONDARY_GPS
@@ -85,4 +85,3 @@
</test>
</makefile>
</module>
@@ -0,0 +1,91 @@
<?xml version="1.0"?>
<!DOCTYPE telemetry SYSTEM "telemetry.dtd">
<telemetry>
<process name="Ap">
<mode name="default">
<message name="AUTOPILOT_VERSION" period="11.1"/>
<message name="AIRSPEED" period="1"/>
<message name="ALIVE" period="5"/>
<message name="GPS" period="0.25"/>
<message name="NAVIGATION" period="1."/>
<message name="ATTITUDE" period="0.4"/>
<message name="ESTIMATOR" period="0.5"/>
<message name="ENERGY" period="1.1"/>
<message name="WP_MOVED" period="0.4"/>
<message name="CIRCLE" period="1.05"/>
<message name="DESIRED" period="1.05"/>
<message name="SEGMENT" period="1.2"/>
<message name="CALIBRATION" period="2.1"/>
<message name="NAVIGATION_REF" period="4."/>
<message name="PPRZ_MODE" period="2."/>
<message name="SETTINGS" period="2."/>
<message name="STATE_FILTER_STATUS" period="3."/>
<message name="DATALINK_REPORT" period="5.1"/>
<message name="DL_VALUE" period="1.5"/>
<message name="IMU_GYRO" period="1.1"/>
<message name="SURVEY" period="2.1"/>
<message name="GPS_SOL" period="2.0"/>
<message name="CAM" period="0.5"/>
<message name="CAM_POINT" period="1.0"/>
<message name="COMMANDS" period="5"/>
<message name="FBW_STATUS" period="2"/>
<message name="AIR_DATA" period="0.9"/>
<message name="ACTUATORS_T4_OUT" period="0.8"/>
<message name="ACTUATORS_T4_IN" period="0.8"/>
<message name="AOA" period="0.5"/>
</mode>
<mode name="minimal">
<message name="ALIVE" period="5"/>
<message name="ATTITUDE" period="4"/>
<message name="GPS" period="1.05"/>
<message name="ESTIMATOR" period="1.3"/>
<message name="WP_MOVED" period="1.4"/>
<message name="CIRCLE" period="3.05"/>
<message name="DESIRED" period="4.05"/>
<message name="ENERGY" period="1.1"/>
<message name="SEGMENT" period="3.2"/>
<message name="CALIBRATION" period="5.1"/>
<message name="NAVIGATION_REF" period="9."/>
<message name="NAVIGATION" period="3."/>
<message name="PPRZ_MODE" period="5."/>
<message name="STATE_FILTER_STATUS" period="5."/>
<message name="DATALINK_REPORT" period="5.1"/>
<message name="DL_VALUE" period="1.5"/>
<message name="IMU_GYRO" period="10.1"/>
<message name="SURVEY" period="2.1"/>
<message name="GPS_SOL" period="5.0"/>
</mode>
<mode name="extremal">
<message name="ALIVE" period="5"/>
<message name="GPS" period="5.1"/>
<message name="ESTIMATOR" period="5.3"/>
<message name="ENERGY" period="10.1"/>
<message name="DESIRED" period="10.2"/>
<message name="NAVIGATION" period="5.4"/>
<message name="PPRZ_MODE" period="5.5"/>
<message name="STATE_FILTER_STATUS" period="7."/>
<message name="DATALINK_REPORT" period="5.7"/>
</mode>
<mode name="raw_sensors">
<message name="DL_VALUE" period="0.5"/>
<message name="ALIVE" period="2.1"/>
<message name="BARO_RAW" period="0.5"/>
<message name="IMU_GYRO_RAW" period="0.1"/>
<message name="AIRSPEED_RAW" period="0.5"/>
</mode>
</process>
<process name="Fbw">
<mode name="default">
<message name="COMMANDS" period="5"/>
<message name="FBW_STATUS" period="2"/>
<message name="ACTUATORS" period="5"/> <!-- For trimming -->
</mode>
<mode name="debug">
<message name="PPM" period="0.5"/>
<message name="RC" period="0.5"/>
<message name="COMMANDS" period="0.5"/>
<message name="FBW_STATUS" period="1"/>
<message name="ACTUATORS" period="5"/> <!-- For trimming -->
</mode>
</process>
</telemetry>
+11
View File
@@ -1,4 +1,15 @@
<conf>
<aircraft
name="Seal_EVO"
ac_id="136"
airframe="airframes/OPENUAS/openuas_atomrc_seal_evo.xml"
radio="radios/OPENUAS/openuas_openrxsr_sbus_16_out.xml"
telemetry="telemetry/t4_actuators_board_debugdata.xml"
flight_plan="flight_plans/basic.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/ahrs_float_cmpl_quat.xml modules/air_data.xml modules/airspeed_sdp3x.xml modules/aoa_t4.xml modules/electrical.xml modules/geo_mag.xml modules/gps.xml modules/gps_ublox.xml modules/guidance_full_pid_fw.xml modules/imu_common.xml modules/imu_heater.xml modules/nav_basic_fw.xml modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/photogrammetry_calculator.xml modules/stabilization_adaptive_fw.xml modules/tune_airspeed.xml"
gui_color="yellow"
/>
<aircraft
name="Minimag"
ac_id="233"
+61 -32
View File
@@ -36,8 +36,6 @@
</program>
<program name="Hardware in the Loop" command="sw/simulator/simhitl"/>
<program name="Environment Simulator" command="sw/simulator/gaia"/>
<program name="Attitude Visualizer" command="sw/tools/attitude_viz.py"/>
<program name="App Server" command="sw/ground_segment/tmtc/app_server"/>
<program name="Ivy2Nmea" command="sw/ground_segment/tmtc/ivy2nmea">
@@ -165,33 +163,6 @@
</program>
<program name="Link Combiner"/>
</session>
<session name="OpenUAS testflights 2020">
<program name="GCS">
<arg flag="-speech"/>
<arg flag="-layout" constant="OPENUAS/openuas_bottom_settings.xml"/>
<arg flag="-maximize"/>
<arg flag="-maps_fill"/>
<arg flag="-center_ac"/>
<arg flag="-mercator"/>
<arg flag="-maps_no_http"/>
<arg flag="-track_size" constant="200"/>
<arg flag="-zoom" constant="0.5"/>
<arg flag="-no_confirm_kill"/>
<arg flag="-srtm"/>
</program>
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyUSB0"/>
<arg flag="-s" constant="57600"/>
</program>
<program name="Server"/>
</session>
<session name="Flight USB-serial@9600">
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyUSB0"/>
</program>
<program name="Server"/>
<program name="GCS"/>
</session>
<session name="SupperBitRF cable telemetry">
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyACM1"/>
@@ -200,7 +171,6 @@
<program name="Server"/>
<program name="GCS"/>
<program name="Messages"/>
<program name="Messages"/>
</session>
<session name="Accelo only Debug Graphs">
<program name="Real-time Plotter">
@@ -246,7 +216,7 @@
</session>
<session name="OU Simulation">
<program name="Simulator">
<arg flag="-a" constant="VivifyMK1"/>
<arg flag="-a" constant="@AIRCRAFT"/>
<arg flag="-t" constant="sim"/>
<arg flag="--boot"/>
<arg flag="--norc"/>
@@ -258,6 +228,35 @@
<program name="Environment Simulator"/>
<program name="Messages"/>
</session>
<session name="OUAS Replay flight">
<program name="Log Plotter"/>
<program name="Log File Player"/>
<program name="Server">
<arg flag="-n"/>
</program>
<program name="GCS">
<arg flag="-speech"/>
<arg flag="-layout" constant="OPENUAS/openuas_bottom_settings.xml"/>
<arg flag="-maximize"/>
<arg flag="-maps_fill"/>
<arg flag="-center_ac"/>
<arg flag="-mercator"/>
<arg flag="-maps_no_http"/>
<arg flag="-track_size" constant="200"/>
<arg flag="-zoom" constant="0.5"/>
<arg flag="-no_confirm_kill"/>
<arg flag="-srtm"/>
</program>
</session>
<session name="OpenUAS Forward AC via UDP">
<program name="Ivy2Udp">
<arg flag="-b" constant="127:2010"/>
<arg flag="-h" constant="192.168.78.1"/>
<arg flag="-p" constant="4242"/>
<arg flag="-dp" constant="4243"/>
<arg flag="-id" constant="16"/>
</program>
</session>
<session name="OpenUAS Simulation with OBC GUI">
<program name="GCS">
<arg flag="-speech"/>
@@ -271,12 +270,42 @@
<arg flag="-n"/>
</program>
<program name="Simulator">
<arg flag="-a" constant="VivfifyMK1"/>
<arg flag="-a" constant="@AIRCRAFT"/>
<arg flag="-boot"/>
<arg flag="-norc"/>
</program>
<program name="Environment Simulator"/>
</session>
<session name="OpenUAS testflights 2024">
<program name="GCS">
<arg flag="-speech"/>
<arg flag="-layout" constant="OPENUAS/openuas_bottom_settings.xml"/>
<arg flag="-maximize"/>
<arg flag="-maps_fill"/>
<arg flag="-center_ac"/>
<arg flag="-mercator"/>
<arg flag="-maps_no_http"/>
<arg flag="-track_size" constant="200"/>
<arg flag="-zoom" constant="0.5"/>
<arg flag="-no_confirm_kill"/>
<arg flag="-srtm"/>
</program>
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyUSB0"/>
<arg flag="-s" constant="57600"/>
</program>
<program name="Server"/>
</session>
<session name="Desktest">
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyUSB0"/>
<arg flag="-s" constant="57600"/>
</program>
<program name="Server"/>
<program name="GCS"/>
<program name="Messages"/>
<program name="Real-time Plotter"/>
</session>
<session name="Raw Sensors">
<program name="Data Link">
<arg flag="-d" constant="/dev/ttyUSB0"/>