Matlab code for quadcopter
Dependents: combination combination
Revision 0:25d32fc1c12e, committed 2019-11-25
- Comitter:
- Glaxys_finest1
- Date:
- Mon Nov 25 10:51:06 2019 +0000
- Commit message:
- hello1
Changed in this revision
diff -r 000000000000 -r 25d32fc1c12e LAAP.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LAAP.cpp Mon Nov 25 10:51:06 2019 +0000 @@ -0,0 +1,1113 @@ +// +// File: LAAP.cpp +// +// Code generated for Simulink model 'LAAP'. +// +// Model version : 1.2 +// Simulink Coder version : 9.1 (R2019a) 23-Nov-2018 +// C/C++ source code generated on : Mon Nov 18 17:57:49 2019 +// +// Target selection: ert.tlc +// Embedded hardware selection: ARM Compatible->ARM Cortex +// Code generation objectives: +// 1. Execution efficiency +// 2. RAM efficiency +// Validation result: Not run +// +#include "LAAP.h" + +// Model step function +void LAAPModelClass::step() +{ + static const int8_T b[3] = { 0, 1, 0 }; + + static const real_T b_0[12] = { 0.0028, 0.003, 3.1623, 0.0012, 0.0012, 3.68, + 1.6056, 1.6056, 1.0, 0.153, 0.153, 0.1 }; + + static const int8_T c[3] = { 0, 1, 0 }; + + static const real_T a[16] = { 0.25, 0.25, 0.25, 0.25, 0.0, 2.193, 0.0, -2.193, + -2.193, 0.0, 2.193, 0.0, 4.2591, -4.2591, 4.2591, -4.2591 }; + + int32_T r1; + int32_T i; + real_T Fdes_idx_2; + real_T Fdes_idx_1; + real_T Fdes_idx_0; + real_T rtb_TmpSignalConversionAtSFun_0; + real_T rtb_TmpSignalConversionAtSFun_1; + int32_T R_tmp; + int32_T b_I_tmp; + int32_T b_I_tmp_0; + + // Outputs for Atomic SubSystem: '<Root>/Adaptive large angle controller' + // Delay: '<S1>/Delay1' + memcpy(&rtDW.Delay1[0], &rtDW.psy[0], 12U * sizeof(real_T)); + + // Outputs for Atomic SubSystem: '<S1>/quadcopter_dynamics_prediction' + // MATLAB Function: '<S3>/Euler equations of motion1 ' incorporates: + // Constant: '<S1>/mass ' + // Delay: '<S1>/Delay' + // Delay: '<S3>/Delay' + // Delay: '<S3>/Delay1' + + rtDW.b_I[0] = 0.01023564759; + rtDW.b_I[3] = 0.0; + rtDW.b_I[6] = 0.0; + rtDW.b_I[1] = 0.0; + rtDW.b_I[4] = 0.01023564759; + rtDW.b_I[7] = 0.0; + rtDW.b_I[2] = 0.0; + rtDW.b_I[5] = 0.0; + rtDW.b_I[8] = 0.02047129518; + rtDW.maxval = std::cos(rtDW.Delay1_DSTATE_l[2]); + rtDW.b_I_k[0] = rtDW.maxval; + rtDW.Add1_k = std::sin(rtDW.Delay1_DSTATE_l[2]); + rtDW.b_I_k[3] = -rtDW.Add1_k; + rtDW.b_I_k[6] = 0.0; + rtDW.b_I_k[1] = rtDW.Add1_k; + rtDW.b_I_k[4] = rtDW.maxval; + rtDW.b_I_k[7] = 0.0; + rtDW.b_I_k[2] = 0.0; + rtDW.d[0] = 1.0; + rtDW.b_I_k[5] = 0.0; + rtDW.d[3] = 0.0; + rtDW.b_I_k[8] = 1.0; + rtDW.d[6] = 0.0; + rtDW.d[1] = 0.0; + Fdes_idx_0 = std::cos(rtDW.Delay1_DSTATE_l[0]); + rtDW.d[4] = Fdes_idx_0; + Fdes_idx_1 = std::sin(rtDW.Delay1_DSTATE_l[0]); + rtDW.d[7] = -Fdes_idx_1; + rtDW.d[2] = 0.0; + rtDW.d[5] = Fdes_idx_1; + rtDW.d[8] = Fdes_idx_0; + rtDW.maxval = std::cos(rtDW.Delay1_DSTATE_l[1]); + rtDW.dv0[0] = rtDW.maxval; + rtDW.dv0[3] = 0.0; + rtDW.Add1_k = std::sin(rtDW.Delay1_DSTATE_l[1]); + rtDW.dv0[6] = rtDW.Add1_k; + for (r1 = 0; r1 < 3; r1++) { + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.R_c[R_tmp] = 0.0; + rtDW.R_c[R_tmp] += rtDW.d[3 * i] * rtDW.b_I_k[r1]; + rtDW.R_c[R_tmp] += rtDW.d[3 * i + 1] * rtDW.b_I_k[r1 + 3]; + rtDW.R_c[R_tmp] += rtDW.d[3 * i + 2] * rtDW.b_I_k[r1 + 6]; + } + + rtDW.dv0[1 + 3 * r1] = b[r1]; + } + + rtDW.dv0[2] = -rtDW.Add1_k; + rtDW.dv0[5] = 0.0; + rtDW.dv0[8] = rtDW.maxval; + rtDW.w_dot[0] = 0.0; + rtDW.w_dot[1] = 0.0; + rtDW.w_dot[2] = rtDW.Delay_DSTATE[0]; + rtDW.dv2[0] = 0.0; + rtDW.dv2[1] = 0.0; + rtDW.dv2[2] = -7.3575; + for (r1 = 0; r1 < 3; r1++) { + rtDW.wb[r1] = 0.0; + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.b_I_k[R_tmp] = 0.0; + rtDW.b_I_k[R_tmp] += rtDW.dv0[3 * i] * rtDW.R_c[r1]; + rtDW.b_I_k[R_tmp] += rtDW.dv0[3 * i + 1] * rtDW.R_c[r1 + 3]; + rtDW.b_I_k[R_tmp] += rtDW.dv0[3 * i + 2] * rtDW.R_c[r1 + 6]; + rtDW.wb[r1] += rtDW.b_I_k[R_tmp] * rtDW.w_dot[i]; + } + + rtDW.a_dotdot[r1] = (rtDW.dv2[r1] + rtDW.wb[r1]) * 1.3333333333333333; + } + + rtDW.b_I_k[0] = rtDW.maxval; + rtDW.b_I_k[3] = 0.0; + rtDW.b_I_k[6] = -Fdes_idx_0 * rtDW.Add1_k; + rtDW.b_I_k[1] = 0.0; + rtDW.b_I_k[4] = 1.0; + rtDW.b_I_k[7] = Fdes_idx_1; + rtDW.b_I_k[2] = rtDW.Add1_k; + rtDW.b_I_k[5] = 0.0; + rtDW.b_I_k[8] = Fdes_idx_0 * rtDW.maxval; + for (r1 = 0; r1 < 3; r1++) { + rtDW.wb[r1] = rtDW.b_I_k[r1 + 6] * rtDW.Delay_DSTATE_h[2] + (rtDW.b_I_k[r1 + + 3] * rtDW.Delay_DSTATE_h[1] + rtDW.b_I_k[r1] * rtDW.Delay_DSTATE_h[0]); + } + + rtDW.b_I_k[0] = 0.0; + rtDW.b_I_k[3] = -rtDW.wb[2]; + rtDW.b_I_k[6] = rtDW.wb[1]; + rtDW.b_I_k[1] = rtDW.wb[2]; + rtDW.b_I_k[4] = 0.0; + rtDW.b_I_k[7] = -rtDW.wb[0]; + rtDW.b_I_k[2] = -rtDW.wb[1]; + rtDW.b_I_k[5] = rtDW.wb[0]; + rtDW.b_I_k[8] = 0.0; + rtDW.w_dot[0] = rtDW.Delay_DSTATE[1]; + rtDW.w_dot[1] = rtDW.Delay_DSTATE[2]; + rtDW.w_dot[2] = rtDW.Delay_DSTATE[3]; + for (r1 = 0; r1 < 3; r1++) { + rtDW.dv2[r1] = 0.0; + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.R_c[R_tmp] = 0.0; + rtDW.R_c[R_tmp] += rtDW.b_I[3 * i] * rtDW.b_I_k[r1]; + rtDW.R_c[R_tmp] += rtDW.b_I[3 * i + 1] * rtDW.b_I_k[r1 + 3]; + rtDW.R_c[R_tmp] += rtDW.b_I[3 * i + 2] * rtDW.b_I_k[r1 + 6]; + rtDW.dv2[r1] += rtDW.R_c[R_tmp] * rtDW.wb[i]; + } + + rtDW.Iw_dot[r1] = rtDW.w_dot[r1] - rtDW.dv2[r1]; + } + + rtDW.w_dot[1] = rtDW.Iw_dot[1] - rtDW.Iw_dot[0] * 0.0; + rtDW.w_dot[2] = (rtDW.Iw_dot[2] - rtDW.Iw_dot[0] * 0.0) - rtDW.w_dot[1] * 0.0; + rtDW.w_dot[2] /= 0.02047129518; + rtDW.w_dot[0] = rtDW.Iw_dot[0] - rtDW.w_dot[2] * 0.0; + rtDW.w_dot[1] -= rtDW.w_dot[2] * 0.0; + rtDW.w_dot[1] /= 0.01023564759; + rtDW.w_dot[0] -= rtDW.w_dot[1] * 0.0; + rtDW.w_dot[0] /= 0.01023564759; + + // DiscreteIntegrator: '<S13>/Integrator' + for (r1 = 0; r1 < 6; r1++) { + if (rtDW.Integrator_PrevResetState != 0) { + rtDW.Integrator_DSTATE_ep[r1] = 0.0; + if (rtDW.Integrator_DSTATE_ep[r1] >= 10.0) { + rtDW.Integrator_DSTATE_ep[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_ep[r1] <= -10.0) { + rtDW.Integrator_DSTATE_ep[r1] = -10.0; + } + } + } + + if (rtDW.Integrator_DSTATE_ep[r1] >= 10.0) { + rtDW.Integrator_DSTATE_ep[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_ep[r1] <= -10.0) { + rtDW.Integrator_DSTATE_ep[r1] = -10.0; + } + } + + rtDW.Integrator[r1] = rtDW.Integrator_DSTATE_ep[r1]; + } + + // DiscreteIntegrator: '<S14>/Integrator' incorporates: + // Inport: '<Root>/phi' + // Inport: '<Root>/psi' + // Inport: '<Root>/theta' + // Inport: '<Root>/x' + // Inport: '<Root>/y' + // Inport: '<Root>/z' + + if (rtDW.Integrator_IC_LOADING != 0) { + rtDW.Integrator_DSTATE_k[0] = rtU.x; + rtDW.Integrator_DSTATE_k[1] = rtU.y; + rtDW.Integrator_DSTATE_k[2] = rtU.z; + rtDW.Integrator_DSTATE_k[3] = rtU.phi; + rtDW.Integrator_DSTATE_k[4] = rtU.theta; + rtDW.Integrator_DSTATE_k[5] = rtU.psi; + for (r1 = 0; r1 < 6; r1++) { + if (rtDW.Integrator_DSTATE_k[r1] >= 10.0) { + rtDW.Integrator_DSTATE_k[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_k[r1] <= -10.0) { + rtDW.Integrator_DSTATE_k[r1] = -10.0; + } + } + } + } + + if (rtDW.Integrator_PrevResetState_n != 0) { + rtDW.Integrator_DSTATE_k[0] = rtU.x; + rtDW.Integrator_DSTATE_k[1] = rtU.y; + rtDW.Integrator_DSTATE_k[2] = rtU.z; + rtDW.Integrator_DSTATE_k[3] = rtU.phi; + rtDW.Integrator_DSTATE_k[4] = rtU.theta; + rtDW.Integrator_DSTATE_k[5] = rtU.psi; + for (r1 = 0; r1 < 6; r1++) { + if (rtDW.Integrator_DSTATE_k[r1] >= 10.0) { + rtDW.Integrator_DSTATE_k[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_k[r1] <= -10.0) { + rtDW.Integrator_DSTATE_k[r1] = -10.0; + } + } + } + } + + for (r1 = 0; r1 < 6; r1++) { + if (rtDW.Integrator_DSTATE_k[r1] >= 10.0) { + rtDW.Integrator_DSTATE_k[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_k[r1] <= -10.0) { + rtDW.Integrator_DSTATE_k[r1] = -10.0; + } + } + + rtDW.Integrator_p[r1] = rtDW.Integrator_DSTATE_k[r1]; + } + + // Update for Delay: '<S3>/Delay' incorporates: + // DiscreteIntegrator: '<S13>/Integrator' + + rtDW.Delay_DSTATE_h[0] = rtDW.Integrator_DSTATE_ep[3]; + + // Update for Delay: '<S3>/Delay1' incorporates: + // DiscreteIntegrator: '<S14>/Integrator' + + rtDW.Delay1_DSTATE_l[0] = rtDW.Integrator_DSTATE_k[3]; + + // Update for Delay: '<S3>/Delay' incorporates: + // DiscreteIntegrator: '<S13>/Integrator' + + rtDW.Delay_DSTATE_h[1] = rtDW.Integrator_DSTATE_ep[4]; + + // Update for Delay: '<S3>/Delay1' incorporates: + // DiscreteIntegrator: '<S14>/Integrator' + + rtDW.Delay1_DSTATE_l[1] = rtDW.Integrator_DSTATE_k[4]; + + // Update for Delay: '<S3>/Delay' incorporates: + // DiscreteIntegrator: '<S13>/Integrator' + + rtDW.Delay_DSTATE_h[2] = rtDW.Integrator_DSTATE_ep[5]; + + // Update for Delay: '<S3>/Delay1' incorporates: + // DiscreteIntegrator: '<S14>/Integrator' + + rtDW.Delay1_DSTATE_l[2] = rtDW.Integrator_DSTATE_k[5]; + + // Update for DiscreteIntegrator: '<S13>/Integrator' incorporates: + // MATLAB Function: '<S3>/Euler equations of motion1 ' + + rtDW.dv1[0] = 0.0001 * rtDW.a_dotdot[0]; + rtDW.dv1[1] = 0.0001 * rtDW.a_dotdot[1]; + rtDW.dv1[2] = 0.0001 * rtDW.a_dotdot[2]; + rtDW.dv1[3] = 0.0001 * rtDW.w_dot[0]; + rtDW.dv1[4] = 0.0001 * rtDW.w_dot[1]; + rtDW.dv1[5] = 0.0001 * rtDW.w_dot[2]; + rtDW.Integrator_PrevResetState = 0; + + // Update for DiscreteIntegrator: '<S14>/Integrator' + rtDW.Integrator_IC_LOADING = 0U; + for (r1 = 0; r1 < 6; r1++) { + // Update for DiscreteIntegrator: '<S13>/Integrator' + rtDW.Integrator_DSTATE_ep[r1] += rtDW.dv1[r1]; + if (rtDW.Integrator_DSTATE_ep[r1] >= 10.0) { + rtDW.Integrator_DSTATE_ep[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_ep[r1] <= -10.0) { + rtDW.Integrator_DSTATE_ep[r1] = -10.0; + } + } + + // Update for DiscreteIntegrator: '<S14>/Integrator' + rtDW.Integrator_DSTATE_k[r1] += 0.0001 * rtDW.Integrator[r1]; + if (rtDW.Integrator_DSTATE_k[r1] >= 10.0) { + rtDW.Integrator_DSTATE_k[r1] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_k[r1] <= -10.0) { + rtDW.Integrator_DSTATE_k[r1] = -10.0; + } + } + } + + // Update for DiscreteIntegrator: '<S14>/Integrator' + rtDW.Integrator_PrevResetState_n = 0; + + // End of Outputs for SubSystem: '<S1>/quadcopter_dynamics_prediction' + + // Outputs for Atomic SubSystem: '<S1>/largepaa' + // Outputs for Enabled SubSystem: '<S2>/large_controller' incorporates: + // EnablePort: '<S5>/Enable' + + // MATLAB Function: '<S5>/MATLAB Function3' incorporates: + // Constant: '<S2>/mass 1' + // Delay: '<S2>/Delay' + // Inport: '<Root>/angles' + // Inport: '<Root>/r' + // Inport: '<Root>/rdot' + // Inport: '<Root>/wb' + // Inport: '<Root>/x' + // Inport: '<Root>/y' + // Inport: '<Root>/z' + + rtDW.a_dotdot[0] = rtU.r[0] - rtU.x; + rtDW.a_dotdot[1] = rtU.r[1] - rtU.y; + rtDW.a_dotdot[2] = rtU.r[2] - rtU.z; + Fdes_idx_0 = -rtDW.Delay_DSTATE_hf[0] * rtDW.a_dotdot[0] - + rtDW.Delay_DSTATE_hf[3] * rtU.rdot[0]; + rtDW.Iw_dot[0] = rtU.rdot[0]; + rtDW.w_dot[0] = 0.0; + Fdes_idx_1 = -rtDW.Delay_DSTATE_hf[1] * rtDW.a_dotdot[1] - + rtDW.Delay_DSTATE_hf[4] * rtU.rdot[1]; + rtDW.Iw_dot[1] = rtU.rdot[1]; + rtDW.w_dot[1] = 0.0; + Fdes_idx_2 = ((-rtDW.Delay_DSTATE_hf[2] * rtDW.a_dotdot[2] - + rtDW.Delay_DSTATE_hf[5] * rtU.rdot[2]) - 7.3575) + 7.3575; + rtDW.Iw_dot[2] = rtU.rdot[2]; + rtDW.w_dot[2] = 1.0; + rtDW.maxval = std::sqrt((Fdes_idx_0 * Fdes_idx_0 + Fdes_idx_1 * Fdes_idx_1) + + Fdes_idx_2 * Fdes_idx_2); + if (rtDW.maxval == 0.0) { + rtDW.maxval = 1.0; + } + + rtDW.maxval = 1.0 / rtDW.maxval; + rtDW.Zbdes[0] = rtDW.maxval * Fdes_idx_0; + rtDW.Zbdes[1] = rtDW.maxval * Fdes_idx_1; + rtDW.Zbdes[2] = rtDW.maxval * Fdes_idx_2; + rtDW.crossZX[0] = rtDW.Zbdes[1] * 0.0 - rtDW.Zbdes[2] * 0.0; + rtDW.crossZX[1] = rtDW.Zbdes[2] - rtDW.Zbdes[0] * 0.0; + rtDW.crossZX[2] = rtDW.Zbdes[0] * 0.0 - rtDW.Zbdes[1]; + rtDW.maxval = std::sqrt((rtDW.crossZX[0] * rtDW.crossZX[0] + rtDW.crossZX[1] * + rtDW.crossZX[1]) + rtDW.crossZX[2] * rtDW.crossZX[2]); + if (rtDW.maxval == 0.0) { + rtDW.maxval = 1.0; + } + + rtDW.maxval = 1.0 / rtDW.maxval; + rtDW.Add1_k = rtDW.maxval * rtDW.crossZX[0]; + rtDW.b_I[3] = rtDW.Add1_k; + rtDW.b_I[6] = rtDW.Zbdes[0]; + rtDW.crossZX[0] = rtDW.Add1_k; + rtDW.Add1_k = rtDW.maxval * rtDW.crossZX[1]; + rtDW.b_I[4] = rtDW.Add1_k; + rtDW.b_I[7] = rtDW.Zbdes[1]; + rtDW.crossZX[1] = rtDW.Add1_k; + rtDW.Add1_k = rtDW.maxval * rtDW.crossZX[2]; + rtDW.b_I[5] = rtDW.Add1_k; + rtDW.b_I[8] = rtDW.Zbdes[2]; + rtDW.b_I[0] = rtDW.crossZX[1] * rtDW.Zbdes[2] - rtDW.Add1_k * rtDW.Zbdes[1]; + rtDW.b_I[1] = rtDW.Add1_k * rtDW.Zbdes[0] - rtDW.crossZX[0] * rtDW.Zbdes[2]; + rtDW.b_I[2] = rtDW.crossZX[0] * rtDW.Zbdes[1] - rtDW.crossZX[1] * rtDW.Zbdes[0]; + rtDW.maxval = std::cos(rtU.angles[2]); + rtDW.b_I_k[0] = rtDW.maxval; + rtDW.Add1_k = std::sin(rtU.angles[2]); + rtDW.b_I_k[3] = -rtDW.Add1_k; + rtDW.b_I_k[6] = 0.0; + rtDW.b_I_k[1] = rtDW.Add1_k; + rtDW.b_I_k[4] = rtDW.maxval; + rtDW.b_I_k[7] = 0.0; + rtDW.b_I_k[2] = 0.0; + rtDW.d[0] = 1.0; + rtDW.b_I_k[5] = 0.0; + rtDW.d[3] = 0.0; + rtDW.b_I_k[8] = 1.0; + rtDW.d[6] = 0.0; + rtDW.d[1] = 0.0; + rtDW.maxval = std::cos(rtU.angles[0]); + rtDW.d[4] = rtDW.maxval; + rtDW.Add1_k = std::sin(rtU.angles[0]); + rtDW.d[7] = -rtDW.Add1_k; + rtDW.d[2] = 0.0; + rtDW.d[5] = rtDW.Add1_k; + rtDW.d[8] = rtDW.maxval; + rtDW.maxval = std::cos(rtU.angles[1]); + rtDW.dv0[0] = rtDW.maxval; + rtDW.dv0[3] = 0.0; + rtDW.Add1_k = std::sin(rtU.angles[1]); + rtDW.dv0[6] = rtDW.Add1_k; + for (r1 = 0; r1 < 3; r1++) { + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.R_c[R_tmp] = 0.0; + rtDW.R_c[R_tmp] += rtDW.d[3 * i] * rtDW.b_I_k[r1]; + rtDW.R_c[R_tmp] += rtDW.d[3 * i + 1] * rtDW.b_I_k[r1 + 3]; + rtDW.R_c[R_tmp] += rtDW.d[3 * i + 2] * rtDW.b_I_k[r1 + 6]; + } + + rtDW.dv0[1 + 3 * r1] = c[r1]; + } + + rtDW.dv0[2] = -rtDW.Add1_k; + rtDW.dv0[5] = 0.0; + rtDW.dv0[8] = rtDW.maxval; + for (r1 = 0; r1 < 3; r1++) { + rtDW.Zbdes[r1] = 0.0; + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.R[R_tmp] = 0.0; + rtDW.R[R_tmp] += rtDW.dv0[3 * i] * rtDW.R_c[r1]; + rtDW.R[R_tmp] += rtDW.dv0[3 * i + 1] * rtDW.R_c[r1 + 3]; + rtDW.R[R_tmp] += rtDW.dv0[3 * i + 2] * rtDW.R_c[r1 + 6]; + rtDW.Zbdes[r1] += rtDW.R[R_tmp] * rtDW.w_dot[i]; + } + } + + for (r1 = 0; r1 < 3; r1++) { + for (i = 0; i < 3; i++) { + R_tmp = r1 + 3 * i; + rtDW.b_I_k[R_tmp] = 0.0; + rtDW.R_c[R_tmp] = 0.0; + rtDW.b_I_k[R_tmp] += rtDW.b_I[3 * r1] * rtDW.R[3 * i]; + rtDW.R_c[R_tmp] += rtDW.R[3 * r1] * rtDW.b_I[3 * i]; + b_I_tmp = 3 * r1 + 1; + b_I_tmp_0 = 3 * i + 1; + rtDW.b_I_k[R_tmp] += rtDW.b_I[b_I_tmp] * rtDW.R[b_I_tmp_0]; + rtDW.R_c[R_tmp] += rtDW.R[b_I_tmp] * rtDW.b_I[b_I_tmp_0]; + b_I_tmp = 3 * r1 + 2; + b_I_tmp_0 = 3 * i + 2; + rtDW.b_I_k[R_tmp] += rtDW.b_I[b_I_tmp] * rtDW.R[b_I_tmp_0]; + rtDW.R_c[R_tmp] += rtDW.R[b_I_tmp] * rtDW.b_I[b_I_tmp_0]; + } + } + + for (r1 = 0; r1 < 9; r1++) { + rtDW.b_I[r1] = (rtDW.b_I_k[r1] - rtDW.R_c[r1]) * 0.5; + } + + rtDW.Xc[0] = rtDW.b_I[5]; + rtDW.Xc[1] = rtDW.b_I[6]; + rtDW.Xc[2] = rtDW.b_I[1]; + rtDW.b_I_k[0] = -rtDW.Delay_DSTATE_hf[6]; + rtDW.b_I_k[3] = -0.0; + rtDW.b_I_k[6] = -0.0; + rtDW.b_I_k[1] = -0.0; + rtDW.b_I_k[4] = -rtDW.Delay_DSTATE_hf[7]; + rtDW.b_I_k[7] = -0.0; + rtDW.b_I_k[2] = -0.0; + rtDW.b_I_k[5] = -0.0; + rtDW.b_I_k[8] = -rtDW.Delay_DSTATE_hf[8]; + rtDW.R_c[0] = rtDW.Delay_DSTATE_hf[9]; + rtDW.R_c[3] = 0.0; + rtDW.R_c[6] = 0.0; + rtDW.R_c[1] = 0.0; + rtDW.R_c[4] = rtDW.Delay_DSTATE_hf[10]; + rtDW.R_c[7] = 0.0; + rtDW.R_c[2] = 0.0; + rtDW.R_c[5] = 0.0; + rtDW.R_c[8] = rtDW.Delay_DSTATE_hf[11]; + for (r1 = 0; r1 < 3; r1++) { + rtDW.psy[r1] = rtDW.a_dotdot[r1]; + rtDW.psy[r1 + 3] = rtDW.Iw_dot[r1]; + rtDW.psy[r1 + 6] = rtDW.Xc[r1]; + rtDW.psy[r1 + 9] = rtU.wb[r1]; + rtDW.crossZX[r1] = rtU.wb[r1]; + rtDW.w_dot[r1] = rtDW.b_I_k[r1 + 6] * rtDW.Xc[2] + (rtDW.b_I_k[r1 + 3] * + rtDW.Xc[1] + rtDW.b_I_k[r1] * rtDW.Xc[0]); + } + + rtDW.A[0] = ((Fdes_idx_0 * rtDW.Zbdes[0] + Fdes_idx_1 * rtDW.Zbdes[1]) + + Fdes_idx_2 * rtDW.Zbdes[2]) + 7.3575; + for (r1 = 0; r1 < 3; r1++) { + rtDW.A[r1 + 1] = rtDW.w_dot[r1] - (rtDW.R_c[r1 + 6] * rtDW.crossZX[2] + + (rtDW.R_c[r1 + 3] * rtDW.crossZX[1] + rtDW.R_c[r1] * rtDW.crossZX[0])); + } + + // End of MATLAB Function: '<S5>/MATLAB Function3' + + // Saturate: '<S5>/Saturation' + if (rtDW.A[0] > 27.0) { + rtDW.maxval = 27.0; + } else if (rtDW.A[0] < 0.0) { + rtDW.maxval = 0.0; + } else { + rtDW.maxval = rtDW.A[0]; + } + + if (rtDW.A[1] > 1.6) { + Fdes_idx_0 = 1.6; + } else if (rtDW.A[1] < -1.6) { + Fdes_idx_0 = -1.6; + } else { + Fdes_idx_0 = rtDW.A[1]; + } + + if (rtDW.A[2] > 1.6) { + Fdes_idx_1 = 1.6; + } else if (rtDW.A[2] < -1.6) { + Fdes_idx_1 = -1.6; + } else { + Fdes_idx_1 = rtDW.A[2]; + } + + if (rtDW.A[3] > 0.6) { + Fdes_idx_2 = 0.6; + } else if (rtDW.A[3] < -0.6) { + Fdes_idx_2 = -0.6; + } else { + Fdes_idx_2 = rtDW.A[3]; + } + + // End of Saturate: '<S5>/Saturation' + + // MATLAB Function: '<S5>/MATLAB Function1' + for (r1 = 0; r1 < 4; r1++) { + rtDW.Add1_k = a[r1 + 12] * Fdes_idx_2 + (a[r1 + 8] * Fdes_idx_1 + (a[r1 + 4] + * Fdes_idx_0 + a[r1] * rtDW.maxval)); + rtDW.A[r1] = rtDW.Add1_k; + } + + if (rtDW.A[0] < 0.0) { + rtDW.A[0] = 0.0; + } + + if (rtDW.A[1] < 0.0) { + rtDW.A[1] = 0.0; + } + + if (rtDW.A[2] < 0.0) { + rtDW.A[2] = 0.0; + } + + if (rtDW.A[3] < 0.0) { + rtDW.A[3] = 0.0; + } + + rtDW.duty[0] = (3485.3574033876184 * std::sqrt(rtDW.A[0]) * 0.1865 + 768.0) / + 20000.0; + rtDW.duty[1] = (3485.3574033876184 * std::sqrt(rtDW.A[1]) * 0.1865 + 768.0) / + 20000.0; + rtDW.duty[2] = (3485.3574033876184 * std::sqrt(rtDW.A[2]) * 0.1865 + 768.0) / + 20000.0; + rtDW.duty[3] = (3485.3574033876184 * std::sqrt(rtDW.A[3]) * 0.1865 + 768.0) / + 20000.0; + + // End of MATLAB Function: '<S5>/MATLAB Function1' + // End of Outputs for SubSystem: '<S2>/large_controller' + + // MATLAB Function: '<S6>/MATLAB Function3' + rtDW.F[0] = 0.001; + rtDW.F[12] = 0.0; + rtDW.F[24] = 0.0; + rtDW.F[36] = 0.0; + rtDW.F[48] = 0.0; + rtDW.F[60] = 0.0; + rtDW.F[72] = 0.0; + rtDW.F[84] = 0.0; + rtDW.F[96] = 0.0; + rtDW.F[108] = 0.0; + rtDW.F[120] = 0.0; + rtDW.F[132] = 0.0; + rtDW.F[1] = 0.0; + rtDW.F[13] = 0.001; + rtDW.F[25] = 0.0; + rtDW.F[37] = 0.0; + rtDW.F[49] = 0.0; + rtDW.F[61] = 0.0; + rtDW.F[73] = 0.0; + rtDW.F[85] = 0.0; + rtDW.F[97] = 0.0; + rtDW.F[109] = 0.0; + rtDW.F[121] = 0.0; + rtDW.F[133] = 0.0; + rtDW.F[2] = 0.0; + rtDW.F[14] = 0.0; + rtDW.F[26] = 0.001; + rtDW.F[38] = 0.0; + rtDW.F[50] = 0.0; + rtDW.F[62] = 0.0; + rtDW.F[74] = 0.0; + rtDW.F[86] = 0.0; + rtDW.F[98] = 0.0; + rtDW.F[110] = 0.0; + rtDW.F[122] = 0.0; + rtDW.F[134] = 0.0; + rtDW.F[3] = 0.0; + rtDW.F[15] = 0.0; + rtDW.F[27] = 0.0; + rtDW.F[39] = 0.001; + rtDW.F[51] = 0.0; + rtDW.F[63] = 0.0; + rtDW.F[75] = 0.0; + rtDW.F[87] = 0.0; + rtDW.F[99] = 0.0; + rtDW.F[111] = 0.0; + rtDW.F[123] = 0.0; + rtDW.F[135] = 0.0; + rtDW.F[4] = 0.0; + rtDW.F[16] = 0.0; + rtDW.F[28] = 0.0; + rtDW.F[40] = 0.0; + rtDW.F[52] = 0.001; + rtDW.F[64] = 0.0; + rtDW.F[76] = 0.0; + rtDW.F[88] = 0.0; + rtDW.F[100] = 0.0; + rtDW.F[112] = 0.0; + rtDW.F[124] = 0.0; + rtDW.F[136] = 0.0; + rtDW.F[5] = 0.0; + rtDW.F[17] = 0.0; + rtDW.F[29] = 0.0; + rtDW.F[41] = 0.0; + rtDW.F[53] = 0.0; + rtDW.F[65] = 0.001; + rtDW.F[77] = 0.0; + rtDW.F[89] = 0.0; + rtDW.F[101] = 0.0; + rtDW.F[113] = 0.0; + rtDW.F[125] = 0.0; + rtDW.F[137] = 0.0; + rtDW.F[6] = 0.0; + rtDW.F[18] = 0.0; + rtDW.F[30] = 0.0; + rtDW.F[42] = 0.0; + rtDW.F[54] = 0.0; + rtDW.F[66] = 0.0; + rtDW.F[78] = 0.0001; + rtDW.F[90] = 0.0; + rtDW.F[102] = 0.0; + rtDW.F[114] = 0.0; + rtDW.F[126] = 0.0; + rtDW.F[138] = 0.0; + rtDW.F[7] = 0.0; + rtDW.F[19] = 0.0; + rtDW.F[31] = 0.0; + rtDW.F[43] = 0.0; + rtDW.F[55] = 0.0; + rtDW.F[67] = 0.0; + rtDW.F[79] = 0.0; + rtDW.F[91] = 0.0001; + rtDW.F[103] = 0.0; + rtDW.F[115] = 0.0; + rtDW.F[127] = 0.0; + rtDW.F[139] = 0.0; + rtDW.F[8] = 0.0; + rtDW.F[20] = 0.0; + rtDW.F[32] = 0.0; + rtDW.F[44] = 0.0; + rtDW.F[56] = 0.0; + rtDW.F[68] = 0.0; + rtDW.F[80] = 0.0; + rtDW.F[92] = 0.0; + rtDW.F[104] = 0.0001; + rtDW.F[116] = 0.0; + rtDW.F[128] = 0.0; + rtDW.F[140] = 0.0; + rtDW.F[9] = 0.0; + rtDW.F[21] = 0.0; + rtDW.F[33] = 0.0; + rtDW.F[45] = 0.0; + rtDW.F[57] = 0.0; + rtDW.F[69] = 0.0; + rtDW.F[81] = 0.0; + rtDW.F[93] = 0.0; + rtDW.F[105] = 0.0; + rtDW.F[117] = 0.0001; + rtDW.F[129] = 0.0; + rtDW.F[141] = 0.0; + rtDW.F[10] = 0.0; + rtDW.F[22] = 0.0; + rtDW.F[34] = 0.0; + rtDW.F[46] = 0.0; + rtDW.F[58] = 0.0; + rtDW.F[70] = 0.0; + rtDW.F[82] = 0.0; + rtDW.F[94] = 0.0; + rtDW.F[106] = 0.0; + rtDW.F[118] = 0.0; + rtDW.F[130] = 0.0001; + rtDW.F[142] = 0.0; + rtDW.F[11] = 0.0; + rtDW.F[23] = 0.0; + rtDW.F[35] = 0.0; + rtDW.F[47] = 0.0; + rtDW.F[59] = 0.0; + rtDW.F[71] = 0.0; + rtDW.F[83] = 0.0; + rtDW.F[95] = 0.0; + rtDW.F[107] = 0.0; + rtDW.F[119] = 0.0; + rtDW.F[131] = 0.0; + rtDW.F[143] = 0.0001; + rtDW.maxval = 0.0; + for (r1 = 0; r1 < 12; r1++) { + rtDW.rtb_Delay1_m[r1] = 0.0; + for (i = 0; i < 12; i++) { + rtDW.rtb_Delay1_m[r1] += rtDW.F[12 * r1 + i] * rtDW.Delay1[i]; + } + + rtDW.maxval += rtDW.rtb_Delay1_m[r1] * rtDW.Delay1[r1]; + } + + // SignalConversion: '<S9>/TmpSignal ConversionAt SFunction Inport2' incorporates: + // Inport: '<Root>/angles' + // Inport: '<Root>/r' + // Inport: '<Root>/rdot' + // Inport: '<Root>/wb' + // MATLAB Function: '<S6>/MATLAB Function3' + // Sum: '<S6>/Add1' + // Sum: '<S6>/Add2' + // Sum: '<S6>/Add3' + // Sum: '<S6>/Add4' + + rtDW.rtb_Delay1_m[0] = rtU.r[0] - rtDW.Integrator_p[0]; + rtDW.rtb_Delay1_m[3] = rtU.rdot[0] - rtDW.Integrator[0]; + rtDW.rtb_Delay1_m[6] = rtU.angles[0] - rtDW.Integrator_p[3]; + rtDW.rtb_Delay1_m[9] = rtU.wb[0] - rtDW.wb[0]; + rtDW.rtb_Delay1_m[1] = rtU.r[1] - rtDW.Integrator_p[1]; + rtDW.rtb_Delay1_m[4] = rtU.rdot[1] - rtDW.Integrator[1]; + rtDW.rtb_Delay1_m[7] = rtU.angles[1] - rtDW.Integrator_p[4]; + rtDW.rtb_Delay1_m[10] = rtU.wb[1] - rtDW.wb[1]; + rtDW.rtb_Delay1_m[2] = rtU.r[2] - rtDW.Integrator_p[2]; + rtDW.rtb_Delay1_m[5] = rtU.rdot[2] - rtDW.Integrator[2]; + rtDW.rtb_Delay1_m[8] = rtU.angles[2] - rtDW.Integrator_p[5]; + rtDW.rtb_Delay1_m[11] = rtU.wb[2] - rtDW.wb[2]; + for (r1 = 0; r1 < 12; r1++) { + // MATLAB Function: '<S6>/MATLAB Function3' + rtDW.F_c[r1] = 0.0; + for (i = 0; i < 12; i++) { + rtDW.F_c[r1] += rtDW.F[12 * i + r1] * rtDW.Delay1[i]; + } + + // Update for Delay: '<S2>/Delay' incorporates: + // MATLAB Function: '<S6>/MATLAB Function3' + // SignalConversion: '<S9>/TmpSignal ConversionAt SFunction Inport2' + + rtDW.Delay_DSTATE_hf[r1] = rtDW.F_c[r1] * rtDW.rtb_Delay1_m[r1] / (1.0 + + rtDW.maxval) + b_0[r1]; + } + + // End of Outputs for SubSystem: '<S1>/largepaa' + + // Outputs for Atomic SubSystem: '<S1>/small_angle_control' + // Sum: '<S22>/Add1' incorporates: + // Inport: '<Root>/x' + + rtDW.maxval = rtU.x - rtDW.Integrator_p[0]; + + // Gain: '<S144>/Filter Coefficient' incorporates: + // DiscreteIntegrator: '<S136>/Filter' + // Gain: '<S135>/Derivative Gain' + // Sum: '<S136>/SumD' + + Fdes_idx_0 = (1.68326013623818 * rtDW.maxval - rtDW.Filter_DSTATE) * + 206.264558996617; + + // Sum: '<S22>/Add2' incorporates: + // Inport: '<Root>/y' + + Fdes_idx_1 = rtU.y - rtDW.Integrator_p[1]; + + // Gain: '<S276>/Filter Coefficient' incorporates: + // DiscreteIntegrator: '<S268>/Filter' + // Gain: '<S267>/Derivative Gain' + // Sum: '<S268>/SumD' + + Fdes_idx_2 = (1.68326013623818 * Fdes_idx_1 - rtDW.Filter_DSTATE_k) * + 206.264558996617; + + // SignalConversion: '<S21>/TmpSignal ConversionAt SFunction Inport1' incorporates: + // DiscreteIntegrator: '<S141>/Integrator' + // DiscreteIntegrator: '<S273>/Integrator' + // Gain: '<S146>/Proportional Gain' + // Gain: '<S278>/Proportional Gain' + // MATLAB Function: '<S4>/MATLAB Function4' + // Sum: '<S150>/Sum' + // Sum: '<S282>/Sum' + + rtb_TmpSignalConversionAtSFun_1 = (0.576051138105677 * rtDW.maxval + + rtDW.Integrator_DSTATE) + Fdes_idx_0; + rtb_TmpSignalConversionAtSFun_0 = (0.576051138105677 * Fdes_idx_1 + + rtDW.Integrator_DSTATE_a) + Fdes_idx_2; + + // Sum: '<S23>/Add1' incorporates: + // Constant: '<S4>/Constant' + // MATLAB Function: '<S4>/MATLAB Function4' + + rtDW.Add1_k = (rtb_TmpSignalConversionAtSFun_1 * 0.0 - + rtb_TmpSignalConversionAtSFun_0) * 0.1019367991845056 - + rtDW.Integrator_p[3]; + + // Gain: '<S188>/Filter Coefficient' incorporates: + // DiscreteIntegrator: '<S180>/Filter' + // Gain: '<S179>/Derivative Gain' + // Sum: '<S180>/SumD' + + rtDW.FilterCoefficient_a = (0.171115754916436 * rtDW.Add1_k - + rtDW.Filter_DSTATE_m) * 176.087006843524; + + // Sum: '<S23>/Add2' incorporates: + // Constant: '<S4>/Constant' + // MATLAB Function: '<S4>/MATLAB Function4' + + rtb_TmpSignalConversionAtSFun_1 = (rtb_TmpSignalConversionAtSFun_0 * 0.0 + + rtb_TmpSignalConversionAtSFun_1) * 0.1019367991845056 - rtDW.Integrator_p[4]; + + // Gain: '<S56>/Filter Coefficient' incorporates: + // DiscreteIntegrator: '<S48>/Filter' + // Gain: '<S47>/Derivative Gain' + // Sum: '<S48>/SumD' + + rtb_TmpSignalConversionAtSFun_0 = (0.171115754916436 * + rtb_TmpSignalConversionAtSFun_1 - rtDW.Filter_DSTATE_l) * 176.087006843524; + + // Gain: '<S100>/Filter Coefficient' incorporates: + // Constant: '<S4>/Constant' + // DiscreteIntegrator: '<S92>/Filter' + // Gain: '<S91>/Derivative Gain' + // MATLAB Function: '<S4>/MATLAB Function4' + // Sum: '<S23>/Add3' + // Sum: '<S92>/SumD' + + rtDW.FilterCoefficient_k = ((0.0 - rtDW.Integrator_p[5]) * 0.0490884878345462 + - rtDW.Filter_DSTATE_lo) * 270.43836739932; + + // SignalConversion: '<S4>/ConcatBufferAtVector ConcatenateIn2' incorporates: + // Constant: '<S4>/Constant' + // Delay: '<S1>/Delay' + // DiscreteIntegrator: '<S185>/Integrator' + // DiscreteIntegrator: '<S53>/Integrator' + // DiscreteIntegrator: '<S97>/Integrator' + // Gain: '<S102>/Proportional Gain' + // Gain: '<S190>/Proportional Gain' + // Gain: '<S58>/Proportional Gain' + // MATLAB Function: '<S4>/MATLAB Function4' + // Sum: '<S106>/Sum' + // Sum: '<S194>/Sum' + // Sum: '<S23>/Add3' + // Sum: '<S62>/Sum' + + rtDW.Delay_DSTATE[1] = (0.421511657975665 * rtDW.Add1_k + + rtDW.Integrator_DSTATE_m) + rtDW.FilterCoefficient_a; + rtDW.Delay_DSTATE[2] = (0.421511657975665 * rtb_TmpSignalConversionAtSFun_1 + + rtDW.Integrator_DSTATE_e) + rtb_TmpSignalConversionAtSFun_0; + rtDW.Delay_DSTATE[3] = ((0.0 - rtDW.Integrator_p[5]) * 0.00309186213155581 + + rtDW.Integrator_DSTATE_o) + rtDW.FilterCoefficient_k; + + // Sum: '<S22>/Add3' incorporates: + // Inport: '<Root>/z' + + rtDW.Add3_a = rtU.z - rtDW.Integrator_p[2]; + + // Gain: '<S232>/Filter Coefficient' incorporates: + // DiscreteIntegrator: '<S224>/Filter' + // Gain: '<S223>/Derivative Gain' + // Sum: '<S224>/SumD' + + rtDW.FilterCoefficient_i = (1.46547031640698 * rtDW.Add3_a - + rtDW.Filter_DSTATE_n) * 19.9677854964375; + + // Sum: '<S4>/Add' incorporates: + // Delay: '<S1>/Delay' + // DiscreteIntegrator: '<S229>/Integrator' + // Gain: '<S234>/Proportional Gain' + // Sum: '<S238>/Sum' + + rtDW.Delay_DSTATE[0] = ((0.547568478085603 * rtDW.Add3_a + + rtDW.Integrator_DSTATE_ao) + rtDW.FilterCoefficient_i) + 7.3575; + + // Update for DiscreteIntegrator: '<S141>/Integrator' incorporates: + // Gain: '<S138>/Integral Gain' + + rtDW.Integrator_DSTATE += 0.0492289691165195 * rtDW.maxval * 0.0001; + + // Update for DiscreteIntegrator: '<S136>/Filter' + rtDW.Filter_DSTATE += 0.0001 * Fdes_idx_0; + + // Update for DiscreteIntegrator: '<S273>/Integrator' incorporates: + // Gain: '<S270>/Integral Gain' + + rtDW.Integrator_DSTATE_a += 0.0492289691165195 * Fdes_idx_1 * 0.0001; + + // Update for DiscreteIntegrator: '<S268>/Filter' + rtDW.Filter_DSTATE_k += 0.0001 * Fdes_idx_2; + + // Update for DiscreteIntegrator: '<S185>/Integrator' incorporates: + // Gain: '<S182>/Integral Gain' + + rtDW.Integrator_DSTATE_m += 0.230387898131499 * rtDW.Add1_k * 0.0001; + + // Update for DiscreteIntegrator: '<S180>/Filter' + rtDW.Filter_DSTATE_m += 0.0001 * rtDW.FilterCoefficient_a; + + // Update for DiscreteIntegrator: '<S53>/Integrator' incorporates: + // Gain: '<S50>/Integral Gain' + + rtDW.Integrator_DSTATE_e += 0.230387898131499 * + rtb_TmpSignalConversionAtSFun_1 * 0.0001; + + // Update for DiscreteIntegrator: '<S48>/Filter' + rtDW.Filter_DSTATE_l += 0.0001 * rtb_TmpSignalConversionAtSFun_0; + + // Update for DiscreteIntegrator: '<S97>/Integrator' incorporates: + // Constant: '<S4>/Constant' + // Gain: '<S94>/Integral Gain' + // MATLAB Function: '<S4>/MATLAB Function4' + // Sum: '<S23>/Add3' + + rtDW.Integrator_DSTATE_o += (0.0 - rtDW.Integrator_p[5]) * 4.32690066926921E-5 + * 0.0001; + + // Update for DiscreteIntegrator: '<S92>/Filter' + rtDW.Filter_DSTATE_lo += 0.0001 * rtDW.FilterCoefficient_k; + + // Update for DiscreteIntegrator: '<S229>/Integrator' incorporates: + // Gain: '<S226>/Integral Gain' + + rtDW.Integrator_DSTATE_ao += 0.0506661578399485 * rtDW.Add3_a * 0.0001; + + // Update for DiscreteIntegrator: '<S224>/Filter' + rtDW.Filter_DSTATE_n += 0.0001 * rtDW.FilterCoefficient_i; + + // End of Outputs for SubSystem: '<S1>/small_angle_control' + // End of Outputs for SubSystem: '<Root>/Adaptive large angle controller' + + // Outport: '<Root>/u1 ' + rtY.u1 = rtDW.duty[0]; + + // Outport: '<Root>/u2 ' + rtY.u2 = rtDW.duty[1]; + + // Outport: '<Root>/u3' + rtY.u3 = rtDW.duty[2]; + + // Outport: '<Root>/u4' + rtY.u4 = rtDW.duty[3]; +} + +// Model initialize function +void LAAPModelClass::initialize() +{ + { + int32_T i; + + // SystemInitialize for Atomic SubSystem: '<Root>/Adaptive large angle controller' + // SystemInitialize for Atomic SubSystem: '<S1>/quadcopter_dynamics_prediction' + // InitializeConditions for DiscreteIntegrator: '<S13>/Integrator' + for (i = 0; i < 6; i++) { + rtDW.Integrator_DSTATE_ep[i] = 0.0; + if (rtDW.Integrator_DSTATE_ep[i] >= 10.0) { + rtDW.Integrator_DSTATE_ep[i] = 10.0; + } else { + if (rtDW.Integrator_DSTATE_ep[i] <= -10.0) { + rtDW.Integrator_DSTATE_ep[i] = -10.0; + } + } + } + + // End of InitializeConditions for DiscreteIntegrator: '<S13>/Integrator' + + // InitializeConditions for DiscreteIntegrator: '<S14>/Integrator' + rtDW.Integrator_IC_LOADING = 1U; + + // End of SystemInitialize for SubSystem: '<S1>/quadcopter_dynamics_prediction' + // End of SystemInitialize for SubSystem: '<Root>/Adaptive large angle controller' + } +} + +// Constructor +LAAPModelClass::LAAPModelClass() +{ + // Currently there is no constructor body generated. +} + +// Destructor +LAAPModelClass::~LAAPModelClass() +{ + // Currently there is no destructor body generated. +} + +// Root-level input access methods + +// Root inport: '<Root>/rdot' set method +void LAAPModelClass::setrdot(real_T localArgInput[3]) +{ + rtU.rdot[0] = localArgInput[0]; + rtU.rdot[1] = localArgInput[1]; + rtU.rdot[2] = localArgInput[2]; +} + +// Root inport: '<Root>/r' set method +void LAAPModelClass::setr(real_T localArgInput[3]) +{ + rtU.r[0] = localArgInput[0]; + rtU.r[1] = localArgInput[1]; + rtU.r[2] = localArgInput[2]; +} + +// Root inport: '<Root>/wb' set method +void LAAPModelClass::setwb(real_T localArgInput[3]) +{ + rtU.wb[0] = localArgInput[0]; + rtU.wb[1] = localArgInput[1]; + rtU.wb[2] = localArgInput[2]; +} + +// Root inport: '<Root>/angles' set method +void LAAPModelClass::setangles(real_T localArgInput[3]) +{ + rtU.angles[0] = localArgInput[0]; + rtU.angles[1] = localArgInput[1]; + rtU.angles[2] = localArgInput[2]; +} + +// Root inport: '<Root>/x' set method +void LAAPModelClass::setx(real_T localArgInput) +{ + rtU.x = localArgInput; +} + +// Root inport: '<Root>/y' set method +void LAAPModelClass::sety(real_T localArgInput) +{ + rtU.y = localArgInput; +} + +// Root inport: '<Root>/z' set method +void LAAPModelClass::setz(real_T localArgInput) +{ + rtU.z = localArgInput; +} + +// Root inport: '<Root>/phi' set method +void LAAPModelClass::setphi(real_T localArgInput) +{ + rtU.phi = localArgInput; +} + +// Root inport: '<Root>/theta' set method +void LAAPModelClass::settheta(real_T localArgInput) +{ + rtU.theta = localArgInput; +} + +// Root inport: '<Root>/psi' set method +void LAAPModelClass::setpsi(real_T localArgInput) +{ + rtU.psi = localArgInput; +} + +// Root-level output access methods + +// Root outport: '<Root>/u1 ' get method +real_T LAAPModelClass::getu1_() const +{ + return rtY.u1; +} + +// Root outport: '<Root>/u2 ' get method +real_T LAAPModelClass::getu2_() const +{ + return rtY.u2; +} + +// Root outport: '<Root>/u3' get method +real_T LAAPModelClass::getu3() const +{ + return rtY.u3; +} + +// Root outport: '<Root>/u4' get method +real_T LAAPModelClass::getu4() const +{ + return rtY.u4; +} + +// Real-Time Model get method +RT_MODEL * LAAPModelClass::getRTM() +{ + return (&rtM); +} + +// +// File trailer for generated code. +// +// [EOF] +//
diff -r 000000000000 -r 25d32fc1c12e LAAP.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LAAP.h Mon Nov 25 10:51:06 2019 +0000 @@ -0,0 +1,514 @@ +// +// File: LAAP.h +// +// Code generated for Simulink model 'LAAP'. +// +// Model version : 1.2 +// Simulink Coder version : 9.1 (R2019a) 23-Nov-2018 +// C/C++ source code generated on : Mon Nov 18 17:57:49 2019 +// +// Target selection: ert.tlc +// Embedded hardware selection: ARM Compatible->ARM Cortex +// Code generation objectives: +// 1. Execution efficiency +// 2. RAM efficiency +// Validation result: Not run +// +#ifndef RTW_HEADER_LAAP_h_ +#define RTW_HEADER_LAAP_h_ +#include <cmath> +#include <string.h> +#ifndef LAAP_COMMON_INCLUDES_ +# define LAAP_COMMON_INCLUDES_ +#include "rtwtypes.h" +#endif // LAAP_COMMON_INCLUDES_ + +// Macros for accessing real-time model data structure +#ifndef rtmGetErrorStatus +# define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) +#endif + +#ifndef rtmSetErrorStatus +# define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) +#endif + +// Forward declaration for rtModel +typedef struct tag_RTM RT_MODEL; + +// Block signals and states (default storage) for system '<Root>' +typedef struct { + real_T psy[12]; // '<S5>/MATLAB Function3' + real_T duty[4]; // '<S5>/MATLAB Function1' + real_T Delay_DSTATE[4]; // '<S1>/Delay' + real_T Delay_DSTATE_h[3]; // '<S3>/Delay' + real_T Delay1_DSTATE_l[3]; // '<S3>/Delay1' + real_T Integrator_DSTATE_ep[6]; // '<S13>/Integrator' + real_T Integrator_DSTATE_k[6]; // '<S14>/Integrator' + real_T Delay_DSTATE_hf[12]; // '<S2>/Delay' + real_T F[144]; + real_T Delay1[12]; // '<S1>/Delay1' + real_T rtb_Delay1_m[12]; + real_T F_c[12]; + real_T b_I[9]; + real_T R[9]; + real_T d[9]; + real_T dv0[9]; + real_T b_I_k[9]; + real_T R_c[9]; + real_T Integrator[6]; // '<S13>/Integrator' + real_T Integrator_p[6]; // '<S14>/Integrator' + real_T dv1[6]; + real_T A[4]; + real_T a_dotdot[3]; + real_T Iw_dot[3]; + real_T w_dot[3]; + real_T Zbdes[3]; + real_T Xc[3]; + real_T crossZX[3]; + real_T wb[3]; // '<S3>/Euler equations of motion1 ' + real_T dv2[3]; + real_T Integrator_DSTATE; // '<S141>/Integrator' + real_T Filter_DSTATE; // '<S136>/Filter' + real_T Integrator_DSTATE_a; // '<S273>/Integrator' + real_T Filter_DSTATE_k; // '<S268>/Filter' + real_T Integrator_DSTATE_m; // '<S185>/Integrator' + real_T Filter_DSTATE_m; // '<S180>/Filter' + real_T Integrator_DSTATE_e; // '<S53>/Integrator' + real_T Filter_DSTATE_l; // '<S48>/Filter' + real_T Integrator_DSTATE_o; // '<S97>/Integrator' + real_T Filter_DSTATE_lo; // '<S92>/Filter' + real_T Integrator_DSTATE_ao; // '<S229>/Integrator' + real_T Filter_DSTATE_n; // '<S224>/Filter' + real_T maxval; + real_T Add1_k; // '<S23>/Add1' + real_T FilterCoefficient_a; // '<S188>/Filter Coefficient' + real_T FilterCoefficient_k; // '<S100>/Filter Coefficient' + real_T Add3_a; // '<S22>/Add3' + real_T FilterCoefficient_i; // '<S232>/Filter Coefficient' + int8_T Integrator_PrevResetState; // '<S13>/Integrator' + int8_T Integrator_PrevResetState_n; // '<S14>/Integrator' + uint8_T Integrator_IC_LOADING; // '<S14>/Integrator' +} DW; + +// External inputs (root inport signals with default storage) +typedef struct { + real_T rdot[3]; // '<Root>/rdot' + real_T r[3]; // '<Root>/r' + real_T wb[3]; // '<Root>/wb' + real_T angles[3]; // '<Root>/angles' + real_T x; // '<Root>/x' + real_T y; // '<Root>/y' + real_T z; // '<Root>/z' + real_T phi; // '<Root>/phi' + real_T theta; // '<Root>/theta' + real_T psi; // '<Root>/psi' +} ExtU; + +// External outputs (root outports fed by signals with default storage) +typedef struct { + real_T u1; // '<Root>/u1 ' + real_T u2; // '<Root>/u2 ' + real_T u3; // '<Root>/u3' + real_T u4; // '<Root>/u4' +} ExtY; + +// Real-time Model Data Structure +struct tag_RTM { + const char_T * volatile errorStatus; +}; + +// Class declaration for model LAAP +class LAAPModelClass { + // public data and function members + public: + // model initialize function + void initialize(); + + // model step function + void step(); + + // Constructor + LAAPModelClass(); + + // Destructor + ~LAAPModelClass(); + + // Root inport: '<Root>/rdot' set method + void setrdot(real_T localArgInput[3]); + + // Root inport: '<Root>/r' set method + void setr(real_T localArgInput[3]); + + // Root inport: '<Root>/wb' set method + void setwb(real_T localArgInput[3]); + + // Root inport: '<Root>/angles' set method + void setangles(real_T localArgInput[3]); + + // Root inport: '<Root>/x' set method + void setx(real_T localArgInput); + + // Root inport: '<Root>/y' set method + void sety(real_T localArgInput); + + // Root inport: '<Root>/z' set method + void setz(real_T localArgInput); + + // Root inport: '<Root>/phi' set method + void setphi(real_T localArgInput); + + // Root inport: '<Root>/theta' set method + void settheta(real_T localArgInput); + + // Root inport: '<Root>/psi' set method + void setpsi(real_T localArgInput); + + // Root outport: '<Root>/u1 ' get method + real_T getu1_() const; + + // Root outport: '<Root>/u2 ' get method + real_T getu2_() const; + + // Root outport: '<Root>/u3' get method + real_T getu3() const; + + // Root outport: '<Root>/u4' get method + real_T getu4() const; + + // Real-Time Model get method + RT_MODEL * getRTM(); + + // protected data and function members + protected: + // External inputs + ExtU rtU; + + // External outputs + ExtY rtY; + + // private data and function members + private: + // Block signals and states + DW rtDW; + + // Real-Time Model + RT_MODEL rtM; +}; + +//- +// These blocks were eliminated from the model due to optimizations: +// +// Block '<S13>/Saturation' : Eliminated Saturate block +// Block '<S14>/Saturation' : Eliminated Saturate block + + +//- +// The generated code includes comments that allow you to trace directly +// back to the appropriate location in the model. The basic format +// is <system>/block_name, where system is the system number (uniquely +// assigned by Simulink) and block_name is the name of the block. +// +// Use the MATLAB hilite_system command to trace the generated code back +// to the model. For example, +// +// hilite_system('<S3>') - opens system 3 +// hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 +// +// Here is the system hierarchy for this model +// +// '<Root>' : 'LAAP' +// '<S1>' : 'LAAP/Adaptive large angle controller' +// '<S2>' : 'LAAP/Adaptive large angle controller/largepaa' +// '<S3>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction' +// '<S4>' : 'LAAP/Adaptive large angle controller/small_angle_control' +// '<S5>' : 'LAAP/Adaptive large angle controller/largepaa/large_controller' +// '<S6>' : 'LAAP/Adaptive large angle controller/largepaa/parameter_adaptation_algorithm' +// '<S7>' : 'LAAP/Adaptive large angle controller/largepaa/large_controller/MATLAB Function1' +// '<S8>' : 'LAAP/Adaptive large angle controller/largepaa/large_controller/MATLAB Function3' +// '<S9>' : 'LAAP/Adaptive large angle controller/largepaa/parameter_adaptation_algorithm/MATLAB Function3' +// '<S10>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction/Euler equations of motion1 ' +// '<S11>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction/Integrator (Discrete or Continuous)' +// '<S12>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction/Integrator (Discrete or Continuous)1' +// '<S13>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction/Integrator (Discrete or Continuous)/Discrete' +// '<S14>' : 'LAAP/Adaptive large angle controller/quadcopter_dynamics_prediction/Integrator (Discrete or Continuous)1/Discrete' +// '<S15>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1' +// '<S16>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2' +// '<S17>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3' +// '<S18>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4' +// '<S19>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5' +// '<S20>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6' +// '<S21>' : 'LAAP/Adaptive large angle controller/small_angle_control/MATLAB Function4' +// '<S22>' : 'LAAP/Adaptive large angle controller/small_angle_control/Subsystem' +// '<S23>' : 'LAAP/Adaptive large angle controller/small_angle_control/Subsystem1' +// '<S24>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Anti-windup' +// '<S25>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/D Gain' +// '<S26>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Filter' +// '<S27>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Filter ICs' +// '<S28>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/I Gain' +// '<S29>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Ideal P Gain' +// '<S30>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Ideal P Gain Fdbk' +// '<S31>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Integrator' +// '<S32>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Integrator ICs' +// '<S33>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/N Copy' +// '<S34>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/N Gain' +// '<S35>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/P Copy' +// '<S36>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Parallel P Gain' +// '<S37>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Reset Signal' +// '<S38>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Saturation' +// '<S39>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Saturation Fdbk' +// '<S40>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Sum' +// '<S41>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Sum Fdbk' +// '<S42>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Tracking Mode' +// '<S43>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Tracking Mode Sum' +// '<S44>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/postSat Signal' +// '<S45>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/preSat Signal' +// '<S46>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Anti-windup/Passthrough' +// '<S47>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/D Gain/Internal Parameters' +// '<S48>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Filter/Disc. Forward Euler Filter' +// '<S49>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Filter ICs/Internal IC - Filter' +// '<S50>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/I Gain/Internal Parameters' +// '<S51>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Ideal P Gain/Passthrough' +// '<S52>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Ideal P Gain Fdbk/Disabled' +// '<S53>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Integrator/Discrete' +// '<S54>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Integrator ICs/Internal IC' +// '<S55>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/N Copy/Disabled' +// '<S56>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/N Gain/Internal Parameters' +// '<S57>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/P Copy/Disabled' +// '<S58>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Parallel P Gain/Internal Parameters' +// '<S59>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Reset Signal/Disabled' +// '<S60>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Saturation/Passthrough' +// '<S61>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Saturation Fdbk/Disabled' +// '<S62>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Sum/Sum_PID' +// '<S63>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Sum Fdbk/Disabled' +// '<S64>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Tracking Mode/Disabled' +// '<S65>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/Tracking Mode Sum/Passthrough' +// '<S66>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/postSat Signal/Forward_Path' +// '<S67>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller1/preSat Signal/Forward_Path' +// '<S68>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Anti-windup' +// '<S69>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/D Gain' +// '<S70>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Filter' +// '<S71>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Filter ICs' +// '<S72>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/I Gain' +// '<S73>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Ideal P Gain' +// '<S74>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Ideal P Gain Fdbk' +// '<S75>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Integrator' +// '<S76>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Integrator ICs' +// '<S77>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/N Copy' +// '<S78>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/N Gain' +// '<S79>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/P Copy' +// '<S80>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Parallel P Gain' +// '<S81>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Reset Signal' +// '<S82>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Saturation' +// '<S83>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Saturation Fdbk' +// '<S84>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Sum' +// '<S85>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Sum Fdbk' +// '<S86>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Tracking Mode' +// '<S87>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Tracking Mode Sum' +// '<S88>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/postSat Signal' +// '<S89>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/preSat Signal' +// '<S90>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Anti-windup/Passthrough' +// '<S91>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/D Gain/Internal Parameters' +// '<S92>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Filter/Disc. Forward Euler Filter' +// '<S93>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Filter ICs/Internal IC - Filter' +// '<S94>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/I Gain/Internal Parameters' +// '<S95>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Ideal P Gain/Passthrough' +// '<S96>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Ideal P Gain Fdbk/Disabled' +// '<S97>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Integrator/Discrete' +// '<S98>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Integrator ICs/Internal IC' +// '<S99>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/N Copy/Disabled' +// '<S100>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/N Gain/Internal Parameters' +// '<S101>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/P Copy/Disabled' +// '<S102>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Parallel P Gain/Internal Parameters' +// '<S103>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Reset Signal/Disabled' +// '<S104>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Saturation/Passthrough' +// '<S105>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Saturation Fdbk/Disabled' +// '<S106>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Sum/Sum_PID' +// '<S107>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Sum Fdbk/Disabled' +// '<S108>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Tracking Mode/Disabled' +// '<S109>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/Tracking Mode Sum/Passthrough' +// '<S110>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/postSat Signal/Forward_Path' +// '<S111>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller2/preSat Signal/Forward_Path' +// '<S112>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Anti-windup' +// '<S113>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/D Gain' +// '<S114>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Filter' +// '<S115>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Filter ICs' +// '<S116>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/I Gain' +// '<S117>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Ideal P Gain' +// '<S118>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Ideal P Gain Fdbk' +// '<S119>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Integrator' +// '<S120>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Integrator ICs' +// '<S121>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/N Copy' +// '<S122>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/N Gain' +// '<S123>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/P Copy' +// '<S124>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Parallel P Gain' +// '<S125>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Reset Signal' +// '<S126>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Saturation' +// '<S127>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Saturation Fdbk' +// '<S128>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Sum' +// '<S129>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Sum Fdbk' +// '<S130>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Tracking Mode' +// '<S131>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Tracking Mode Sum' +// '<S132>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/postSat Signal' +// '<S133>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/preSat Signal' +// '<S134>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Anti-windup/Passthrough' +// '<S135>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/D Gain/Internal Parameters' +// '<S136>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Filter/Disc. Forward Euler Filter' +// '<S137>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Filter ICs/Internal IC - Filter' +// '<S138>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/I Gain/Internal Parameters' +// '<S139>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Ideal P Gain/Passthrough' +// '<S140>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Ideal P Gain Fdbk/Disabled' +// '<S141>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Integrator/Discrete' +// '<S142>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Integrator ICs/Internal IC' +// '<S143>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/N Copy/Disabled' +// '<S144>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/N Gain/Internal Parameters' +// '<S145>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/P Copy/Disabled' +// '<S146>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Parallel P Gain/Internal Parameters' +// '<S147>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Reset Signal/Disabled' +// '<S148>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Saturation/Passthrough' +// '<S149>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Saturation Fdbk/Disabled' +// '<S150>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Sum/Sum_PID' +// '<S151>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Sum Fdbk/Disabled' +// '<S152>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Tracking Mode/Disabled' +// '<S153>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/Tracking Mode Sum/Passthrough' +// '<S154>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/postSat Signal/Forward_Path' +// '<S155>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller3/preSat Signal/Forward_Path' +// '<S156>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Anti-windup' +// '<S157>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/D Gain' +// '<S158>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Filter' +// '<S159>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Filter ICs' +// '<S160>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/I Gain' +// '<S161>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Ideal P Gain' +// '<S162>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Ideal P Gain Fdbk' +// '<S163>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Integrator' +// '<S164>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Integrator ICs' +// '<S165>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/N Copy' +// '<S166>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/N Gain' +// '<S167>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/P Copy' +// '<S168>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Parallel P Gain' +// '<S169>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Reset Signal' +// '<S170>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Saturation' +// '<S171>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Saturation Fdbk' +// '<S172>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Sum' +// '<S173>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Sum Fdbk' +// '<S174>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Tracking Mode' +// '<S175>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Tracking Mode Sum' +// '<S176>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/postSat Signal' +// '<S177>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/preSat Signal' +// '<S178>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Anti-windup/Passthrough' +// '<S179>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/D Gain/Internal Parameters' +// '<S180>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Filter/Disc. Forward Euler Filter' +// '<S181>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Filter ICs/Internal IC - Filter' +// '<S182>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/I Gain/Internal Parameters' +// '<S183>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Ideal P Gain/Passthrough' +// '<S184>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Ideal P Gain Fdbk/Disabled' +// '<S185>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Integrator/Discrete' +// '<S186>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Integrator ICs/Internal IC' +// '<S187>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/N Copy/Disabled' +// '<S188>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/N Gain/Internal Parameters' +// '<S189>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/P Copy/Disabled' +// '<S190>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Parallel P Gain/Internal Parameters' +// '<S191>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Reset Signal/Disabled' +// '<S192>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Saturation/Passthrough' +// '<S193>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Saturation Fdbk/Disabled' +// '<S194>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Sum/Sum_PID' +// '<S195>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Sum Fdbk/Disabled' +// '<S196>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Tracking Mode/Disabled' +// '<S197>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/Tracking Mode Sum/Passthrough' +// '<S198>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/postSat Signal/Forward_Path' +// '<S199>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller4/preSat Signal/Forward_Path' +// '<S200>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Anti-windup' +// '<S201>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/D Gain' +// '<S202>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Filter' +// '<S203>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Filter ICs' +// '<S204>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/I Gain' +// '<S205>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Ideal P Gain' +// '<S206>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Ideal P Gain Fdbk' +// '<S207>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Integrator' +// '<S208>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Integrator ICs' +// '<S209>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/N Copy' +// '<S210>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/N Gain' +// '<S211>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/P Copy' +// '<S212>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Parallel P Gain' +// '<S213>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Reset Signal' +// '<S214>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Saturation' +// '<S215>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Saturation Fdbk' +// '<S216>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Sum' +// '<S217>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Sum Fdbk' +// '<S218>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Tracking Mode' +// '<S219>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Tracking Mode Sum' +// '<S220>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/postSat Signal' +// '<S221>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/preSat Signal' +// '<S222>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Anti-windup/Passthrough' +// '<S223>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/D Gain/Internal Parameters' +// '<S224>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Filter/Disc. Forward Euler Filter' +// '<S225>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Filter ICs/Internal IC - Filter' +// '<S226>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/I Gain/Internal Parameters' +// '<S227>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Ideal P Gain/Passthrough' +// '<S228>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Ideal P Gain Fdbk/Disabled' +// '<S229>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Integrator/Discrete' +// '<S230>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Integrator ICs/Internal IC' +// '<S231>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/N Copy/Disabled' +// '<S232>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/N Gain/Internal Parameters' +// '<S233>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/P Copy/Disabled' +// '<S234>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Parallel P Gain/Internal Parameters' +// '<S235>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Reset Signal/Disabled' +// '<S236>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Saturation/Passthrough' +// '<S237>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Saturation Fdbk/Disabled' +// '<S238>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Sum/Sum_PID' +// '<S239>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Sum Fdbk/Disabled' +// '<S240>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Tracking Mode/Disabled' +// '<S241>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/Tracking Mode Sum/Passthrough' +// '<S242>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/postSat Signal/Forward_Path' +// '<S243>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller5/preSat Signal/Forward_Path' +// '<S244>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Anti-windup' +// '<S245>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/D Gain' +// '<S246>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Filter' +// '<S247>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Filter ICs' +// '<S248>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/I Gain' +// '<S249>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Ideal P Gain' +// '<S250>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Ideal P Gain Fdbk' +// '<S251>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Integrator' +// '<S252>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Integrator ICs' +// '<S253>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/N Copy' +// '<S254>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/N Gain' +// '<S255>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/P Copy' +// '<S256>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Parallel P Gain' +// '<S257>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Reset Signal' +// '<S258>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Saturation' +// '<S259>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Saturation Fdbk' +// '<S260>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Sum' +// '<S261>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Sum Fdbk' +// '<S262>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Tracking Mode' +// '<S263>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Tracking Mode Sum' +// '<S264>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/postSat Signal' +// '<S265>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/preSat Signal' +// '<S266>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Anti-windup/Passthrough' +// '<S267>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/D Gain/Internal Parameters' +// '<S268>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Filter/Disc. Forward Euler Filter' +// '<S269>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Filter ICs/Internal IC - Filter' +// '<S270>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/I Gain/Internal Parameters' +// '<S271>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Ideal P Gain/Passthrough' +// '<S272>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Ideal P Gain Fdbk/Disabled' +// '<S273>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Integrator/Discrete' +// '<S274>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Integrator ICs/Internal IC' +// '<S275>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/N Copy/Disabled' +// '<S276>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/N Gain/Internal Parameters' +// '<S277>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/P Copy/Disabled' +// '<S278>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Parallel P Gain/Internal Parameters' +// '<S279>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Reset Signal/Disabled' +// '<S280>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Saturation/Passthrough' +// '<S281>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Saturation Fdbk/Disabled' +// '<S282>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Sum/Sum_PID' +// '<S283>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Sum Fdbk/Disabled' +// '<S284>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Tracking Mode/Disabled' +// '<S285>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/Tracking Mode Sum/Passthrough' +// '<S286>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/postSat Signal/Forward_Path' +// '<S287>' : 'LAAP/Adaptive large angle controller/small_angle_control/Discrete PID Controller6/preSat Signal/Forward_Path' + +#endif // RTW_HEADER_LAAP_h_ + +// +// File trailer for generated code. +// +// [EOF] +//
diff -r 000000000000 -r 25d32fc1c12e rtwtypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rtwtypes.h Mon Nov 25 10:51:06 2019 +0000 @@ -0,0 +1,102 @@ +// +// File: rtwtypes.h +// +// Code generated for Simulink model 'LAAP'. +// +// Model version : 1.2 +// Simulink Coder version : 9.1 (R2019a) 23-Nov-2018 +// C/C++ source code generated on : Mon Nov 18 17:57:49 2019 +// +// Target selection: ert.tlc +// Embedded hardware selection: ARM Compatible->ARM Cortex +// Code generation objectives: +// 1. Execution efficiency +// 2. RAM efficiency +// Validation result: Not run +// + +#ifndef RTWTYPES_H +#define RTWTYPES_H + +// Logical type definitions +#if (!defined(__cplusplus)) +# ifndef false +# define false (0U) +# endif + +# ifndef true +# define true (1U) +# endif +#endif + +//=======================================================================* +// Target hardware information +// Device type: ARM Compatible->ARM Cortex +// Number of bits: char: 8 short: 16 int: 32 +// long: 32 long long: 64 +// native word size: 32 +// Byte ordering: LittleEndian +// Signed integer division rounds to: Zero +// Shift right on a signed integer as arithmetic shift: on +// ======================================================================= + +//=======================================================================* +// Fixed width word size data types: * +// int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * +// uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * +// real32_T, real64_T - 32 and 64 bit floating point numbers * +// ======================================================================= +typedef signed char int8_T; +typedef unsigned char uint8_T; +typedef short int16_T; +typedef unsigned short uint16_T; +typedef int int32_T; +typedef unsigned int uint32_T; +typedef long long int64_T; +typedef unsigned long long uint64_T; +typedef float real32_T; +typedef double real64_T; + +//===========================================================================* +// Generic type definitions: boolean_T, char_T, byte_T, int_T, uint_T, * +// real_T, time_T, ulong_T, ulonglong_T. * +// =========================================================================== +typedef double real_T; +typedef double time_T; +typedef unsigned char boolean_T; +typedef int int_T; +typedef unsigned int uint_T; +typedef unsigned long ulong_T; +typedef unsigned long long ulonglong_T; +typedef char char_T; +typedef unsigned char uchar_T; +typedef char_T byte_T; + +//=======================================================================* +// Min and Max: * +// int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers * +// uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers * +// ======================================================================= +#define MAX_int8_T ((int8_T)(127)) +#define MIN_int8_T ((int8_T)(-128)) +#define MAX_uint8_T ((uint8_T)(255U)) +#define MAX_int16_T ((int16_T)(32767)) +#define MIN_int16_T ((int16_T)(-32768)) +#define MAX_uint16_T ((uint16_T)(65535U)) +#define MAX_int32_T ((int32_T)(2147483647)) +#define MIN_int32_T ((int32_T)(-2147483647-1)) +#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) +#define MAX_int64_T ((int64_T)(9223372036854775807LL)) +#define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL)) +#define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL)) + +// Block D-Work pointer type +typedef void * pointer_T; + +#endif // RTWTYPES_H + +// +// File trailer for generated code. +// +// [EOF] +//