Skip to content

Commit

Permalink
Updates of Oneloop Controller (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmldeponti authored Oct 1, 2024
1 parent 77b0daf commit 0bb4700
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 149 deletions.
18 changes: 9 additions & 9 deletions conf/airframes/tudelft/rotwing_v3c_oneloop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@

<!-- Can bus 1 actuators -->
<servos driver="Uavcan1">
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="8191"/>
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="7372"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="7372"/>
</servos>

<!-- CAN BUS 1 command outputs-->
Expand All @@ -167,10 +167,10 @@

<!-- Can bus 2 actuators -->
<servos driver="Uavcan2">
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="7372"/>
</servos>

<!-- CAN BUS 2 command outputs-->
Expand Down
20 changes: 11 additions & 9 deletions conf/airframes/tudelft/rotwing_v3c_oneloop_optitrack.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@

<!-- Can bus 1 actuators -->
<servos driver="Uavcan1">
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="8191"/>
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="7372"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="7372"/>
</servos>

<!-- CAN BUS 1 command outputs-->
Expand All @@ -168,10 +168,10 @@

<!-- Can bus 2 actuators -->
<servos driver="Uavcan2">
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="7372"/>
</servos>

<!-- CAN BUS 2 command outputs-->
Expand Down Expand Up @@ -277,6 +277,8 @@
</section>

<section PREFIX="ONELOOP_ANDI_" NAME="ONELOOP_ANDI">
<define name = "HEADING_MANUAL" value = "TRUE"/>
<define name = "YAW_STICK_IN_AUTO" value = "TRUE"/>
<define name = "MAX_R" value = "120.0" unit="deg/s"/>
<define name = "FILT_CUTOFF" value = "3.0" />
<define name = "FILT_CUTOFF_ACC" value = "3.0"/>
Expand Down
40 changes: 11 additions & 29 deletions conf/airframes/tudelft/rotwing_v3c_oneloop_optitrack_ext_pose.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@

<!-- Can bus 1 actuators -->
<servos driver="Uavcan1">
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="8191"/>
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="7372"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="7372"/>
</servos>

<!-- CAN BUS 1 command outputs-->
Expand All @@ -160,10 +160,10 @@

<!-- Can bus 2 actuators -->
<servos driver="Uavcan2">
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="7372"/>
</servos>

<!-- CAN BUS 2 command outputs-->
Expand Down Expand Up @@ -262,6 +262,8 @@
</section>

<section PREFIX="ONELOOP_ANDI_" NAME="ONELOOP_ANDI">
<define name = "HEADING_MANUAL" value = "TRUE"/>
<define name = "YAW_STICK_IN_AUTO" value = "TRUE"/>
<define name = "MAX_R" value = "120.0" unit="deg/s"/>
<define name = "FILT_CUTOFF" value = "3.0" />
<define name = "FILT_CUTOFF_ACC" value = "3.0"/>
Expand Down Expand Up @@ -297,26 +299,6 @@
<define name="IXX_WING" value="0.08099"/>
<define name="IYY_WING" value="0.1949"/>
<define name="M" value="6.67"/>

<define name="DM_DPPRZ_HOVER_PITCH" value="0.001537287553553"/>
<define name="DM_DPPRZ_HOVER_ROLL" value="{5.86747416762564,0.001936126151564}"/>

<define name="HOVER_ROLL_PITCH_COEF" value="{0.001418491625685,-0.000649367806611}"/>
<define name="HOVER_ROLL_ROLL_COEF" value="{-0.0000839259143513,-0.0000478083}"/>

<define name="K_ELEVATOR" value="{0.4603,-4.81466,-28.8464}"/>
<define name="K_RUDDER" value="{-26.1434,-0.336403,-5.9}"/>
<define name="K_AILERON" value="2.777647188"/>
<define name="K_FLAPERON" value="2.0439"/>
<define name="K_PUSHER" value="{0.007777,-0.67521}"/>

<define name="K_ELEVATOR_DEFLECTION" value="{50.0,-0.0063}"/>
<define name="D_RUDDER_D_PPRZ" value="-0.0018"/>
<define name="K_RPM_PPRZ_PUSHER" value="{-116.518697071689,1.17051409813432,-0.00002580110593734}"/>

<define name="K_LIFT_WING" value="{-0.335811392,-0.615611143}"/>
<define name="K_LIFT_FUSELAGE" value="-0.050653927"/>
<define name="K_LIFT_TAIL" value="-0.101691751"/>
</section>

<section name="AUTOPILOT">
Expand Down
18 changes: 9 additions & 9 deletions conf/airframes/tudelft/rotwing_v3c_oneloop_simulation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@

<!-- Can bus 1 actuators -->
<servos driver="Uavcan1">
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="8191"/>
<servo no="0" name="MOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="MOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="MOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="MOTOR_LEFT" min="0" neutral="600" max="7372"/>
<servo no="4" name="MOTOR_PUSH" min="0" neutral="200" max="7372"/>
</servos>

<!-- CAN BUS 1 command outputs-->
Expand All @@ -131,10 +131,10 @@

<!-- Can bus 2 actuators -->
<servos driver="Uavcan2">
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="8191"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="8191"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="8191"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="8191"/>
<servo no="0" name="BMOTOR_FRONT" min="0" neutral="600" max="7372"/>
<servo no="1" name="BMOTOR_RIGHT" min="0" neutral="600" max="7372"/>
<servo no="2" name="BMOTOR_BACK" min="0" neutral="600" max="7372"/>
<servo no="3" name="BMOTOR_LEFT" min="0" neutral="600" max="7372"/>
</servos>

<!-- CAN BUS 2 command outputs-->
Expand Down
7 changes: 7 additions & 0 deletions conf/userconf/tudelft/RW_control_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,13 @@
<arg flag="-c" constant="*:telemetry:ACTUATOR_STATE:u[7]"/>
<arg flag="-c" constant="*:telemetry:ACTUATOR_STATE:u[8]"/>
</program>
<program name="Real-time Plotter">
<arg flag="-m" constant="1000"/>
<arg flag="-u" constant="0.05"/>
<arg flag="-t" constant="u"/>
<arg flag="-c" constant="*:telemetry:ROTATING_WING_STATE:wing_angle_deg_sp"/>
<arg flag="-c" constant="*:telemetry:ROTATING_WING_STATE:wing_angle_deg"/>
</program>
</session>
<session name="Raw Sensors">
<program name="Data Link">
Expand Down
17 changes: 14 additions & 3 deletions conf/userconf/tudelft/conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,12 @@
<aircraft
name="RW3C_DePonti"
ac_id="95"
airframe="airframes/tudelft/rotwing_v3c_oneloop.xml"
airframe="airframes/tudelft/rot_wing_v3c_oneloop_optitrack_ext_pose.xml"
radio="radios/crossfire_sbus.xml"
telemetry="telemetry/highspeed_rotorcraft.xml"
flight_plan="flight_plans/tudelft/oneloop_valkenburg.xml"
flight_plan="flight_plans/tudelft/oneloop_cyberzoo.xml"
settings="settings/rotorcraft_basic.xml settings/control/rotorcraft_speed.xml"
settings_modules="modules/air_data.xml modules/airspeed_ms45xx_i2c.xml modules/airspeed_uavcan.xml modules/eff_scheduling_rotwing_V2.xml modules/electrical.xml modules/gps.xml modules/gps_ublox.xml modules/guidance_pid_rotorcraft.xml [modules/guidance_rotorcraft.xml] modules/imu_common.xml modules/imu_heater.xml modules/ins_ekf2.xml modules/lidar_tfmini.xml modules/logger_sd_chibios.xml modules/nav_hybrid.xml modules/nav_rotorcraft.xml modules/oneloop_andi.xml modules/rotwing_automation.xml modules/rotwing_state_V2.xml"
settings_modules="modules/air_data.xml modules/airspeed_ms45xx_i2c.xml modules/airspeed_uavcan.xml modules/eff_scheduling_rot_wing_V2.xml modules/electrical.xml modules/gps.xml modules/guidance_pid_rotorcraft.xml [modules/guidance_rotorcraft.xml] modules/imu_common.xml modules/imu_heater.xml modules/lidar_tfmini.xml modules/logger_sd_chibios.xml modules/nav_hybrid.xml modules/nav_rotorcraft.xml modules/oneloop_andi.xml modules/rot_wing_automation.xml modules/rotwing_state_V2.xml"
gui_color="#ffffcccaccca"
/>
<aircraft
Expand Down Expand Up @@ -649,6 +649,17 @@
gui_color="red"
/>
<aircraft
name="RW3_AG"
ac_id="38"
airframe="airframes/AG/rot_wing_v3c_oneloop_optitrack_ext_pose_AG.xml"
radio="radios/crossfire_sbus.xml"
telemetry="telemetry/highspeed_rotorcraft.xml"
flight_plan="flight_plans/tudelft/oneloop_cyberzoo.xml"
settings="settings/rotorcraft_basic.xml settings/control/rotorcraft_speed.xml"
settings_modules="modules/air_data.xml modules/airspeed_ms45xx_i2c.xml modules/airspeed_uavcan.xml modules/eff_scheduling_rot_wing_V2.xml modules/electrical.xml modules/gps.xml modules/guidance_pid_rotorcraft.xml [modules/guidance_rotorcraft.xml] modules/imu_common.xml modules/imu_heater.xml modules/lidar_tfmini.xml modules/logger_sd_chibios.xml modules/nav_hybrid.xml modules/nav_rotorcraft.xml modules/oneloop_andi.xml modules/rot_wing_automation.xml modules/rotwing_state_V2.xml"
gui_color="#ffffcccaccca"
/>
<aircraft
name="RotatingWingV3C"
ac_id="34"
airframe="airframes/tudelft/rotwing_v3c_oneloop.xml"
Expand Down
Loading

0 comments on commit 0bb4700

Please sign in to comment.