fix(airframes/10042): correct sihsim_xvert sign error

The sihsim_xvert currently tumbles immediately on takeoff. Here is why:

generate_ts_aerodynamics in sih.cpp calculates elevon torques.
everything is rotated into the fixed-wing frame, in which
 - positive _u[4] (configured as CA_SV_CS0) generates positive FW roll
   torque (left wing pushed up)
 - positive _u[5] (configured as CA_SV_CS1) generates positive FW roll
   torque (right wing pushed down, note the additional minus)

So in the FW frame, they work like this:
 - positive _u[4] + _u[5] -> positive FW roll torque
 - positive _u[4] - _u[5] -> positive FW pitch torque

The airframe file however configures all of these in the multicopter
frame. So accounting for the frame conversion, we have:
 - MC yaw = -FW roll = -_u[4] - _u[5]
     - because FW x points nose-forward while MC z points nose-backward
 - MC pitch = FW pitch = _u[4] - _u[5]

or in matrix form:

[  MC yaw  ]   [ -1  -1 ] [ _u[4] ]
[ MC pitch ] = [ 1   -1 ] [ _u[5] ]

and as this matrix is basically (up to scaling)

[ CS0_TRQ_Y CS1_TRQ_Y ]
[ CS0_TRQ_P CS1_TRQ_P ]

we have to change the CS1_TRQ_* coefficients to be negative.
This commit is contained in:
Balduin
2026-06-30 16:32:48 +02:00
committed by Balduin
parent f0c127e5f7
commit f17f70be6f

View File

@@ -58,8 +58,8 @@ param set-default CA_SV_CS0_TYPE 5
param set-default CA_SV_CS0_TRQ_P 0.5
param set-default CA_SV_CS0_TRQ_Y -0.5
param set-default CA_SV_CS1_TYPE 6
param set-default CA_SV_CS1_TRQ_P 0.5
param set-default CA_SV_CS1_TRQ_Y 0.5
param set-default CA_SV_CS1_TRQ_P -0.5
param set-default CA_SV_CS1_TRQ_Y -0.5
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102