diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic.slx b/[ADM] Integrated Logic/ADM_Integrated_Logic.slx index 670899c3..7b4041e1 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic.slx and b/[ADM] Integrated Logic/ADM_Integrated_Logic.slx differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic.slxc b/[ADM] Integrated Logic/ADM_Integrated_Logic.slxc index 235fde9b..a06cbbff 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic.slxc and b/[ADM] Integrated Logic/ADM_Integrated_Logic.slxc differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.c b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.c index dcf43c27..d072f972 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.c +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.c @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 @@ -26,7 +26,7 @@ #include #include -/* Named constants for Chart: '/Chart' */ +/* Named constants for Chart: '/Chart' */ #define ADM_Integrated_Logic_IN_HAC_OFF ((uint8_t)1U) #define ADM_Integrated_Logic_IN_HAC_ON ((uint8_t)2U) @@ -39,33 +39,10 @@ ExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U; /* External outputs (root outports fed by signals with default storage) */ ExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y; -/* Real-time model */ -static RT_MODEL_ADM_Integrated_Logic_T ADM_Integrated_Logic_M_; -RT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M = - &ADM_Integrated_Logic_M_; -static void rate_scheduler(void); - -/* - * This function updates active task flag for each subrate. - * The function is called at model base rate, hence the - * generated code self-manages all its subrates. - */ -static void rate_scheduler(void) -{ - /* Compute which subrates run during the next base time step. Subrates - * are an integer multiple of the base rate counter. Therefore, the subtask - * counter is reset when it reaches its limit (zero means run). - */ - (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1])++; - if ((ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1]) > 499) {/* Sample time: [1.0s, 0.0s] */ - ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] = 0; - } -} - /* * Output and update for atomic system: - * '/Calculate_F_c' - * '/Calculate_F_c1' + * '/Calculate_F_c' + * '/Calculate_F_c1' */ void ADM_Integrated_Lo_Calculate_F_c(double rtu_W, double rtu_theta, double *rty_F_c) @@ -127,12 +104,12 @@ void ADM_Integrated_Logic_step(void) double rtb_Product1_iz; double rtb_Product1_m; double rtb_Product1_pd; + double rtb_Sum; double rtb_Sum1_aj; double rtb_Sum1_i2; double rtb_Sum1_lm; double rtb_Sum1_o1; double rtb_Sum1_p; - double rtb_Sum_f; double rtb_Switch2; double rtb_UkYk1; double rtb_UkYk1_j; @@ -152,44 +129,15 @@ void ADM_Integrated_Logic_step(void) * Inport: '/GV_Operation_Mode' */ rtb_Compare = (ADM_Integrated_Logic_U.GV_Operation_Mode == 2.0); - if (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] == 0) { - /* Step: '/Step' incorporates: - * DigitalClock: '/Digital Clock' - */ - rtb_Add_e = ((ADM_Integrated_Logic_M->Timing.clockTick1) * 1.0); - if (rtb_Add_e < 0.0) { - temp_gear = 0; - } else { - temp_gear = 1000; - } - - /* Product: '/Product' incorporates: - * Step: '/Step' - */ - rtb_Integrator_1 = (double)temp_gear * rtb_Add_e; - - /* Saturate: '/Saturation' */ - if (rtb_Integrator_1 > 1000.0) { - /* Saturate: '/Saturation' */ - ADM_Integrated_Logic_DW.Saturation = 1000.0; - } else if (rtb_Integrator_1 < 0.0) { - /* Saturate: '/Saturation' */ - ADM_Integrated_Logic_DW.Saturation = 0.0; - } else { - /* Saturate: '/Saturation' */ - ADM_Integrated_Logic_DW.Saturation = rtb_Integrator_1; - } - - /* End of Saturate: '/Saturation' */ - } /* Product: '/delta rise limit' incorporates: - * Constant: '/Upper_Torq' + * Constant: '/Upper_Torq' * SampleTimeMath: '/sample time' * * About '/sample time': * y = K where K = ( w * Ts ) * */ + /* : if Emergency_Flag == 1 */ rtb_Switch2 = 0.016; /* UnitDelay: '/Delay Input2' @@ -208,8 +156,8 @@ void ADM_Integrated_Logic_step(void) * */ rtb_Integrator_1 = 0.002; - /* Saturate: '/Pitch_Saturation' incorporates: - * DiscreteIntegrator: '/Integrator_2' + /* Saturate: '/Pitch_Saturation' incorporates: + * DiscreteIntegrator: '/Integrator_2' */ if (ADM_Integrated_Logic_DW.Integrator_2_DSTATE > 10.0) { rtb_Add_e = 10.0; @@ -220,7 +168,7 @@ void ADM_Integrated_Logic_step(void) } /* Sum: '/Difference Inputs1' incorporates: - * Saturate: '/Pitch_Saturation' + * Saturate: '/Pitch_Saturation' * * Block description for '/Difference Inputs1': * @@ -254,21 +202,21 @@ void ADM_Integrated_Logic_step(void) */ rtb_Yk1_e += rtb_Integrator_1; - /* MATLAB Function: '/Calculate_F_c' incorporates: - * Gain: '/Gain' + /* MATLAB Function: '/Calculate_F_c' incorporates: + * Gain: '/Gain' */ ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_value, 0.017453292519943295 * rtb_Yk1_e, &rtb_UkYk1); - /* Gain: '/Gain2' incorporates: - * Constant: '/Radius' - * Product: '/Multiply3' - * Sum: '/Required_Brake_Cal' + /* Gain: '/Gain2' incorporates: + * Constant: '/Radius' + * Product: '/Multiply3' + * Sum: '/Required_Brake_Cal' */ /* : F_R= C_r*W*cos(theta); */ rtb_Integrator_1 = rtb_UkYk1 * 0.292 * 0.083822296730930432; - /* Saturate: '/Saturation' */ + /* Saturate: '/Saturation' */ if (rtb_Integrator_1 > 60.0) { rtb_Integrator_1 = 60.0; } else if (rtb_Integrator_1 < 0.0) { @@ -276,7 +224,7 @@ void ADM_Integrated_Logic_step(void) } /* Sum: '/Difference Inputs1' incorporates: - * Saturate: '/Saturation' + * Saturate: '/Saturation' * UnitDelay: '/Delay Input2' * * Block description for '/Difference Inputs1': @@ -320,10 +268,10 @@ void ADM_Integrated_Logic_step(void) */ rtb_UkYk1 = rtb_Switch2 + ADM_Integrated_Logic_DW.DelayInput2_DSTATE; - /* Gain: '/Grade_GAIN' */ + /* Gain: '/Grade_GAIN' */ rtb_Desired_Torque = 0.8 * rtb_UkYk1; - /* MATLAB Function: '/Vx_OutPut_Function' incorporates: + /* MATLAB Function: '/Vx_OutPut_Function' incorporates: * Constant: '/Constant' * Inport: '/GV_BrakeTorqueCommand' * Inport: '/GV_Vx_Command' @@ -348,7 +296,7 @@ void ADM_Integrated_Logic_step(void) rtb_deltafalllimit_m = 0.0; } - /* End of MATLAB Function: '/Vx_OutPut_Function' */ + /* End of MATLAB Function: '/Vx_OutPut_Function' */ /* RateLimiter: '/Input_Vx_RateLimiter' */ rtb_output_a = rtb_deltafalllimit_m - ADM_Integrated_Logic_DW.PrevY; @@ -364,16 +312,16 @@ void ADM_Integrated_Logic_step(void) /* End of RateLimiter: '/Input_Vx_RateLimiter' */ - /* RelationalOperator: '/Compare' incorporates: - * Constant: '/Constant' + /* RelationalOperator: '/Compare' incorporates: + * Constant: '/Constant' * Inport: '/GV_BrakeTorqueCommand' */ rtb_Compare_d = (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand >= 100.0); - /* Delay: '/Memory' */ + /* Delay: '/Memory' */ rtb_deltafalllimit_m = ADM_Integrated_Logic_DW.Memory_DSTATE; - /* MATLAB Function: '/Gear_FUNCTION1' incorporates: + /* MATLAB Function: '/Gear_FUNCTION1' incorporates: * Inport: '/GV_VCU_GearSelStat' * Inport: '/GV_Vx_Fbk' */ @@ -462,11 +410,11 @@ void ADM_Integrated_Logic_step(void) } } - /* End of MATLAB Function: '/Gear_FUNCTION1' */ + /* End of MATLAB Function: '/Gear_FUNCTION1' */ - /* Chart: '/Chart' incorporates: - * Constant: '/Constant' - * Constant: '/Constant1' + /* Chart: '/Chart' incorporates: + * Constant: '/Constant' + * Constant: '/Constant1' * Inport: '/GV_MCU_RPM' */ if (ADM_Integrated_Logic_DW.is_active_c6_ADM_Integrated_Log == 0U) { @@ -502,9 +450,9 @@ void ADM_Integrated_Logic_step(void) ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision = 1.0; } - /* End of Chart: '/Chart' */ + /* End of Chart: '/Chart' */ - /* MATLAB Function: '/HAC_OFF_OK_Func' */ + /* MATLAB Function: '/HAC_OFF_OK_Func' */ /* Input Parameters: */ /* Desired_Brake_Torque_Cmd: Commanded brake torque when HAC is ON */ /* Desired_Torque: Required torque at the slope */ @@ -527,22 +475,22 @@ void ADM_Integrated_Logic_step(void) rtb_Brake_Torque_Cmd = 0.0; /* Outport: '/Debug_HAC_FLAG' incorporates: - * MATLAB Function: '/HAC_OFF_OK_Func' + * MATLAB Function: '/HAC_OFF_OK_Func' */ /* : HAC_ON_OFF_CHECK = 0; */ ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 0.0; - /* MATLAB Function: '/HAC_OFF_OK_Func' incorporates: - * Constant: '/Accel_Cmd ' - * Constant: '/Brake_Cmd' - * Constant: '/Gear_D' + /* MATLAB Function: '/HAC_OFF_OK_Func' incorporates: + * Constant: '/Accel_Cmd ' + * Constant: '/Brake_Cmd' + * Constant: '/Gear_D' * Inport: '/GV_BrakeTorqueCommand' * Inport: '/GV_MCU_EstTrq' * Outport: '/Debug_HAC_RPM_Decision' - * RelationalOperator: '/Relational Operator' - * RelationalOperator: '/Relational Operator1' - * RelationalOperator: '/Relational Operator2' - * Sum: '/HAC_Flags_Add' + * RelationalOperator: '/Relational Operator' + * RelationalOperator: '/Relational Operator1' + * RelationalOperator: '/Relational Operator2' + * Sum: '/HAC_Flags_Add' */ /* Check if HAC is ON (HAC_Flag >= 4) */ /* : if HAC_Flag >= 4 */ @@ -561,10 +509,10 @@ void ADM_Integrated_Logic_step(void) ADM_Integrated_Logic_DW.HAC_ON_FLAG = 1.0; /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */ - rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Saturation; + rtb_Brake_Torque_Cmd = 1000.0; /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */ - ADM_Integrated_Logic_DW.Smoothed_Torque = ADM_Integrated_Logic_DW.Saturation; + ADM_Integrated_Logic_DW.Smoothed_Torque = 1000.0; /* : if HAC_ON_Timer < 3 */ if (ADM_Integrated_Logic_DW.HAC_ON_Timer < 3.0) { @@ -623,11 +571,10 @@ void ADM_Integrated_Logic_step(void) /* : else */ /* Keep the brake torque command if torque condition is not met */ /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */ - rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Saturation; + rtb_Brake_Torque_Cmd = 1000.0; /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */ - ADM_Integrated_Logic_DW.Smoothed_Torque = - ADM_Integrated_Logic_DW.Saturation; + ADM_Integrated_Logic_DW.Smoothed_Torque = 1000.0; /* Outport: '/Debug_HAC_FLAG' */ /* : HAC_ON_OFF_CHECK = 1; */ @@ -804,38 +751,29 @@ void ADM_Integrated_Logic_step(void) /* End of RateLimiter: '/TargetSpd_RateLimiter' */ - /* Product: '/Product1' incorporates: - * Constant: '/Constant' - * Gain: '/gain' - * Product: '/Product11' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * UnitDelay: '/d' - * UnitDelay: '/d1' + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' */ rtb_Brake_Torque_Cmd = ((rtb_output_a + ADM_Integrated_Logic_DW.d1_DSTATE) * 0.002 + 0.1041032953945969 * ADM_Integrated_Logic_DW.d_DSTATE) / 0.1081032953945969; - /* Sum: '/Sum1' incorporates: - * Gain: '/gain' - * Sum: '/Sum2' - * UnitDelay: '/d' - * UnitDelay: '/d1' - */ - rtb_Sum1_i2 = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_i) * - 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_p; - /* Sum: '/Sum1' incorporates: * Gain: '/gain' * Sum: '/Sum2' * UnitDelay: '/d' * UnitDelay: '/d1' */ - rtb_Sum1_o1 = (rtb_Sum1_i2 - ADM_Integrated_Logic_DW.d_DSTATE_c) * 1000.0 - - ADM_Integrated_Logic_DW.d1_DSTATE_h; + rtb_Sum1_i2 = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_i) * + 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_p; /* Sum: '/Sum1' incorporates: * Gain: '/gain' @@ -843,39 +781,48 @@ void ADM_Integrated_Logic_step(void) * UnitDelay: '/d' * UnitDelay: '/d1' */ + rtb_Sum1_o1 = (rtb_Sum1_i2 - ADM_Integrated_Logic_DW.d_DSTATE_c) * 1000.0 - + ADM_Integrated_Logic_DW.d1_DSTATE_h; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ rtb_Sum1_lm = (rtb_Sum1_o1 - ADM_Integrated_Logic_DW.d_DSTATE_d) * 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_l; - /* Gain: '/Gain' incorporates: - * Constant: '/Constant3' - * Constant: '/Constant4' - * Constant: '/Constant5' - * Product: '/Product' - * Product: '/Product1' - * Product: '/Product2' - * Sum: '/Add5' + /* Gain: '/Gain' incorporates: + * Constant: '/Constant3' + * Constant: '/Constant4' + * Constant: '/Constant5' + * Product: '/Product' + * Product: '/Product1' + * Product: '/Product2' + * Sum: '/Add5' */ rtb_Gain_c = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Sum1_i2) + 21.8 * rtb_Sum1_o1) + rtb_Sum1_lm) * 9.44822373393802E-6; - /* Product: '/Product1' incorporates: - * Constant: '/Constant1' - * Constant: '/Constant2' - * Delay: '/Delay' - * Delay: '/Delay1' - * Delay: '/Delay2' - * Delay: '/Delay3' - * Gain: '/gain1' - * Gain: '/gain3' - * Product: '/x(n), x(n-1), x(n-2)' - * Product: '/y(n-1)' - * Product: '/y(n-2)' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * Sum: '/Sum5' - * Sum: '/Sum6' + /* Product: '/Product1' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant2' + * Delay: '/Delay' + * Delay: '/Delay1' + * Delay: '/Delay2' + * Delay: '/Delay3' + * Gain: '/gain1' + * Gain: '/gain3' + * Product: '/x(n), x(n-1), x(n-2)' + * Product: '/y(n-1)' + * Product: '/y(n-2)' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * Sum: '/Sum5' + * Sum: '/Sum6' */ rtb_Product1_pd = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE + rtb_Gain_c) + ADM_Integrated_Logic_DW.Delay_DSTATE[0]) * @@ -884,16 +831,16 @@ void ADM_Integrated_Logic_step(void) 2.6178993711731877 * ADM_Integrated_Logic_DW.Delay3_DSTATE [0]) / 6.1716689809139611; - /* Product: '/Product1' incorporates: - * Constant: '/Constant' - * Gain: '/gain' - * Product: '/Product11' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * UnitDelay: '/d' - * UnitDelay: '/d1' + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' */ rtb_Product1_m = ((rtb_Product1_pd + ADM_Integrated_Logic_DW.d1_DSTATE_e) * 0.002 + 0.00861032953945969 * @@ -901,12 +848,12 @@ void ADM_Integrated_Logic_step(void) /* Sum: '/Subtract' incorporates: * Inport: '/GV_MCU_RPM' - * MultiPortSwitch: '/Multiport Switch1' + * MultiPortSwitch: '/Multiport Switch1' */ rtb_Error_m = rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_U.GV_MCU_RPM; /* Saturate: '/Error_Saturation' incorporates: - * MultiPortSwitch: '/Multiport Switch1' + * MultiPortSwitch: '/Multiport Switch1' */ if (rtb_Error_m > 2000.0) { rtb_Error_m = 2000.0; @@ -916,8 +863,8 @@ void ADM_Integrated_Logic_step(void) /* End of Saturate: '/Error_Saturation' */ - /* DeadZone: '/Dead Zone' incorporates: - * MultiPortSwitch: '/Multiport Switch1' + /* DeadZone: '/Dead Zone' incorporates: + * MultiPortSwitch: '/Multiport Switch1' */ if (rtb_Error_m > 50.0) { rtb_Add_e = rtb_Error_m - 50.0; @@ -927,23 +874,14 @@ void ADM_Integrated_Logic_step(void) rtb_Add_e = rtb_Error_m - -50.0; } - /* Sum: '/Sum1' incorporates: - * Gain: '/gain' - * Sum: '/Sum2' - * UnitDelay: '/d' - * UnitDelay: '/d1' - */ - rtb_Error_m = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_ir) * - 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_o; - /* Sum: '/Sum1' incorporates: * Gain: '/gain' * Sum: '/Sum2' * UnitDelay: '/d' * UnitDelay: '/d1' */ - rtb_Sum1_aj = (rtb_Error_m - ADM_Integrated_Logic_DW.d_DSTATE_m) * 1000.0 - - ADM_Integrated_Logic_DW.d1_DSTATE_hm; + rtb_Error_m = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_ir) * + 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_o; /* Sum: '/Sum1' incorporates: * Gain: '/gain' @@ -951,57 +889,66 @@ void ADM_Integrated_Logic_step(void) * UnitDelay: '/d' * UnitDelay: '/d1' */ + rtb_Sum1_aj = (rtb_Error_m - ADM_Integrated_Logic_DW.d_DSTATE_m) * 1000.0 - + ADM_Integrated_Logic_DW.d1_DSTATE_hm; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ rtb_Sum1_p = (rtb_Sum1_aj - ADM_Integrated_Logic_DW.d_DSTATE_mw) * 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_g; - /* Sum: '/Add3' incorporates: - * Constant: '/Constant3' - * Constant: '/Constant4' - * Constant: '/Constant5' - * Gain: '/Gain' + /* Sum: '/Add3' incorporates: + * Constant: '/Constant3' + * Constant: '/Constant4' + * Constant: '/Constant5' + * Gain: '/Gain' * Memory: '/Memory' - * Product: '/Product2' - * Product: '/Product3' - * Product: '/Product4' - * Sum: '/Add2' + * Product: '/Product2' + * Product: '/Product3' + * Product: '/Product4' + * Sum: '/Add2' */ rtb_Add3 = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Error_m) + 21.8 * rtb_Sum1_aj) + rtb_Sum1_p) * 9.44822373393802E-6 - ADM_Integrated_Logic_DW.Memory_PreviousInput; - /* Product: '/Product1' incorporates: - * Constant: '/Constant' - * Gain: '/gain' - * Product: '/Product11' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * UnitDelay: '/d' - * UnitDelay: '/d1' + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' */ rtb_Product1_e = ((rtb_Add3 + ADM_Integrated_Logic_DW.d1_DSTATE_ej) * 0.002 + 0.029830988618379066 * ADM_Integrated_Logic_DW.d_DSTATE_j) / 0.03383098861837907; - /* Product: '/Product1' incorporates: - * Constant: '/Constant1' - * Constant: '/Constant2' - * Delay: '/Delay' - * Delay: '/Delay1' - * Delay: '/Delay2' - * Delay: '/Delay3' - * Gain: '/gain1' - * Gain: '/gain3' - * Product: '/x(n), x(n-1), x(n-2)' - * Product: '/y(n-1)' - * Product: '/y(n-2)' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * Sum: '/Sum5' - * Sum: '/Sum6' + /* Product: '/Product1' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant2' + * Delay: '/Delay' + * Delay: '/Delay1' + * Delay: '/Delay2' + * Delay: '/Delay3' + * Gain: '/gain1' + * Gain: '/gain3' + * Product: '/x(n), x(n-1), x(n-2)' + * Product: '/y(n-1)' + * Product: '/y(n-2)' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * Sum: '/Sum5' + * Sum: '/Sum6' */ rtb_Product1_iz = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE_c + rtb_Product1_e) + @@ -1047,12 +994,12 @@ void ADM_Integrated_Logic_step(void) } /* Sum: '/Subtract2' incorporates: - * DeadZone: '/Dead Zone' - * MultiPortSwitch: '/Multiport Switch1' - * Product: '/Product' + * DeadZone: '/Dead Zone' + * MultiPortSwitch: '/Multiport Switch1' + * Product: '/Product' * Product: '/Multiply1' * Saturate: '/DOB_Saturation' - * Sum: '/Add' + * Sum: '/Add' */ rtb_Add_e = (rtb_Add_e * 0.044648264844923756 + rtb_Product1_m) + rtb_Integrator_1 * rtb_Switch2; @@ -1097,33 +1044,16 @@ void ADM_Integrated_Logic_step(void) /* Outport: '/Debug_HAC_Pitch_angle' */ ADM_Integrated_Logic_Y.Debug_HAC_Pitch_angle = rtb_Yk1_e; - /* MATLAB Function: '/Calculate_F_c1' incorporates: - * Gain: '/Gain3' + /* MATLAB Function: '/Calculate_F_c1' incorporates: + * Gain: '/Gain3' */ ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_Value_for_Brake, 0.017453292519943295 * rtb_Yk1_e, &rtb_Switch2); - /* Product: '/Product1' incorporates: - * Constant: '/Constant' - * Gain: '/gain' - * Inport: '/GV_IMU_AX_Val' - * Product: '/Product11' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * UnitDelay: '/d' - * UnitDelay: '/d1' - */ - rtb_Desired_Torque = ((ADM_Integrated_Logic_U.GV_IMU_AX_Val + - ADM_Integrated_Logic_DW.d1_DSTATE_ob) * 0.002 + 0.061661977236758134 * - ADM_Integrated_Logic_DW.d_DSTATE_e) / - 0.065661977236758137; - /* Product: '/Product1' incorporates: * Constant: '/Constant' * Gain: '/gain' - * Inport: '/GV_IMU_AY_Val' + * Inport: '/GV_IMU_AX_Val' * Product: '/Product11' * Sum: '/Sum1' * Sum: '/Sum2' @@ -1132,15 +1062,15 @@ void ADM_Integrated_Logic_step(void) * UnitDelay: '/d' * UnitDelay: '/d1' */ - rtb_output_p = ((ADM_Integrated_Logic_U.GV_IMU_AY_Val + - ADM_Integrated_Logic_DW.d1_DSTATE_i) * 0.002 + - 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_p) / + rtb_Desired_Torque = ((ADM_Integrated_Logic_U.GV_IMU_AX_Val + + ADM_Integrated_Logic_DW.d1_DSTATE_ob) * 0.002 + 0.061661977236758134 * + ADM_Integrated_Logic_DW.d_DSTATE_e) / 0.065661977236758137; /* Product: '/Product1' incorporates: * Constant: '/Constant' * Gain: '/gain' - * Inport: '/GV_IMU_AZ_Val' + * Inport: '/GV_IMU_AY_Val' * Product: '/Product11' * Sum: '/Sum1' * Sum: '/Sum2' @@ -1149,12 +1079,29 @@ void ADM_Integrated_Logic_step(void) * UnitDelay: '/d' * UnitDelay: '/d1' */ + rtb_output_p = ((ADM_Integrated_Logic_U.GV_IMU_AY_Val + + ADM_Integrated_Logic_DW.d1_DSTATE_i) * 0.002 + + 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_p) / + 0.065661977236758137; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Inport: '/GV_IMU_AZ_Val' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ rtb_Integrator_1 = ((ADM_Integrated_Logic_U.GV_IMU_AZ_Val + ADM_Integrated_Logic_DW.d1_DSTATE_o1) * 0.002 + 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_n) / 0.065661977236758137; - /* MATLAB Function: '/Pitch_calculate' */ + /* MATLAB Function: '/Pitch_calculate' */ /* This function calculates the pitch angle using accelerometer data. */ /* Inputs: */ /* ax - Acceleration in the x-axis */ @@ -1181,27 +1128,27 @@ void ADM_Integrated_Logic_step(void) /* If ay and az are both zero, pitch is set to 0 */ } - /* Sum: '/Sum' incorporates: - * DiscreteIntegrator: '/Integrator_2' - * MATLAB Function: '/Pitch_calculate' + /* Sum: '/Sum' incorporates: + * DiscreteIntegrator: '/Integrator_2' + * MATLAB Function: '/Pitch_calculate' */ /* Step 3: Convert radians to degrees */ /* : pitch = pitch * (180 / pi); */ /* Convert to degrees */ - rtb_Sum_f = ADM_Integrated_Logic_DW.Integrator_2_DSTATE - rtb_Switch2 * + rtb_Sum = ADM_Integrated_Logic_DW.Integrator_2_DSTATE - rtb_Switch2 * 57.295779513082323; - /* Product: '/Product1' incorporates: - * Constant: '/Constant' - * Gain: '/gain' + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' * Inport: '/GV_IMU_PitchRtVal' - * Product: '/Product11' - * Sum: '/Sum1' - * Sum: '/Sum2' - * Sum: '/Sum3' - * Sum: '/Sum4' - * UnitDelay: '/d' - * UnitDelay: '/d1' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' */ rtb_Product1_f = ((ADM_Integrated_Logic_U.GV_IMU_PitchRtVal + ADM_Integrated_Logic_DW.d1_DSTATE_a) * 0.002 + @@ -1221,26 +1168,26 @@ void ADM_Integrated_Logic_step(void) */ ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l); - /* Product: '/delta rise limit' incorporates: - * SampleTimeMath: '/sample time' + /* Product: '/delta rise limit' incorporates: + * SampleTimeMath: '/sample time' * - * About '/sample time': + * About '/sample time': * y = K where K = ( w * Ts ) * */ rtb_Switch2 = rtb_y_l * 0.002; - /* UnitDelay: '/Delay Input2' + /* UnitDelay: '/Delay Input2' * - * Block description for '/Delay Input2': + * Block description for '/Delay Input2': * * Store in Global RAM */ rtb_Yk1_p = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c; - /* Sum: '/Difference Inputs1' incorporates: + /* Sum: '/Difference Inputs1' incorporates: * Inport: '/GV_RWA_RackAngleCommand' * - * Block description for '/Difference Inputs1': + * Block description for '/Difference Inputs1': * * Add in CPU */ @@ -1256,10 +1203,10 @@ void ADM_Integrated_Logic_step(void) * RelationalOperator: '/LowerRelop1' */ if (rtb_UkYk1_j <= rtb_Switch2) { - /* Product: '/delta fall limit' incorporates: - * SampleTimeMath: '/sample time' + /* Product: '/delta fall limit' incorporates: + * SampleTimeMath: '/sample time' * - * About '/sample time': + * About '/sample time': * y = K where K = ( w * Ts ) * */ rtb_Switch2 = rtb_y_l * 0.002; @@ -1276,9 +1223,9 @@ void ADM_Integrated_Logic_step(void) /* End of Switch: '/Switch2' */ - /* Sum: '/Difference Inputs2' + /* Sum: '/Difference Inputs2' * - * Block description for '/Difference Inputs2': + * Block description for '/Difference Inputs2': * * Add in CPU */ @@ -1290,26 +1237,26 @@ void ADM_Integrated_Logic_step(void) /* MATLAB Function: '/MATLAB Function5' */ ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l); - /* Product: '/delta rise limit' incorporates: - * SampleTimeMath: '/sample time' + /* Product: '/delta rise limit' incorporates: + * SampleTimeMath: '/sample time' * - * About '/sample time': + * About '/sample time': * y = K where K = ( w * Ts ) * */ rtb_Switch2 = rtb_y_l * 0.002; - /* UnitDelay: '/Delay Input2' + /* UnitDelay: '/Delay Input2' * - * Block description for '/Delay Input2': + * Block description for '/Delay Input2': * * Store in Global RAM */ rtb_UkYk1_j = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i; - /* Sum: '/Difference Inputs1' incorporates: + /* Sum: '/Difference Inputs1' incorporates: * Inport: '/GV_RWS_RackAngleCommand' * - * Block description for '/Difference Inputs1': + * Block description for '/Difference Inputs1': * * Add in CPU */ @@ -1324,10 +1271,10 @@ void ADM_Integrated_Logic_step(void) * RelationalOperator: '/LowerRelop1' */ if (rtb_Add1 <= rtb_Switch2) { - /* Product: '/delta fall limit' incorporates: - * SampleTimeMath: '/sample time' + /* Product: '/delta fall limit' incorporates: + * SampleTimeMath: '/sample time' * - * About '/sample time': + * About '/sample time': * y = K where K = ( w * Ts ) * */ rtb_Switch2 = rtb_y_l * 0.002; @@ -1344,9 +1291,9 @@ void ADM_Integrated_Logic_step(void) /* End of Switch: '/Switch2' */ - /* Sum: '/Difference Inputs2' + /* Sum: '/Difference Inputs2' * - * Block description for '/Difference Inputs2': + * Block description for '/Difference Inputs2': * * Add in CPU */ @@ -1371,176 +1318,165 @@ void ADM_Integrated_Logic_step(void) */ ADM_Integrated_Logic_DW.DelayInput2_DSTATE_m = rtb_Yk1_e; - /* Update for DiscreteIntegrator: '/Integrator_2' incorporates: - * Constant: '/I_gain' - * Constant: '/P_gain' - * DiscreteIntegrator: '/Integrator_1' - * Product: '/Product' - * Product: '/Product1' - * Sum: '/Sum1' - * Sum: '/Sum2' + /* Update for DiscreteIntegrator: '/Integrator_2' incorporates: + * Constant: '/I_gain' + * Constant: '/P_gain' + * DiscreteIntegrator: '/Integrator_1' + * Product: '/Product' + * Product: '/Product1' + * Sum: '/Sum1' + * Sum: '/Sum2' */ ADM_Integrated_Logic_DW.Integrator_2_DSTATE += (rtb_Product1_f - - (ADM_Integrated_Logic_DW.Integrator_1_DSTATE * 5.0 + rtb_Sum_f * 100.0)) * + (ADM_Integrated_Logic_DW.Integrator_1_DSTATE * 5.0 + rtb_Sum * 100.0)) * 0.002; - /* Update for Delay: '/Memory' */ + /* Update for Delay: '/Memory' */ ADM_Integrated_Logic_DW.Memory_DSTATE = rtb_deltafalllimit_m; /* Update for DiscreteTransferFcn: '/Discrete Transfer Fcn' */ ADM_Integrated_Logic_DW.DiscreteTransferFcn_states = rtb_Vx_Cmd_R - -0.9375 * ADM_Integrated_Logic_DW.DiscreteTransferFcn_states; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE = rtb_output_a; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE = rtb_Brake_Torque_Cmd; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_i = rtb_Brake_Torque_Cmd; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_p = rtb_Sum1_i2; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_c = rtb_Sum1_i2; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_h = rtb_Sum1_o1; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_d = rtb_Sum1_o1; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_l = rtb_Sum1_lm; - /* Update for Delay: '/Delay1' */ + /* Update for Delay: '/Delay1' */ ADM_Integrated_Logic_DW.Delay1_DSTATE = rtb_Gain_c; - /* Update for Delay: '/Delay' */ + /* Update for Delay: '/Delay' */ ADM_Integrated_Logic_DW.Delay_DSTATE[0] = ADM_Integrated_Logic_DW.Delay_DSTATE[1]; ADM_Integrated_Logic_DW.Delay_DSTATE[1] = rtb_Gain_c; - /* Update for Delay: '/Delay2' */ + /* Update for Delay: '/Delay2' */ ADM_Integrated_Logic_DW.Delay2_DSTATE = rtb_Product1_pd; - /* Update for Delay: '/Delay3' */ + /* Update for Delay: '/Delay3' */ ADM_Integrated_Logic_DW.Delay3_DSTATE[0] = ADM_Integrated_Logic_DW.Delay3_DSTATE[1]; ADM_Integrated_Logic_DW.Delay3_DSTATE[1] = rtb_Product1_pd; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_e = rtb_Product1_pd; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_ij = rtb_Product1_m; /* Update for Memory: '/Memory' */ ADM_Integrated_Logic_DW.Memory_PreviousInput = rtb_Add_e; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_ir = rtb_Brake_Torque_Cmd; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_o = rtb_Error_m; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_m = rtb_Error_m; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_hm = rtb_Sum1_aj; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_mw = rtb_Sum1_aj; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_g = rtb_Sum1_p; - /* Update for UnitDelay: '/d1' */ + /* Update for UnitDelay: '/d1' */ ADM_Integrated_Logic_DW.d1_DSTATE_ej = rtb_Add3; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_j = rtb_Product1_e; - /* Update for Delay: '/Delay1' */ + /* Update for Delay: '/Delay1' */ ADM_Integrated_Logic_DW.Delay1_DSTATE_c = rtb_Product1_e; - /* Update for Delay: '/Delay' */ + /* Update for Delay: '/Delay' */ ADM_Integrated_Logic_DW.Delay_DSTATE_p[0] = ADM_Integrated_Logic_DW.Delay_DSTATE_p[1]; ADM_Integrated_Logic_DW.Delay_DSTATE_p[1] = rtb_Product1_e; - /* Update for Delay: '/Delay2' */ + /* Update for Delay: '/Delay2' */ ADM_Integrated_Logic_DW.Delay2_DSTATE_n = rtb_Product1_iz; - /* Update for Delay: '/Delay3' */ + /* Update for Delay: '/Delay3' */ ADM_Integrated_Logic_DW.Delay3_DSTATE_h[0] = ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1]; ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1] = rtb_Product1_iz; - /* Update for UnitDelay: '/d1' incorporates: + /* Update for UnitDelay: '/d1' incorporates: * Inport: '/GV_IMU_AX_Val' */ ADM_Integrated_Logic_DW.d1_DSTATE_ob = ADM_Integrated_Logic_U.GV_IMU_AX_Val; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_e = rtb_Desired_Torque; - /* Update for UnitDelay: '/d1' incorporates: + /* Update for UnitDelay: '/d1' incorporates: * Inport: '/GV_IMU_AY_Val' */ ADM_Integrated_Logic_DW.d1_DSTATE_i = ADM_Integrated_Logic_U.GV_IMU_AY_Val; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_p = rtb_output_p; - /* Update for UnitDelay: '/d1' incorporates: + /* Update for UnitDelay: '/d1' incorporates: * Inport: '/GV_IMU_AZ_Val' */ ADM_Integrated_Logic_DW.d1_DSTATE_o1 = ADM_Integrated_Logic_U.GV_IMU_AZ_Val; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_n = rtb_Integrator_1; - /* Update for DiscreteIntegrator: '/Integrator_1' */ - ADM_Integrated_Logic_DW.Integrator_1_DSTATE += 0.002 * rtb_Sum_f; + /* Update for DiscreteIntegrator: '/Integrator_1' */ + ADM_Integrated_Logic_DW.Integrator_1_DSTATE += 0.002 * rtb_Sum; - /* Update for UnitDelay: '/d1' incorporates: + /* Update for UnitDelay: '/d1' incorporates: * Inport: '/GV_IMU_PitchRtVal' */ ADM_Integrated_Logic_DW.d1_DSTATE_a = ADM_Integrated_Logic_U.GV_IMU_PitchRtVal; - /* Update for UnitDelay: '/d' */ + /* Update for UnitDelay: '/d' */ ADM_Integrated_Logic_DW.d_DSTATE_d1 = rtb_Product1_f; - /* Update for UnitDelay: '/Delay Input2' - * - * Block description for '/Delay Input2': - * - * Store in Global RAM - */ - ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c = rtb_Yk1_p; - /* Update for UnitDelay: '/Delay Input2' * * Block description for '/Delay Input2': * * Store in Global RAM */ - ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i = rtb_Switch2; - if (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] == 0) { - /* Update absolute timer for sample time: [1.0s, 0.0s] */ - /* The "clockTick1" counts the number of times the code of this task has - * been executed. The resolution of this integer timer is 1.0, which is the step size - * of the task. Size of "clockTick1" ensures timer will not overflow during the - * application lifespan selected. - */ - ADM_Integrated_Logic_M->Timing.clockTick1++; - } + ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c = rtb_Yk1_p; - rate_scheduler(); + /* Update for UnitDelay: '/Delay Input2' + * + * Block description for '/Delay Input2': + * + * Store in Global RAM + */ + ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i = rtb_Switch2; } /* Model initialize function */ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.h b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.h index 01ea5e39..324de624 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.h +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.h @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 @@ -33,65 +33,64 @@ /* Block signals and states (default storage) for system '' */ typedef struct { - double Delay_DSTATE[2]; /* '/Delay' */ - double Delay3_DSTATE[2]; /* '/Delay3' */ - double Delay_DSTATE_p[2]; /* '/Delay' */ - double Delay3_DSTATE_h[2]; /* '/Delay3' */ - double Saturation; /* '/Saturation' */ + double Delay_DSTATE[2]; /* '/Delay' */ + double Delay3_DSTATE[2]; /* '/Delay3' */ + double Delay_DSTATE_p[2]; /* '/Delay' */ + double Delay3_DSTATE_h[2]; /* '/Delay3' */ double DelayInput2_DSTATE; /* '/Delay Input2' */ double DelayInput2_DSTATE_m; /* '/Delay Input2' */ - double Integrator_2_DSTATE; /* '/Integrator_2' */ - double Memory_DSTATE; /* '/Memory' */ + double Integrator_2_DSTATE; /* '/Integrator_2' */ + double Memory_DSTATE; /* '/Memory' */ double DiscreteTransferFcn_states; /* '/Discrete Transfer Fcn' */ - double d1_DSTATE; /* '/d1' */ - double d_DSTATE; /* '/d' */ - double d_DSTATE_i; /* '/d' */ - double d1_DSTATE_p; /* '/d1' */ - double d_DSTATE_c; /* '/d' */ - double d1_DSTATE_h; /* '/d1' */ - double d_DSTATE_d; /* '/d' */ - double d1_DSTATE_l; /* '/d1' */ - double Delay1_DSTATE; /* '/Delay1' */ - double Delay2_DSTATE; /* '/Delay2' */ - double d1_DSTATE_e; /* '/d1' */ - double d_DSTATE_ij; /* '/d' */ - double d_DSTATE_ir; /* '/d' */ - double d1_DSTATE_o; /* '/d1' */ - double d_DSTATE_m; /* '/d' */ - double d1_DSTATE_hm; /* '/d1' */ - double d_DSTATE_mw; /* '/d' */ - double d1_DSTATE_g; /* '/d1' */ - double d1_DSTATE_ej; /* '/d1' */ - double d_DSTATE_j; /* '/d' */ - double Delay1_DSTATE_c; /* '/Delay1' */ - double Delay2_DSTATE_n; /* '/Delay2' */ - double d1_DSTATE_ob; /* '/d1' */ - double d_DSTATE_e; /* '/d' */ - double d1_DSTATE_i; /* '/d1' */ - double d_DSTATE_p; /* '/d' */ - double d1_DSTATE_o1; /* '/d1' */ - double d_DSTATE_n; /* '/d' */ - double Integrator_1_DSTATE; /* '/Integrator_1' */ - double d1_DSTATE_a; /* '/d1' */ - double d_DSTATE_d1; /* '/d' */ - double DelayInput2_DSTATE_c; /* '/Delay Input2' */ - double DelayInput2_DSTATE_i; /* '/Delay Input2' */ + double d1_DSTATE; /* '/d1' */ + double d_DSTATE; /* '/d' */ + double d_DSTATE_i; /* '/d' */ + double d1_DSTATE_p; /* '/d1' */ + double d_DSTATE_c; /* '/d' */ + double d1_DSTATE_h; /* '/d1' */ + double d_DSTATE_d; /* '/d' */ + double d1_DSTATE_l; /* '/d1' */ + double Delay1_DSTATE; /* '/Delay1' */ + double Delay2_DSTATE; /* '/Delay2' */ + double d1_DSTATE_e; /* '/d1' */ + double d_DSTATE_ij; /* '/d' */ + double d_DSTATE_ir; /* '/d' */ + double d1_DSTATE_o; /* '/d1' */ + double d_DSTATE_m; /* '/d' */ + double d1_DSTATE_hm; /* '/d1' */ + double d_DSTATE_mw; /* '/d' */ + double d1_DSTATE_g; /* '/d1' */ + double d1_DSTATE_ej; /* '/d1' */ + double d_DSTATE_j; /* '/d' */ + double Delay1_DSTATE_c; /* '/Delay1' */ + double Delay2_DSTATE_n; /* '/Delay2' */ + double d1_DSTATE_ob; /* '/d1' */ + double d_DSTATE_e; /* '/d' */ + double d1_DSTATE_i; /* '/d1' */ + double d_DSTATE_p; /* '/d' */ + double d1_DSTATE_o1; /* '/d1' */ + double d_DSTATE_n; /* '/d' */ + double Integrator_1_DSTATE; /* '/Integrator_1' */ + double d1_DSTATE_a; /* '/d1' */ + double d_DSTATE_d1; /* '/d' */ + double DelayInput2_DSTATE_c; /* '/Delay Input2' */ + double DelayInput2_DSTATE_i; /* '/Delay Input2' */ double PrevY; /* '/Input_Vx_RateLimiter' */ double PrevY_o; /* '/Brake_Out_RateLimiter' */ double PrevY_a; /* '/TargetSpd_RateLimiter' */ double Memory_PreviousInput; /* '/Memory' */ - double HAC_ON_FLAG; /* '/HAC_OFF_OK_Func' */ - double Smoothed_Torque; /* '/HAC_OFF_OK_Func' */ - double HAC_Desired_Torque; /* '/HAC_OFF_OK_Func' */ - double HAC_ON_Timer; /* '/HAC_OFF_OK_Func' */ - uint8_t is_active_c6_ADM_Integrated_Log;/* '/Chart' */ - uint8_t is_c6_ADM_Integrated_Logic; /* '/Chart' */ + double HAC_ON_FLAG; /* '/HAC_OFF_OK_Func' */ + double Smoothed_Torque; /* '/HAC_OFF_OK_Func' */ + double HAC_Desired_Torque; /* '/HAC_OFF_OK_Func' */ + double HAC_ON_Timer; /* '/HAC_OFF_OK_Func' */ + uint8_t is_active_c6_ADM_Integrated_Log;/* '/Chart' */ + uint8_t is_c6_ADM_Integrated_Logic; /* '/Chart' */ } DW_ADM_Integrated_Logic_T; /* Invariant block signals (default storage) */ typedef struct { - const double W_value; /* '/Multiply' */ - const double W_Value_for_Brake; /* '/Multiply4' */ + const double W_value; /* '/Multiply' */ + const double W_Value_for_Brake; /* '/Multiply4' */ } ConstB_ADM_Integrated_Logic_T; /* External inputs (root inport signals with default storage) */ @@ -129,21 +128,6 @@ typedef struct { double GV_Gear_Postion_Out; /* '/GV_Gear_Postion_Out' */ } ExtY_ADM_Integrated_Logic_T; -/* Real-time Model Data Structure */ -struct tag_RTM_ADM_Integrated_Logic_T { - /* - * Timing: - * The following substructure contains information regarding - * the timing information for the model. - */ - struct { - uint32_t clockTick1; - struct { - uint16_t TID[2]; - } TaskCounters; - } Timing; -}; - /* Block signals and states (default storage) */ extern DW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW; @@ -159,46 +143,43 @@ extern void ADM_Integrated_Logic_initialize(void); extern void ADM_Integrated_Logic_step(void); extern void ADM_Integrated_Logic_terminate(void); -/* Real-time Model object */ -extern RT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M; - /*- * These blocks were eliminated from the model due to optimizations: * - * Block '/BW_PI' : Unused code path elimination - * Block '/Constant1' : Unused code path elimination - * Block '/Constant16' : Unused code path elimination - * Block '/Constant17' : Unused code path elimination - * Block '/Constant2' : Unused code path elimination + * Block '/BW_PI' : Unused code path elimination + * Block '/Constant1' : Unused code path elimination + * Block '/Constant16' : Unused code path elimination + * Block '/Constant17' : Unused code path elimination + * Block '/Constant2' : Unused code path elimination * Block '/Data Type Conversion2' : Unused code path elimination * Block '/Gain2' : Unused code path elimination - * Block '/Abs' : Unused code path elimination - * Block '/Brake_Saturation' : Unused code path elimination - * Block '/Multiply5' : Unused code path elimination - * Block '/Radius1' : Unused code path elimination + * Block '/Abs' : Unused code path elimination + * Block '/Brake_Saturation' : Unused code path elimination + * Block '/Multiply5' : Unused code path elimination + * Block '/Radius1' : Unused code path elimination * Block '/FixPt Data Type Duplicate' : Unused code path elimination * Block '/Data Type Duplicate' : Unused code path elimination * Block '/Data Type Propagation' : Unused code path elimination * Block '/FixPt Data Type Duplicate' : Unused code path elimination * Block '/Data Type Duplicate' : Unused code path elimination * Block '/Data Type Propagation' : Unused code path elimination - * Block '/Scope2' : Unused code path elimination - * Block '/FixPt Data Type Duplicate' : Unused code path elimination + * Block '/Scope2' : Unused code path elimination + * Block '/FixPt Data Type Duplicate' : Unused code path elimination * Block '/Data Type Duplicate' : Unused code path elimination * Block '/Data Type Propagation' : Unused code path elimination - * Block '/FixPt Data Type Duplicate' : Unused code path elimination + * Block '/FixPt Data Type Duplicate' : Unused code path elimination * Block '/Data Type Duplicate' : Unused code path elimination * Block '/Data Type Propagation' : Unused code path elimination * Block '/ControlFlag' : Eliminated nontunable gain of 1 - * Block '/FBGain' : Eliminated nontunable gain of 1 - * Block '/FFGain' : Eliminated nontunable gain of 1 + * Block '/FBGain' : Eliminated nontunable gain of 1 + * Block '/FFGain' : Eliminated nontunable gain of 1 * Block '/Data Type Conversion1' : Eliminate redundant data type conversion * Block '/Data Type Conversion3' : Eliminate redundant data type conversion - * Block '/HAC_Gain' : Eliminated nontunable gain of 1 + * Block '/HAC_Gain' : Eliminated nontunable gain of 1 * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical - * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical + * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical */ /*- @@ -220,47 +201,47 @@ extern RT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M; * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Compare To Constant' * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1' * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Brake_Func' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate' - * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Ramp' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Gear_Func1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3' + * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate' * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic' * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1' * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_R' diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.mk b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.mk index 6c6cfb93..2d8a052a 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.mk +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic.mk @@ -2,7 +2,7 @@ ## Makefile generated for component 'ADM_Integrated_Logic'. ## ## Makefile : ADM_Integrated_Logic.mk -## Generated on : Tue Apr 29 10:59:09 2025 +## Generated on : Wed Jun 04 15:26:02 2025 ## Final product: $(RELATIVE_PATH_TO_ANCHOR)\ADM_Integrated_Logic.exe ## Product type : executable ## @@ -23,7 +23,7 @@ MAKEFILE = ADM_Integrated_Logic.mk MATLAB_ROOT = C:\PROGRA~1\MATLAB\R2024a MATLAB_BIN = C:\PROGRA~1\MATLAB\R2024a\bin MATLAB_ARCH_BIN = $(MATLAB_BIN)\win64 -START_DIR = C:\Users\MSI\SYNOLO~1\3min_be\한자연\!과제\배송모~1\!진행~1\2025\25-04-~4 +START_DIR = C:\Users\MSI\DOCUME~1\WORKSP~4\git\ADM\_ADM_I~1 SOLVER = SOLVER_OBJ = CLASSIC_INTERFACE = 0 @@ -175,7 +175,7 @@ INCLUDES = $(INCLUDES_BUILDINFO) DEFINES_BUILD_ARGS = -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 DEFINES_CUSTOM = DEFINES_OPTS = -DTID01EQ=0 -DEFINES_STANDARD = -DMODEL=ADM_Integrated_Logic -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 +DEFINES_STANDARD = -DMODEL=ADM_Integrated_Logic -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 DEFINES = $(DEFINES_BUILD_ARGS) $(DEFINES_CUSTOM) $(DEFINES_OPTS) $(DEFINES_STANDARD) diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_comp.rsp b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_comp.rsp index 142f0087..e1573c38 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_comp.rsp +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_comp.rsp @@ -1,5 +1,5 @@ --I"C:\Users\MSI\SynologyDrive\3min_be\한자연\!과제\배송모빌리티\!진행상황\2025\25-04-28-월 통합 로직 수정본 수신(시뮬링크)" --I"C:\Users\MSI\SynologyDrive\3min_be\한자연\!과제\배송모빌리티\!진행상황\2025\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\ADM_Integrated_Logic_ert_rtw" +-I"C:\Users\MSI\Documents\WorkSpace\git\ADM\[ADM] Integrated Logic" +-I"C:\Users\MSI\Documents\WorkSpace\git\ADM\[ADM] Integrated Logic\ADM_Integrated_Logic_ert_rtw" -I"C:\Program Files\MATLAB\R2024a\extern\include" -I"C:\Program Files\MATLAB\R2024a\simulink\include" -I"C:\Program Files\MATLAB\R2024a\rtw\c\src" diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_data.c b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_data.c index 2af73abe..01dff3b9 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_data.c +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_data.c @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 @@ -24,8 +24,8 @@ /* Invariant block signals (default storage) */ const ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB = { - 12753.0, /* '/Multiply' */ - 12753.0 /* '/Multiply4' */ + 12753.0, /* '/Multiply' */ + 12753.0 /* '/Multiply4' */ }; /* diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_private.h b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_private.h index f1f21c94..88bd0d47 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_private.h +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_private.h @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_types.h b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_types.h index 870cc7a8..205bc3e4 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_types.h +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ADM_Integrated_Logic_types.h @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 @@ -22,10 +22,6 @@ #ifndef ADM_Integrated_Logic_types_h_ #define ADM_Integrated_Logic_types_h_ - -/* Forward declaration for rtModel */ -typedef struct tag_RTM_ADM_Integrated_Logic_T RT_MODEL_ADM_Integrated_Logic_T; - #endif /* ADM_Integrated_Logic_types_h_ */ /* diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/buildInfo.mat b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/buildInfo.mat index ec2b5be8..46ae507f 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/buildInfo.mat and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/buildInfo.mat differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codeInfo.mat b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codeInfo.mat index a33c704d..71f1bf8b 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codeInfo.mat and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codeInfo.mat differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codedescriptor.dmr b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codedescriptor.dmr index 028a448a..1078e3d1 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codedescriptor.dmr and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/codedescriptor.dmr differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/compileInfo.mat b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/compileInfo.mat index 28563020..b3c7b18c 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/compileInfo.mat and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/compileInfo.mat differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/complex_types.h b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/complex_types.h index 177b43ed..8f482546 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/complex_types.h +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/complex_types.h @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ert_main.c b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ert_main.c index 317d977d..f9d4b339 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ert_main.c +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/ert_main.c @@ -7,9 +7,9 @@ * * Code generated for Simulink model 'ADM_Integrated_Logic'. * - * Model version : 13.55 + * Model version : 13.63 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023 - * C/C++ source code generated on : Wed May 7 21:12:17 2025 + * C/C++ source code generated on : Wed Jun 4 15:25:59 2025 * * Target selection: ert.tlc * Embedded hardware selection: NXP->Cortex-M4 diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/data/data.js b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/data/data.js index f6c78983..f2c0e44f 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/data/data.js +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/data/data.js @@ -1 +1 @@ -var dataJson = {"arch":{"ispc":true,"isunix":false,"ismac":false},"build":"ADM_Integrated_Logic","ref":false,"files":[{"name":"ert_main.c","type":"source","group":"main","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Main file","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ert_main.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \r\n#include /* This example main program uses printf/fflush */\r\n#include \"ADM_Integrated_Logic.h\" /* Model header file */\r\n\r\n/*\r\n * Associating rt_OneStep with a real-time clock or interrupt service routine\r\n * is what makes the generated code \"real-time\". The function rt_OneStep is\r\n * always associated with the base rate of the model. Subrates are managed\r\n * by the base rate from inside the generated code. Enabling/disabling\r\n * interrupts and floating point context switches are target specific. This\r\n * example code indicates where these should take place relative to executing\r\n * the generated code step function. Overrun behavior should be tailored to\r\n * your application needs. This example simply sets an error status in the\r\n * real-time model and returns from rt_OneStep.\r\n */\r\nvoid rt_OneStep(void);\r\nvoid rt_OneStep(void)\r\n{\r\n static bool OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n\r\n /* Check for overrun */\r\n if (OverrunFlag) {\r\n return;\r\n }\r\n\r\n OverrunFlag = true;\r\n\r\n /* Save FPU context here (if necessary) */\r\n /* Re-enable timer or interrupt here */\r\n /* Set model inputs here */\r\n\r\n /* Step the model */\r\n ADM_Integrated_Logic_step();\r\n\r\n /* Get model outputs here */\r\n\r\n /* Indicate task complete */\r\n OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n /* Restore FPU context here (if necessary) */\r\n /* Enable interrupts here */\r\n}\r\n\r\n/*\r\n * The example main function illustrates what is required by your\r\n * application code to initialize, execute, and terminate the generated code.\r\n * Attaching rt_OneStep to a real-time clock is target specific. This example\r\n * illustrates how you do this relative to initializing the model.\r\n */\r\nint main(int argc, const char *argv[])\r\n{\r\n /* Unused arguments */\r\n (void)(argc);\r\n (void)(argv);\r\n\r\n /* Initialize model */\r\n ADM_Integrated_Logic_initialize();\r\n\r\n /* Attach rt_OneStep to a timer or interrupt service routine with\r\n * period 0.002 seconds (base rate of the model) here.\r\n * The call syntax for rt_OneStep is\r\n *\r\n * rt_OneStep();\r\n */\r\n printf(\"Warning: The simulation will run forever. \"\r\n \"Generated ERT main won't simulate model step behavior. \"\r\n \"To change this behavior select the 'MAT-file logging' option.\\n\");\r\n fflush((NULL));\r\n while (1) {\r\n /* Perform application tasks here */\r\n }\r\n\r\n /* The option 'Remove error status field in real-time model data structure'\r\n * is selected, therefore the following code does not need to execute.\r\n */\r\n\r\n /* Terminate model */\r\n ADM_Integrated_Logic_terminate();\r\n return 0;\r\n}\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic.c","type":"source","group":"model","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \"ADM_Integrated_Logic.h\"\r\n#include \r\n#include \"ADM_Integrated_Logic_private.h\"\r\n#include \r\n#include \r\n\r\n/* Named constants for Chart: '/Chart' */\r\n#define ADM_Integrated_Logic_IN_HAC_OFF ((uint8_t)1U)\r\n#define ADM_Integrated_Logic_IN_HAC_ON ((uint8_t)2U)\r\n\r\n/* Block signals and states (default storage) */\r\nDW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\nExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\nExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y;\r\n\r\n/* Real-time model */\r\nstatic RT_MODEL_ADM_Integrated_Logic_T ADM_Integrated_Logic_M_;\r\nRT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M =\r\n &ADM_Integrated_Logic_M_;\r\nstatic void rate_scheduler(void);\r\n\r\n/*\r\n * This function updates active task flag for each subrate.\r\n * The function is called at model base rate, hence the\r\n * generated code self-manages all its subrates.\r\n */\r\nstatic void rate_scheduler(void)\r\n{\r\n /* Compute which subrates run during the next base time step. Subrates\r\n * are an integer multiple of the base rate counter. Therefore, the subtask\r\n * counter is reset when it reaches its limit (zero means run).\r\n */\r\n (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1])++;\r\n if ((ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1]) > 499) {/* Sample time: [1.0s, 0.0s] */\r\n ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] = 0;\r\n }\r\n}\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/Calculate_F_c'\r\n * '/Calculate_F_c1'\r\n */\r\nvoid ADM_Integrated_Lo_Calculate_F_c(double rtu_W, double rtu_theta, double\r\n *rty_F_c)\r\n{\r\n /* : F_c= W*sin(theta); */\r\n *rty_F_c = rtu_W * sin(rtu_theta);\r\n}\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/MATLAB Function1'\r\n * '/MATLAB Function5'\r\n */\r\nvoid ADM_Integrated__MATLABFunction1(double rtu_u, double *rty_y)\r\n{\r\n *rty_y = rtu_u;\r\n\r\n /* : if u < 140 */\r\n if (rtu_u < 140.0) {\r\n /* : u = 140; */\r\n *rty_y = 140.0;\r\n }\r\n\r\n /* : y = u; */\r\n}\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/MATLAB Function2'\r\n * '/MATLAB Function6'\r\n */\r\nvoid ADM_Integrated__MATLABFunction2(double rtu_u, double *rty_y)\r\n{\r\n *rty_y = rtu_u;\r\n\r\n /* : if u > -140 */\r\n if (rtu_u > -140.0) {\r\n /* : u = -140; */\r\n *rty_y = -140.0;\r\n }\r\n\r\n /* : y = u; */\r\n}\r\n\r\n/* Model step function */\r\nvoid ADM_Integrated_Logic_step(void)\r\n{\r\n double rtb_Add1;\r\n double rtb_Add1_tmp;\r\n double rtb_Add3;\r\n double rtb_Add_e;\r\n double rtb_Brake_Torque_Cmd;\r\n double rtb_Desired_Torque;\r\n double rtb_Error_m;\r\n double rtb_Gain_c;\r\n double rtb_Integrator_1;\r\n double rtb_Product1_e;\r\n double rtb_Product1_f;\r\n double rtb_Product1_iz;\r\n double rtb_Product1_m;\r\n double rtb_Product1_pd;\r\n double rtb_Sum1_aj;\r\n double rtb_Sum1_i2;\r\n double rtb_Sum1_lm;\r\n double rtb_Sum1_o1;\r\n double rtb_Sum1_p;\r\n double rtb_Sum_f;\r\n double rtb_Switch2;\r\n double rtb_UkYk1;\r\n double rtb_UkYk1_j;\r\n double rtb_Vx_Cmd_R;\r\n double rtb_Yk1_e;\r\n double rtb_Yk1_p;\r\n double rtb_deltafalllimit_m;\r\n double rtb_output_a;\r\n double rtb_output_p;\r\n double rtb_y_l;\r\n int32_t temp_gear;\r\n bool rtb_Compare;\r\n bool rtb_Compare_d;\r\n\r\n /* RelationalOperator: '/Compare' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_Operation_Mode'\r\n */\r\n rtb_Compare = (ADM_Integrated_Logic_U.GV_Operation_Mode == 2.0);\r\n if (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] == 0) {\r\n /* Step: '/Step' incorporates:\r\n * DigitalClock: '/Digital Clock'\r\n */\r\n rtb_Add_e = ((ADM_Integrated_Logic_M->Timing.clockTick1) * 1.0);\r\n if (rtb_Add_e < 0.0) {\r\n temp_gear = 0;\r\n } else {\r\n temp_gear = 1000;\r\n }\r\n\r\n /* Product: '/Product' incorporates:\r\n * Step: '/Step'\r\n */\r\n rtb_Integrator_1 = (double)temp_gear * rtb_Add_e;\r\n\r\n /* Saturate: '/Saturation' */\r\n if (rtb_Integrator_1 > 1000.0) {\r\n /* Saturate: '/Saturation' */\r\n ADM_Integrated_Logic_DW.Saturation = 1000.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n /* Saturate: '/Saturation' */\r\n ADM_Integrated_Logic_DW.Saturation = 0.0;\r\n } else {\r\n /* Saturate: '/Saturation' */\r\n ADM_Integrated_Logic_DW.Saturation = rtb_Integrator_1;\r\n }\r\n\r\n /* End of Saturate: '/Saturation' */\r\n }\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * Constant: '/Upper_Torq'\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = 0.016;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_Yk1_e = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_m;\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Integrator_1 = 0.002;\r\n\r\n /* Saturate: '/Pitch_Saturation' incorporates:\r\n * DiscreteIntegrator: '/Integrator_2'\r\n */\r\n if (ADM_Integrated_Logic_DW.Integrator_2_DSTATE > 10.0) {\r\n rtb_Add_e = 10.0;\r\n } else if (ADM_Integrated_Logic_DW.Integrator_2_DSTATE < -10.0) {\r\n rtb_Add_e = -10.0;\r\n } else {\r\n rtb_Add_e = ADM_Integrated_Logic_DW.Integrator_2_DSTATE;\r\n }\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Saturate: '/Pitch_Saturation'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_UkYk1 = rtb_Add_e - rtb_Yk1_e;\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.002) {\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1 < -0.002) {\r\n rtb_Integrator_1 = -0.002;\r\n } else {\r\n rtb_Integrator_1 = rtb_UkYk1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Yk1_e += rtb_Integrator_1;\r\n\r\n /* MATLAB Function: '/Calculate_F_c' incorporates:\r\n * Gain: '/Gain'\r\n */\r\n ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_value,\r\n 0.017453292519943295 * rtb_Yk1_e, &rtb_UkYk1);\r\n\r\n /* Gain: '/Gain2' incorporates:\r\n * Constant: '/Radius'\r\n * Product: '/Multiply3'\r\n * Sum: '/Required_Brake_Cal'\r\n */\r\n /* : F_R= C_r*W*cos(theta); */\r\n rtb_Integrator_1 = rtb_UkYk1 * 0.292 * 0.083822296730930432;\r\n\r\n /* Saturate: '/Saturation' */\r\n if (rtb_Integrator_1 > 60.0) {\r\n rtb_Integrator_1 = 60.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Saturate: '/Saturation'\r\n * UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1 = rtb_Integrator_1 - ADM_Integrated_Logic_DW.DelayInput2_DSTATE;\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.016) {\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1 < -0.16) {\r\n rtb_Switch2 = -0.16;\r\n } else {\r\n rtb_Switch2 = rtb_UkYk1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2' incorporates:\r\n * UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1 = rtb_Switch2 + ADM_Integrated_Logic_DW.DelayInput2_DSTATE;\r\n\r\n /* Gain: '/Grade_GAIN' */\r\n rtb_Desired_Torque = 0.8 * rtb_UkYk1;\r\n\r\n /* MATLAB Function: '/Vx_OutPut_Function' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n * Inport: '/GV_Vx_Command'\r\n * Inport: '/GV_Vx_Limit'\r\n * RelationalOperator: '/Compare'\r\n */\r\n /* : if Brake_Input == 0 */\r\n if (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand < 50.0) {\r\n /* : if Vx_Limit <= Vx_Kph */\r\n if (ADM_Integrated_Logic_U.GV_Vx_Limit <=\r\n ADM_Integrated_Logic_U.GV_Vx_Command) {\r\n /* : Vx_Output = Vx_Limit; */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_U.GV_Vx_Limit;\r\n } else {\r\n /* : else */\r\n /* : Vx_Output = Vx_Kph; */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_U.GV_Vx_Command;\r\n }\r\n } else {\r\n /* : else */\r\n /* : Vx_Output = 0; */\r\n rtb_deltafalllimit_m = 0.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/Vx_OutPut_Function' */\r\n\r\n /* RateLimiter: '/Input_Vx_RateLimiter' */\r\n rtb_output_a = rtb_deltafalllimit_m - ADM_Integrated_Logic_DW.PrevY;\r\n if (rtb_output_a > 0.004) {\r\n rtb_Vx_Cmd_R = ADM_Integrated_Logic_DW.PrevY + 0.004;\r\n } else if (rtb_output_a < -0.008) {\r\n rtb_Vx_Cmd_R = ADM_Integrated_Logic_DW.PrevY - 0.008;\r\n } else {\r\n rtb_Vx_Cmd_R = rtb_deltafalllimit_m;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY = rtb_Vx_Cmd_R;\r\n\r\n /* End of RateLimiter: '/Input_Vx_RateLimiter' */\r\n\r\n /* RelationalOperator: '/Compare' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n */\r\n rtb_Compare_d = (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand >= 100.0);\r\n\r\n /* Delay: '/Memory' */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_DW.Memory_DSTATE;\r\n\r\n /* MATLAB Function: '/Gear_FUNCTION1' incorporates:\r\n * Inport: '/GV_VCU_GearSelStat'\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n /* : SAFE_SPEED_THRESHOLD = 0; */\r\n /* 안전 기어 변경 속도(kph) */\r\n /* 기본값: 현재 기어 유지 */\r\n /* : output = Current_Gear; */\r\n /* 1. P단 요청이 있을 경우: 모든 상태에서 우선 처리 */\r\n /* : if Gear_Cmd == 0 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 0.0) {\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD && Brake_Torque_Cmd == 1 */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) && rtb_Compare_d) {\r\n /* : output = 0; */\r\n rtb_deltafalllimit_m = 0.0;\r\n\r\n /* P단 진입 허용 */\r\n } else {\r\n /* : else */\r\n /* : output = Current_Gear; */\r\n /* 조건 불충족 시 유지 */\r\n }\r\n } else {\r\n /* 2. 현재 기어 상태에 따라 처리 */\r\n /* : switch Current_Gear */\r\n switch ((int32_t)rtb_deltafalllimit_m) {\r\n case 0:\r\n /* : case 0 */\r\n /* P 상태 */\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) &&\r\n ((ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 1.0) ||\r\n (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 3.0) ||\r\n (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0))) {\r\n /* : if Gear_Cmd == 1 || Gear_Cmd == 3 || Gear_Cmd == 2 */\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* P -> N (모든 경우 N을 거쳐야 하므로) */\r\n }\r\n break;\r\n\r\n case 1:\r\n /* : case 1 */\r\n /* R 상태 */\r\n /* : if Gear_Cmd == 2 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0) {\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* R -> N 허용 */\r\n }\r\n break;\r\n\r\n case 2:\r\n /* : case 2 */\r\n /* N 상태 */\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD && Brake_Torque_Cmd == 1 */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) && rtb_Compare_d) {\r\n /* : if Gear_Cmd == 1 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 1.0) {\r\n /* : output = 1; */\r\n rtb_deltafalllimit_m = 1.0;\r\n\r\n /* N -> R */\r\n } else if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 3.0) {\r\n /* : elseif Gear_Cmd == 3 */\r\n /* : output = 3; */\r\n rtb_deltafalllimit_m = 3.0;\r\n\r\n /* N -> D */\r\n }\r\n }\r\n break;\r\n\r\n case 3:\r\n /* : case 3 */\r\n /* D 상태 */\r\n /* : if Gear_Cmd == 2 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0) {\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* D -> N 허용 */\r\n }\r\n break;\r\n }\r\n }\r\n\r\n /* End of MATLAB Function: '/Gear_FUNCTION1' */\r\n\r\n /* Chart: '/Chart' incorporates:\r\n * Constant: '/Constant'\r\n * Constant: '/Constant1'\r\n * Inport: '/GV_MCU_RPM'\r\n */\r\n if (ADM_Integrated_Logic_DW.is_active_c6_ADM_Integrated_Log == 0U) {\r\n ADM_Integrated_Logic_DW.is_active_c6_ADM_Integrated_Log = 1U;\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_OFF;\r\n\r\n /* State HAC OFF */\r\n } else if (ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic ==\r\n ADM_Integrated_Logic_IN_HAC_OFF) {\r\n /* : sf_internal_predicateOutput = RPM_Input < rpm_threshold_low; */\r\n if (ADM_Integrated_Logic_U.GV_MCU_RPM < -50.0) {\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_ON;\r\n\r\n /* State HAC ON */\r\n } else {\r\n /* Outport: '/Debug_HAC_RPM_Decision' */\r\n /* : HAC_Output = 0; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision = 0.0;\r\n }\r\n\r\n /* case IN_HAC_ON: */\r\n /* : sf_internal_predicateOutput = RPM_Input > rpm_threshold_high; */\r\n } else if (ADM_Integrated_Logic_U.GV_MCU_RPM > 150.0) {\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_OFF;\r\n\r\n /* State HAC OFF */\r\n } else {\r\n /* Outport: '/Debug_HAC_RPM_Decision' */\r\n /* : HAC_Output = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision = 1.0;\r\n }\r\n\r\n /* End of Chart: '/Chart' */\r\n\r\n /* MATLAB Function: '/HAC_OFF_OK_Func' */\r\n /* Input Parameters: */\r\n /* Desired_Brake_Torque_Cmd: Commanded brake torque when HAC is ON */\r\n /* Desired_Torque: Required torque at the slope */\r\n /* Feedback_Torque: Torque output from the motor */\r\n /* HAC_Flag: Current HAC state flag */\r\n /* Output Parameters: */\r\n /* Brake_Torque_Cmd: Actual brake torque command */\r\n /* HAC_ON_OFF_CHECK: Status of HAC (ON or OFF) */\r\n /* Persistent variable to track if HAC has ever been ON */\r\n /* Initialize HAC_ON_FLAG if it is empty */\r\n /* : if isempty(HAC_ON_FLAG) */\r\n /* Persistent variable for torque smoothing logic */\r\n /* : if isempty(Smoothed_Torque) */\r\n /* Persistent variable to store HAC ON Desired Torque */\r\n /* : if isempty(HAC_Desired_Torque) */\r\n /* Persistent variable to track HAC ON time */\r\n /* : if isempty(HAC_ON_Timer) */\r\n /* Initialize outputs */\r\n /* : Brake_Torque_Cmd = 0; */\r\n rtb_Brake_Torque_Cmd = 0.0;\r\n\r\n /* Outport: '/Debug_HAC_FLAG' incorporates:\r\n * MATLAB Function: '/HAC_OFF_OK_Func'\r\n */\r\n /* : HAC_ON_OFF_CHECK = 0; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 0.0;\r\n\r\n /* MATLAB Function: '/HAC_OFF_OK_Func' incorporates:\r\n * Constant: '/Accel_Cmd '\r\n * Constant: '/Brake_Cmd'\r\n * Constant: '/Gear_D'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n * Inport: '/GV_MCU_EstTrq'\r\n * Outport: '/Debug_HAC_RPM_Decision'\r\n * RelationalOperator: '/Relational Operator'\r\n * RelationalOperator: '/Relational Operator1'\r\n * RelationalOperator: '/Relational Operator2'\r\n * Sum: '/HAC_Flags_Add'\r\n */\r\n /* Check if HAC is ON (HAC_Flag >= 4) */\r\n /* : if HAC_Flag >= 4 */\r\n if ((double)(((ADM_Integrated_Logic_U.GV_BrakeTorqueCommand <= 20.0) +\r\n (rtb_Vx_Cmd_R <= 2.0)) + (rtb_deltafalllimit_m == 3.0)) +\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision >= 4.0) {\r\n /* : if HAC_ON_FLAG == 0 */\r\n if (ADM_Integrated_Logic_DW.HAC_ON_FLAG == 0.0) {\r\n /* : HAC_ON_Timer = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer = 0.0;\r\n\r\n /* Reset timer when HAC turns ON */\r\n }\r\n\r\n /* : HAC_ON_FLAG = 1; */\r\n ADM_Integrated_Logic_DW.HAC_ON_FLAG = 1.0;\r\n\r\n /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */\r\n rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Saturation;\r\n\r\n /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque = ADM_Integrated_Logic_DW.Saturation;\r\n\r\n /* : if HAC_ON_Timer < 3 */\r\n if (ADM_Integrated_Logic_DW.HAC_ON_Timer < 3.0) {\r\n /* Update Desired Torque for the first 3 seconds */\r\n /* : HAC_Desired_Torque = Desired_Torque; */\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque = rtb_Desired_Torque;\r\n\r\n /* : HAC_ON_Timer = HAC_ON_Timer + 1/200; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer += 0.005;\r\n\r\n /* Assuming 200 Hz update rate */\r\n }\r\n\r\n /* Outport: '/Debug_HAC_FLAG' */\r\n /* : HAC_ON_OFF_CHECK = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 1.0;\r\n\r\n /* : else */\r\n /* If HAC has been ON and HAC_Flag drops below 4 */\r\n /* : if HAC_ON_FLAG == 1 */\r\n } else if (ADM_Integrated_Logic_DW.HAC_ON_FLAG == 1.0) {\r\n /* Check if Feedback Torque exceeds Desired Torque */\r\n /* : if Feedback_Torque >= HAC_Desired_Torque */\r\n if (ADM_Integrated_Logic_U.GV_MCU_EstTrq >=\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque) {\r\n /* : HAC_ON_OFF_CHECK = 0; */\r\n /* Apply smoothing logic to reduce torque gradually */\r\n /* : Smoothed_Torque = Smoothed_Torque - 0.05 * Smoothed_Torque; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque -= 0.05 *\r\n ADM_Integrated_Logic_DW.Smoothed_Torque;\r\n\r\n /* Adjust smoothing factor as needed */\r\n /* : if Smoothed_Torque < 0.01 */\r\n if (ADM_Integrated_Logic_DW.Smoothed_Torque < 0.01) {\r\n /* Threshold to consider torque as zero */\r\n /* : Smoothed_Torque = 0; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque = 0.0;\r\n\r\n /* : HAC_ON_FLAG = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_FLAG = 0.0;\r\n\r\n /* Reset HAC_ON_FLAG if fully off */\r\n /* : HAC_Desired_Torque = 0; */\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque = 0.0;\r\n\r\n /* Reset Desired Torque when HAC is OFF */\r\n /* : HAC_ON_Timer = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer = 0.0;\r\n\r\n /* Reset Timer */\r\n }\r\n\r\n /* : Brake_Torque_Cmd = Smoothed_Torque; */\r\n rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Smoothed_Torque;\r\n } else {\r\n /* : else */\r\n /* Keep the brake torque command if torque condition is not met */\r\n /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */\r\n rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Saturation;\r\n\r\n /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque =\r\n ADM_Integrated_Logic_DW.Saturation;\r\n\r\n /* Outport: '/Debug_HAC_FLAG' */\r\n /* : HAC_ON_OFF_CHECK = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 1.0;\r\n }\r\n }\r\n\r\n /* MATLAB Function: '/GearCondition_Brake' */\r\n /* : if data == 1 */\r\n if (rtb_deltafalllimit_m == 1.0) {\r\n /* : output = -1; */\r\n rtb_output_a = -1.0;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : output = 1; */\r\n rtb_output_a = 1.0;\r\n } else {\r\n /* : else */\r\n /* : output = 0; */\r\n rtb_output_a = 0.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/GearCondition_Brake' */\r\n\r\n /* Gain: '/Brake_GAIN' incorporates:\r\n * DiscreteTransferFcn: '/Discrete Transfer Fcn'\r\n */\r\n rtb_Integrator_1 = 0.0625 * ADM_Integrated_Logic_DW.DiscreteTransferFcn_states\r\n * -80.0;\r\n\r\n /* Saturate: '/Saturation' */\r\n if (rtb_Integrator_1 > 1000.0) {\r\n rtb_Integrator_1 = 1000.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* Product: '/Multiply2' incorporates:\r\n * Saturate: '/Saturation'\r\n */\r\n rtb_Integrator_1 *= rtb_output_a;\r\n\r\n /* RateLimiter: '/Brake_Out_RateLimiter' */\r\n rtb_output_a = rtb_Integrator_1 - ADM_Integrated_Logic_DW.PrevY_o;\r\n if (rtb_output_a > 3.0) {\r\n rtb_Integrator_1 = ADM_Integrated_Logic_DW.PrevY_o + 3.0;\r\n } else if (rtb_output_a < -3.0) {\r\n rtb_Integrator_1 = ADM_Integrated_Logic_DW.PrevY_o - 3.0;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY_o = rtb_Integrator_1;\r\n\r\n /* End of RateLimiter: '/Brake_Out_RateLimiter' */\r\n\r\n /* Saturate: '/Brake_Saturation' */\r\n if (rtb_Integrator_1 > 1000.0) {\r\n rtb_Integrator_1 = 1000.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* End of Saturate: '/Brake_Saturation' */\r\n\r\n /* MATLAB Function: '/Emergency_Brake_Func' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n * Sum: '/Add'\r\n */\r\n /* : if Emergency_Flag == 1 */\r\n if (rtb_Compare) {\r\n /* : Emergency_Brake_Output = Vehicle_Speed*100; */\r\n rtb_output_a = ADM_Integrated_Logic_U.GV_Vx_Fbk * 100.0;\r\n } else {\r\n /* : else */\r\n /* : Emergency_Brake_Output = Brake_Torque_Cmd; */\r\n rtb_output_a = rtb_Brake_Torque_Cmd + rtb_Integrator_1;\r\n }\r\n\r\n /* End of MATLAB Function: '/Emergency_Brake_Func' */\r\n\r\n /* Saturate: '/Brake_Saturation' */\r\n if (rtb_output_a > 1500.0) {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = 1500.0;\r\n } else if (rtb_output_a < 0.0) {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = 0.0;\r\n } else {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = rtb_output_a;\r\n }\r\n\r\n /* End of Saturate: '/Brake_Saturation' */\r\n\r\n /* Outport: '/Debug_CC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_CC_Brake_Output = rtb_Integrator_1;\r\n\r\n /* Outport: '/Debug_HAC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Brake_Output = rtb_Brake_Torque_Cmd;\r\n\r\n /* MATLAB Function: '/Gear_pos_out' incorporates:\r\n * MATLAB Function: '/Target_RPM'\r\n */\r\n /* Gear R 단에서 - target rpm 값 */\r\n /* : if data == 0 */\r\n if (rtb_deltafalllimit_m == 0.0) {\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n } else {\r\n if (rtb_deltafalllimit_m == 2.0) {\r\n /* : elseif data == 2 */\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n } else if (rtb_deltafalllimit_m == 1.0) {\r\n /* : elseif data == 1 */\r\n /* : temp_gear = -1; */\r\n rtb_output_p = -1.0;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : temp_gear = 1; */\r\n rtb_output_p = 1.0;\r\n } else {\r\n /* : else */\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n }\r\n\r\n if (rtb_deltafalllimit_m == 2.0) {\r\n /* : elseif data == 2 */\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n } else if (rtb_deltafalllimit_m == 1.0) {\r\n /* : elseif data == 1 */\r\n /* : temp_gear = -1; */\r\n temp_gear = -1;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : temp_gear = 1; */\r\n temp_gear = 1;\r\n } else {\r\n /* : else */\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n }\r\n }\r\n\r\n /* End of MATLAB Function: '/Gear_pos_out' */\r\n\r\n /* MATLAB Function: '/Target_RPM' */\r\n /* : output = temp_gear; */\r\n /* : gear_ratio = 11.93; */\r\n /* : Radius = 0.270781; */\r\n /* : engine_eff = 1; */\r\n /* Gear R 단에서 - target rpm 값 */\r\n /* : if data == 0 */\r\n /* : speed_m_per_s = Vx_Kph * 1000/3600; */\r\n /* : Target_RPM = (speed_m_per_s * gear_ratio * 60) / (Radius*2*pi)*engine_eff*temp_gear; */\r\n rtb_Brake_Torque_Cmd = rtb_Vx_Cmd_R * 1000.0 / 3600.0 * 11.93 * 60.0 /\r\n 1.7013672006633955 * (double)temp_gear;\r\n\r\n /* RateLimiter: '/TargetSpd_RateLimiter' */\r\n rtb_output_a = rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.PrevY_a;\r\n if (rtb_output_a > 0.4) {\r\n rtb_output_a = ADM_Integrated_Logic_DW.PrevY_a + 0.4;\r\n } else if (rtb_output_a < -0.8) {\r\n rtb_output_a = ADM_Integrated_Logic_DW.PrevY_a - 0.8;\r\n } else {\r\n rtb_output_a = rtb_Brake_Torque_Cmd;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY_a = rtb_output_a;\r\n\r\n /* End of RateLimiter: '/TargetSpd_RateLimiter' */\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Brake_Torque_Cmd = ((rtb_output_a + ADM_Integrated_Logic_DW.d1_DSTATE) *\r\n 0.002 + 0.1041032953945969 * ADM_Integrated_Logic_DW.d_DSTATE) /\r\n 0.1081032953945969;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_i2 = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_i) *\r\n 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_p;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_o1 = (rtb_Sum1_i2 - ADM_Integrated_Logic_DW.d_DSTATE_c) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_h;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_lm = (rtb_Sum1_o1 - ADM_Integrated_Logic_DW.d_DSTATE_d) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_l;\r\n\r\n /* Gain: '/Gain' incorporates:\r\n * Constant: '/Constant3'\r\n * Constant: '/Constant4'\r\n * Constant: '/Constant5'\r\n * Product: '/Product'\r\n * Product: '/Product1'\r\n * Product: '/Product2'\r\n * Sum: '/Add5'\r\n */\r\n rtb_Gain_c = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Sum1_i2) + 21.8 *\r\n rtb_Sum1_o1) + rtb_Sum1_lm) * 9.44822373393802E-6;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant1'\r\n * Constant: '/Constant2'\r\n * Delay: '/Delay'\r\n * Delay: '/Delay1'\r\n * Delay: '/Delay2'\r\n * Delay: '/Delay3'\r\n * Gain: '/gain1'\r\n * Gain: '/gain3'\r\n * Product: '/x(n), x(n-1), x(n-2)'\r\n * Product: '/y(n-1)'\r\n * Product: '/y(n-2)'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * Sum: '/Sum5'\r\n * Sum: '/Sum6'\r\n */\r\n rtb_Product1_pd = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE + rtb_Gain_c)\r\n + ADM_Integrated_Logic_DW.Delay_DSTATE[0]) *\r\n 0.39478417604357435 - -7.2104316479128512 *\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE) -\r\n 2.6178993711731877 * ADM_Integrated_Logic_DW.Delay3_DSTATE\r\n [0]) / 6.1716689809139611;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_m = ((rtb_Product1_pd + ADM_Integrated_Logic_DW.d1_DSTATE_e) *\r\n 0.002 + 0.00861032953945969 *\r\n ADM_Integrated_Logic_DW.d_DSTATE_ij) / 0.01261032953945969;\r\n\r\n /* Sum: '/Subtract' incorporates:\r\n * Inport: '/GV_MCU_RPM'\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n rtb_Error_m = rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_U.GV_MCU_RPM;\r\n\r\n /* Saturate: '/Error_Saturation' incorporates:\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n if (rtb_Error_m > 2000.0) {\r\n rtb_Error_m = 2000.0;\r\n } else if (rtb_Error_m < -2000.0) {\r\n rtb_Error_m = -2000.0;\r\n }\r\n\r\n /* End of Saturate: '/Error_Saturation' */\r\n\r\n /* DeadZone: '/Dead Zone' incorporates:\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n if (rtb_Error_m > 50.0) {\r\n rtb_Add_e = rtb_Error_m - 50.0;\r\n } else if (rtb_Error_m >= -50.0) {\r\n rtb_Add_e = 0.0;\r\n } else {\r\n rtb_Add_e = rtb_Error_m - -50.0;\r\n }\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Error_m = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_ir) *\r\n 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_o;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_aj = (rtb_Error_m - ADM_Integrated_Logic_DW.d_DSTATE_m) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_hm;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_p = (rtb_Sum1_aj - ADM_Integrated_Logic_DW.d_DSTATE_mw) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_g;\r\n\r\n /* Sum: '/Add3' incorporates:\r\n * Constant: '/Constant3'\r\n * Constant: '/Constant4'\r\n * Constant: '/Constant5'\r\n * Gain: '/Gain'\r\n * Memory: '/Memory'\r\n * Product: '/Product2'\r\n * Product: '/Product3'\r\n * Product: '/Product4'\r\n * Sum: '/Add2'\r\n */\r\n rtb_Add3 = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Error_m) + 21.8 *\r\n rtb_Sum1_aj) + rtb_Sum1_p) * 9.44822373393802E-6 -\r\n ADM_Integrated_Logic_DW.Memory_PreviousInput;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_e = ((rtb_Add3 + ADM_Integrated_Logic_DW.d1_DSTATE_ej) * 0.002 +\r\n 0.029830988618379066 * ADM_Integrated_Logic_DW.d_DSTATE_j) /\r\n 0.03383098861837907;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant1'\r\n * Constant: '/Constant2'\r\n * Delay: '/Delay'\r\n * Delay: '/Delay1'\r\n * Delay: '/Delay2'\r\n * Delay: '/Delay3'\r\n * Gain: '/gain1'\r\n * Gain: '/gain3'\r\n * Product: '/x(n), x(n-1), x(n-2)'\r\n * Product: '/y(n-1)'\r\n * Product: '/y(n-2)'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * Sum: '/Sum5'\r\n * Sum: '/Sum6'\r\n */\r\n rtb_Product1_iz = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE_c +\r\n rtb_Product1_e) +\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[0]) *\r\n 0.00035530575843921691 - -7.9992893884831213 *\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE_n) -\r\n 3.9470487616123275 *\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[0]) /\r\n 4.0536618499045511;\r\n\r\n /* MATLAB Function: '/DOB_Gain' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n /* : if vx < 5 */\r\n if (ADM_Integrated_Logic_U.GV_Vx_Fbk < 5.0) {\r\n /* : gain = 0; */\r\n rtb_Switch2 = 0.0;\r\n } else {\r\n /* : else */\r\n /* : gain = (vx-5) * 0.2; */\r\n rtb_Switch2 = (ADM_Integrated_Logic_U.GV_Vx_Fbk - 5.0) * 0.2;\r\n }\r\n\r\n /* : if gain >=1 */\r\n if (rtb_Switch2 >= 1.0) {\r\n /* : gain =1; */\r\n rtb_Switch2 = 1.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/DOB_Gain' */\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/DOBFlag'\r\n * Product: '/Product'\r\n */\r\n rtb_Integrator_1 = -(rtb_Product1_iz * 0.9);\r\n\r\n /* Saturate: '/DOB_Saturation' */\r\n if (rtb_Integrator_1 > 30.0) {\r\n rtb_Integrator_1 = 30.0;\r\n } else if (rtb_Integrator_1 < -30.0) {\r\n rtb_Integrator_1 = -30.0;\r\n }\r\n\r\n /* Sum: '/Subtract2' incorporates:\r\n * DeadZone: '/Dead Zone'\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n * Product: '/Product'\r\n * Product: '/Multiply1'\r\n * Saturate: '/DOB_Saturation'\r\n * Sum: '/Add'\r\n */\r\n rtb_Add_e = (rtb_Add_e * 0.044648264844923756 + rtb_Product1_m) +\r\n rtb_Integrator_1 * rtb_Switch2;\r\n\r\n /* Saturate: '/Torq_Saturation' */\r\n if (rtb_Add_e > 80.0) {\r\n rtb_Add_e = 80.0;\r\n } else if (rtb_Add_e < -80.0) {\r\n rtb_Add_e = -80.0;\r\n }\r\n\r\n /* End of Saturate: '/Torq_Saturation' */\r\n\r\n /* MATLAB Function: '/Emergency_Motor_Func' */\r\n /* : if Emergency_Flag == 1 */\r\n if (rtb_Compare) {\r\n /* Outport: '/GV_Motor_Torque_Cmd' */\r\n /* : Emergency_Motor_Output = 0; */\r\n ADM_Integrated_Logic_Y.GV_Motor_Torque_Cmd = 0.0;\r\n } else {\r\n /* Outport: '/GV_Motor_Torque_Cmd' incorporates:\r\n * Product: '/Multiply'\r\n */\r\n /* : else */\r\n /* : Emergency_Motor_Output = Motor_Torque_Cmd; */\r\n ADM_Integrated_Logic_Y.GV_Motor_Torque_Cmd = rtb_output_p * rtb_Add_e;\r\n }\r\n\r\n /* End of MATLAB Function: '/Emergency_Motor_Func' */\r\n\r\n /* Outport: '/GV_Gear_Postion_Out' */\r\n ADM_Integrated_Logic_Y.GV_Gear_Postion_Out = rtb_deltafalllimit_m;\r\n\r\n /* Sum: '/Add2' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n rtb_Vx_Cmd_R -= ADM_Integrated_Logic_U.GV_Vx_Fbk;\r\n\r\n /* Outport: '/GV_Hill_Torque_Assist' */\r\n ADM_Integrated_Logic_Y.GV_Hill_Torque_Assist = rtb_Desired_Torque;\r\n\r\n /* Outport: '/Debug_HAC_Pitch_angle' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Pitch_angle = rtb_Yk1_e;\r\n\r\n /* MATLAB Function: '/Calculate_F_c1' incorporates:\r\n * Gain: '/Gain3'\r\n */\r\n ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_Value_for_Brake,\r\n 0.017453292519943295 * rtb_Yk1_e, &rtb_Switch2);\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AX_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Desired_Torque = ((ADM_Integrated_Logic_U.GV_IMU_AX_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ob) * 0.002 + 0.061661977236758134 *\r\n ADM_Integrated_Logic_DW.d_DSTATE_e) /\r\n 0.065661977236758137;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AY_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_output_p = ((ADM_Integrated_Logic_U.GV_IMU_AY_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_i) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_p) /\r\n 0.065661977236758137;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AZ_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Integrator_1 = ((ADM_Integrated_Logic_U.GV_IMU_AZ_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o1) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_n)\r\n / 0.065661977236758137;\r\n\r\n /* MATLAB Function: '/Pitch_calculate' */\r\n /* This function calculates the pitch angle using accelerometer data. */\r\n /* Inputs: */\r\n /* ax - Acceleration in the x-axis */\r\n /* ay - Acceleration in the y-axis */\r\n /* az - Acceleration in the z-axis */\r\n /* Output: */\r\n /* pitch - Calculated pitch angle in degrees */\r\n /* Step 1: Calculate the denominator (sqrt(ay^2 + az^2)) */\r\n /* : denominator = sqrt(ay^2 + az^2); */\r\n rtb_Switch2 = sqrt(rtb_output_p * rtb_output_p + rtb_Integrator_1 *\r\n rtb_Integrator_1);\r\n\r\n /* Step 2: Compute pitch in radians using arctan(ax / denominator) */\r\n /* Protect against division by zero */\r\n /* : if denominator == 0 */\r\n if (rtb_Switch2 != 0.0) {\r\n /* : else */\r\n /* : pitch = atan(ax / denominator); */\r\n rtb_Switch2 = atan(rtb_Desired_Torque / rtb_Switch2);\r\n\r\n /* Calculate pitch in radians */\r\n } else {\r\n /* : pitch = 0; */\r\n /* If ay and az are both zero, pitch is set to 0 */\r\n }\r\n\r\n /* Sum: '/Sum' incorporates:\r\n * DiscreteIntegrator: '/Integrator_2'\r\n * MATLAB Function: '/Pitch_calculate'\r\n */\r\n /* Step 3: Convert radians to degrees */\r\n /* : pitch = pitch * (180 / pi); */\r\n /* Convert to degrees */\r\n rtb_Sum_f = ADM_Integrated_Logic_DW.Integrator_2_DSTATE - rtb_Switch2 *\r\n 57.295779513082323;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_PitchRtVal'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_f = ((ADM_Integrated_Logic_U.GV_IMU_PitchRtVal +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_a) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_d1) /\r\n 0.065661977236758137;\r\n\r\n /* Sum: '/Add1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/Gain1'\r\n * Inport: '/GV_Vx_Fbk'\r\n * Sum: '/Add3'\r\n */\r\n rtb_Add1_tmp = 400.0 - 6.5 * ADM_Integrated_Logic_U.GV_Vx_Fbk;\r\n\r\n /* MATLAB Function: '/MATLAB Function1' incorporates:\r\n * Sum: '/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_Yk1_p = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c;\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Inport: '/GV_RWA_RackAngleCommand'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_UkYk1_j = ADM_Integrated_Logic_U.GV_RWA_RackAngleCommand - rtb_Yk1_p;\r\n\r\n /* MATLAB Function: '/MATLAB Function2' incorporates:\r\n * Gain: '/Gain3'\r\n * Sum: '/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1_j <= rtb_Switch2) {\r\n /* Product: '/delta fall limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1_j >= rtb_Switch2) {\r\n rtb_Switch2 = rtb_UkYk1_j;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Yk1_p += rtb_Switch2;\r\n\r\n /* Outport: '/GV_Master_Rack_Angle_Cmd' */\r\n ADM_Integrated_Logic_Y.GV_Master_Rack_Angle_Cmd = rtb_Yk1_p;\r\n\r\n /* MATLAB Function: '/MATLAB Function5' */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1_j = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i;\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Inport: '/GV_RWS_RackAngleCommand'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Add1 = ADM_Integrated_Logic_U.GV_RWS_RackAngleCommand - rtb_UkYk1_j;\r\n\r\n /* MATLAB Function: '/MATLAB Function6' incorporates:\r\n * Gain: '/Gain5'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_Add1 <= rtb_Switch2) {\r\n /* Product: '/delta fall limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_Add1 >= rtb_Switch2) {\r\n rtb_Switch2 = rtb_Add1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Switch2 += rtb_UkYk1_j;\r\n\r\n /* Outport: '/GV_RWS_RackAngleCmd1' */\r\n ADM_Integrated_Logic_Y.GV_RWS_RackAngleCmd1 = rtb_Switch2;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE = rtb_UkYk1;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_m = rtb_Yk1_e;\r\n\r\n /* Update for DiscreteIntegrator: '/Integrator_2' incorporates:\r\n * Constant: '/I_gain'\r\n * Constant: '/P_gain'\r\n * DiscreteIntegrator: '/Integrator_1'\r\n * Product: '/Product'\r\n * Product: '/Product1'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n */\r\n ADM_Integrated_Logic_DW.Integrator_2_DSTATE += (rtb_Product1_f -\r\n (ADM_Integrated_Logic_DW.Integrator_1_DSTATE * 5.0 + rtb_Sum_f * 100.0)) *\r\n 0.002;\r\n\r\n /* Update for Delay: '/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_DSTATE = rtb_deltafalllimit_m;\r\n\r\n /* Update for DiscreteTransferFcn: '/Discrete Transfer Fcn' */\r\n ADM_Integrated_Logic_DW.DiscreteTransferFcn_states = rtb_Vx_Cmd_R - -0.9375 *\r\n ADM_Integrated_Logic_DW.DiscreteTransferFcn_states;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE = rtb_output_a;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_i = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_p = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_c = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_h = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_l = rtb_Sum1_lm;\r\n\r\n /* Update for Delay: '/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE = rtb_Gain_c;\r\n\r\n /* Update for Delay: '/Delay' */\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[0] =\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[1];\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[1] = rtb_Gain_c;\r\n\r\n /* Update for Delay: '/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE = rtb_Product1_pd;\r\n\r\n /* Update for Delay: '/Delay3' */\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[0] =\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[1];\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[1] = rtb_Product1_pd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_e = rtb_Product1_pd;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ij = rtb_Product1_m;\r\n\r\n /* Update for Memory: '/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_PreviousInput = rtb_Add_e;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ir = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_m = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_hm = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_mw = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_g = rtb_Sum1_p;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ej = rtb_Add3;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_j = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE_c = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay' */\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[0] =\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[1];\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[1] = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE_n = rtb_Product1_iz;\r\n\r\n /* Update for Delay: '/Delay3' */\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[0] =\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1];\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1] = rtb_Product1_iz;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AX_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ob = ADM_Integrated_Logic_U.GV_IMU_AX_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_e = rtb_Desired_Torque;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AY_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_i = ADM_Integrated_Logic_U.GV_IMU_AY_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_p = rtb_output_p;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AZ_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o1 = ADM_Integrated_Logic_U.GV_IMU_AZ_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_n = rtb_Integrator_1;\r\n\r\n /* Update for DiscreteIntegrator: '/Integrator_1' */\r\n ADM_Integrated_Logic_DW.Integrator_1_DSTATE += 0.002 * rtb_Sum_f;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_PitchRtVal'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_a = ADM_Integrated_Logic_U.GV_IMU_PitchRtVal;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d1 = rtb_Product1_f;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c = rtb_Yk1_p;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i = rtb_Switch2;\r\n if (ADM_Integrated_Logic_M->Timing.TaskCounters.TID[1] == 0) {\r\n /* Update absolute timer for sample time: [1.0s, 0.0s] */\r\n /* The \"clockTick1\" counts the number of times the code of this task has\r\n * been executed. The resolution of this integer timer is 1.0, which is the step size\r\n * of the task. Size of \"clockTick1\" ensures timer will not overflow during the\r\n * application lifespan selected.\r\n */\r\n ADM_Integrated_Logic_M->Timing.clockTick1++;\r\n }\r\n\r\n rate_scheduler();\r\n}\r\n\r\n/* Model initialize function */\r\nvoid ADM_Integrated_Logic_initialize(void)\r\n{\r\n /* : HAC_ON_FLAG = 0; */\r\n /* : Smoothed_Torque = 0; */\r\n /* : HAC_Desired_Torque = 0; */\r\n /* : HAC_ON_Timer = 0; */\r\n}\r\n\r\n/* Model terminate function */\r\nvoid ADM_Integrated_Logic_terminate(void)\r\n{\r\n /* (no terminate code required) */\r\n}\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic.h","type":"header","group":"model","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_h_\r\n#define ADM_Integrated_Logic_h_\r\n#ifndef ADM_Integrated_Logic_COMMON_INCLUDES_\r\n#define ADM_Integrated_Logic_COMMON_INCLUDES_\r\n#include \r\n#include \r\n#include \"complex_types.h\"\r\n#endif /* ADM_Integrated_Logic_COMMON_INCLUDES_ */\r\n\r\n#include \"ADM_Integrated_Logic_types.h\"\r\n\r\n/* Block signals and states (default storage) for system '' */\r\ntypedef struct {\r\n double Delay_DSTATE[2]; /* '/Delay' */\r\n double Delay3_DSTATE[2]; /* '/Delay3' */\r\n double Delay_DSTATE_p[2]; /* '/Delay' */\r\n double Delay3_DSTATE_h[2]; /* '/Delay3' */\r\n double Saturation; /* '/Saturation' */\r\n double DelayInput2_DSTATE; /* '/Delay Input2' */\r\n double DelayInput2_DSTATE_m; /* '/Delay Input2' */\r\n double Integrator_2_DSTATE; /* '/Integrator_2' */\r\n double Memory_DSTATE; /* '/Memory' */\r\n double DiscreteTransferFcn_states; /* '/Discrete Transfer Fcn' */\r\n double d1_DSTATE; /* '/d1' */\r\n double d_DSTATE; /* '/d' */\r\n double d_DSTATE_i; /* '/d' */\r\n double d1_DSTATE_p; /* '/d1' */\r\n double d_DSTATE_c; /* '/d' */\r\n double d1_DSTATE_h; /* '/d1' */\r\n double d_DSTATE_d; /* '/d' */\r\n double d1_DSTATE_l; /* '/d1' */\r\n double Delay1_DSTATE; /* '/Delay1' */\r\n double Delay2_DSTATE; /* '/Delay2' */\r\n double d1_DSTATE_e; /* '/d1' */\r\n double d_DSTATE_ij; /* '/d' */\r\n double d_DSTATE_ir; /* '/d' */\r\n double d1_DSTATE_o; /* '/d1' */\r\n double d_DSTATE_m; /* '/d' */\r\n double d1_DSTATE_hm; /* '/d1' */\r\n double d_DSTATE_mw; /* '/d' */\r\n double d1_DSTATE_g; /* '/d1' */\r\n double d1_DSTATE_ej; /* '/d1' */\r\n double d_DSTATE_j; /* '/d' */\r\n double Delay1_DSTATE_c; /* '/Delay1' */\r\n double Delay2_DSTATE_n; /* '/Delay2' */\r\n double d1_DSTATE_ob; /* '/d1' */\r\n double d_DSTATE_e; /* '/d' */\r\n double d1_DSTATE_i; /* '/d1' */\r\n double d_DSTATE_p; /* '/d' */\r\n double d1_DSTATE_o1; /* '/d1' */\r\n double d_DSTATE_n; /* '/d' */\r\n double Integrator_1_DSTATE; /* '/Integrator_1' */\r\n double d1_DSTATE_a; /* '/d1' */\r\n double d_DSTATE_d1; /* '/d' */\r\n double DelayInput2_DSTATE_c; /* '/Delay Input2' */\r\n double DelayInput2_DSTATE_i; /* '/Delay Input2' */\r\n double PrevY; /* '/Input_Vx_RateLimiter' */\r\n double PrevY_o; /* '/Brake_Out_RateLimiter' */\r\n double PrevY_a; /* '/TargetSpd_RateLimiter' */\r\n double Memory_PreviousInput; /* '/Memory' */\r\n double HAC_ON_FLAG; /* '/HAC_OFF_OK_Func' */\r\n double Smoothed_Torque; /* '/HAC_OFF_OK_Func' */\r\n double HAC_Desired_Torque; /* '/HAC_OFF_OK_Func' */\r\n double HAC_ON_Timer; /* '/HAC_OFF_OK_Func' */\r\n uint8_t is_active_c6_ADM_Integrated_Log;/* '/Chart' */\r\n uint8_t is_c6_ADM_Integrated_Logic; /* '/Chart' */\r\n} DW_ADM_Integrated_Logic_T;\r\n\r\n/* Invariant block signals (default storage) */\r\ntypedef struct {\r\n const double W_value; /* '/Multiply' */\r\n const double W_Value_for_Brake; /* '/Multiply4' */\r\n} ConstB_ADM_Integrated_Logic_T;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\ntypedef struct {\r\n double GV_MCU_RPM; /* '/GV_MCU_RPM' */\r\n double GV_BrakeTorqueCommand; /* '/GV_BrakeTorqueCommand' */\r\n double GV_IMU_AX_Val; /* '/GV_IMU_AX_Val' */\r\n double GV_IMU_AY_Val; /* '/GV_IMU_AY_Val' */\r\n double GV_IMU_AZ_Val; /* '/GV_IMU_AZ_Val' */\r\n double GV_IMU_PitchRtVal; /* '/GV_IMU_PitchRtVal' */\r\n double GV_Vx_Command; /* '/GV_Vx_Command' */\r\n double GV_VCU_GearSelStat; /* '/GV_VCU_GearSelStat' */\r\n double GV_MCU_EstTrq; /* '/GV_MCU_EstTrq' */\r\n double GV_Vx_Limit; /* '/GV_Vx_Limit' */\r\n double GV_Vx_Fbk; /* '/GV_Vx_Fbk' */\r\n double GV_RWA_RackAngleCommand; /* '/GV_RWA_RackAngleCommand' */\r\n double GV_RWS_RackAngleCommand; /* '/GV_RWS_RackAngleCommand' */\r\n double GV_RWA_Fault_Flag; /* '/GV_RWA_Fault_Flag' */\r\n double GV_Operation_Mode; /* '/GV_Operation_Mode' */\r\n} ExtU_ADM_Integrated_Logic_T;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\ntypedef struct {\r\n double GV_Brake_Command; /* '/GV_Brake_Command' */\r\n double GV_Master_Rack_Angle_Cmd; /* '/GV_Master_Rack_Angle_Cmd' */\r\n double GV_Hill_Torque_Assist; /* '/GV_Hill_Torque_Assist' */\r\n double GV_Motor_Torque_Cmd; /* '/GV_Motor_Torque_Cmd' */\r\n double Debug_HAC_FLAG; /* '/Debug_HAC_FLAG' */\r\n double Debug_HAC_RPM_Decision; /* '/Debug_HAC_RPM_Decision' */\r\n double Debug_HAC_Pitch_angle; /* '/Debug_HAC_Pitch_angle' */\r\n double Debug_HAC_Brake_Output; /* '/Debug_HAC_Brake_Output' */\r\n double Debug_CC_Brake_Output; /* '/Debug_CC_Brake_Output' */\r\n double GV_RWS_RackAngleCmd1; /* '/GV_RWS_RackAngleCmd1' */\r\n double GV_Speed_Limit; /* '/GV_Speed_Limit' */\r\n double GV_Gear_Postion_Out; /* '/GV_Gear_Postion_Out' */\r\n} ExtY_ADM_Integrated_Logic_T;\r\n\r\n/* Real-time Model Data Structure */\r\nstruct tag_RTM_ADM_Integrated_Logic_T {\r\n /*\r\n * Timing:\r\n * The following substructure contains information regarding\r\n * the timing information for the model.\r\n */\r\n struct {\r\n uint32_t clockTick1;\r\n struct {\r\n uint16_t TID[2];\r\n } TaskCounters;\r\n } Timing;\r\n};\r\n\r\n/* Block signals and states (default storage) */\r\nextern DW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\nextern ExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\nextern ExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y;\r\nextern const ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB;/* constant block i/o */\r\n\r\n/* Model entry point functions */\r\nextern void ADM_Integrated_Logic_initialize(void);\r\nextern void ADM_Integrated_Logic_step(void);\r\nextern void ADM_Integrated_Logic_terminate(void);\r\n\r\n/* Real-time Model object */\r\nextern RT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M;\r\n\r\n/*-\r\n * These blocks were eliminated from the model due to optimizations:\r\n *\r\n * Block '/BW_PI' : Unused code path elimination\r\n * Block '/Constant1' : Unused code path elimination\r\n * Block '/Constant16' : Unused code path elimination\r\n * Block '/Constant17' : Unused code path elimination\r\n * Block '/Constant2' : Unused code path elimination\r\n * Block '/Data Type Conversion2' : Unused code path elimination\r\n * Block '/Gain2' : Unused code path elimination\r\n * Block '/Abs' : Unused code path elimination\r\n * Block '/Brake_Saturation' : Unused code path elimination\r\n * Block '/Multiply5' : Unused code path elimination\r\n * Block '/Radius1' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/Scope2' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/ControlFlag' : Eliminated nontunable gain of 1\r\n * Block '/FBGain' : Eliminated nontunable gain of 1\r\n * Block '/FFGain' : Eliminated nontunable gain of 1\r\n * Block '/Data Type Conversion1' : Eliminate redundant data type conversion\r\n * Block '/Data Type Conversion3' : Eliminate redundant data type conversion\r\n * Block '/HAC_Gain' : Eliminated nontunable gain of 1\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n */\r\n\r\n/*-\r\n * The generated code includes comments that allow you to trace directly\r\n * back to the appropriate location in the model. The basic format\r\n * is /block_name, where system is the system number (uniquely\r\n * assigned by Simulink) and block_name is the name of the block.\r\n *\r\n * Use the MATLAB hilite_system command to trace the generated code back\r\n * to the model. For example,\r\n *\r\n * hilite_system('') - opens system 3\r\n * hilite_system('/Kp') - opens and selects block Kp which resides in S3\r\n *\r\n * Here is the system hierarchy for this model\r\n *\r\n * '' : 'ADM_Integrated_Logic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Brake_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Ramp'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_R'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Vx_OutPut_Function'\r\n */\r\n\r\n/*-\r\n * Requirements for '': ADM_Integrated_Logic\r\n\r\n */\r\n#endif /* ADM_Integrated_Logic_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_private.h","type":"header","group":"model","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_private.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_private_h_\r\n#define ADM_Integrated_Logic_private_h_\r\n#include \r\n#include \r\n#include \"complex_types.h\"\r\n#include \"ADM_Integrated_Logic_types.h\"\r\n#include \"ADM_Integrated_Logic.h\"\r\n\r\nextern void ADM_Integrated_Lo_Calculate_F_c(double rtu_W, double rtu_theta,\r\n double *rty_F_c);\r\nextern void ADM_Integrated__MATLABFunction1(double rtu_u, double *rty_y);\r\nextern void ADM_Integrated__MATLABFunction2(double rtu_u, double *rty_y);\r\n\r\n#endif /* ADM_Integrated_Logic_private_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_types.h","type":"header","group":"model","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_types.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_types_h_\r\n#define ADM_Integrated_Logic_types_h_\r\n\r\n/* Forward declaration for rtModel */\r\ntypedef struct tag_RTM_ADM_Integrated_Logic_T RT_MODEL_ADM_Integrated_Logic_T;\r\n\r\n#endif /* ADM_Integrated_Logic_types_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_data.c","type":"source","group":"data","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Data files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_data.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \"ADM_Integrated_Logic.h\"\r\n\r\n/* Invariant block signals (default storage) */\r\nconst ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB = {\r\n 12753.0, /* '/Multiply' */\r\n 12753.0 /* '/Multiply4' */\r\n};\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"complex_types.h","type":"header","group":"utility","path":"C:\\Users\\MSI\\SynologyDrive\\3min_be\\한자연\\!과제\\배송모빌리티\\!진행상황\\2025\\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Utility files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: complex_types.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.55\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed May 7 21:12:17 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef COMPLEX_TYPES_H\r\n#define COMPLEX_TYPES_H\r\n#include \r\n\r\n/*===========================================================================*\r\n * Complex number type definitions *\r\n *===========================================================================*/\r\n#define CREAL_T\r\n\r\ntypedef struct {\r\n float re;\r\n float im;\r\n} creal32_T;\r\n\r\ntypedef struct {\r\n double re;\r\n double im;\r\n} creal_T;\r\n\r\ntypedef creal_T creal64_T;\r\n\r\n#define CINT8_T\r\n\r\ntypedef struct {\r\n int8_t re;\r\n int8_t im;\r\n} cint8_T;\r\n\r\n#define CUINT8_T\r\n\r\ntypedef struct {\r\n uint8_t re;\r\n uint8_t im;\r\n} cuint8_T;\r\n\r\n#define CINT16_T\r\n\r\ntypedef struct {\r\n int16_t re;\r\n int16_t im;\r\n} cint16_T;\r\n\r\n#define CUINT16_T\r\n\r\ntypedef struct {\r\n uint16_t re;\r\n uint16_t im;\r\n} cuint16_T;\r\n\r\n#define CINT32_T\r\n\r\ntypedef struct {\r\n int32_t re;\r\n int32_t im;\r\n} cint32_T;\r\n\r\n#define CUINT32_T\r\n\r\ntypedef struct {\r\n uint32_t re;\r\n uint32_t im;\r\n} cuint32_T;\r\n\r\n#define CINT64_T\r\n\r\ntypedef struct {\r\n int64_t re;\r\n int64_t im;\r\n} cint64_T;\r\n\r\n#define CUINT64_T\r\n\r\ntypedef struct {\r\n uint64_t re;\r\n uint64_t im;\r\n} cuint64_T;\r\n\r\n#endif /* COMPLEX_TYPES_H */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"}],"coverage":[{"id":"SimulinkCoverage","name":"Simulink Coverage","files":[]},{"id":"Bullseye","name":"Bullseye Coverage","files":[]},{"id":"LDRA","name":"LDRA Testbed","files":[]}],"features":{"annotation":false,"coverage":true,"profiling":true,"tooltip":true,"coverageTooltip":true,"showJustificationLinks":true,"useMWTable":false,"showProfilingInfo":true,"showTaskSummary":true,"showProtectedV2Report":true}}; \ No newline at end of file +var dataJson = {"arch":{"ispc":true,"isunix":false,"ismac":false},"build":"ADM_Integrated_Logic","ref":false,"files":[{"name":"ert_main.c","type":"source","group":"main","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Main file","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ert_main.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \r\n#include /* This example main program uses printf/fflush */\r\n#include \"ADM_Integrated_Logic.h\" /* Model header file */\r\n\r\n/*\r\n * Associating rt_OneStep with a real-time clock or interrupt service routine\r\n * is what makes the generated code \"real-time\". The function rt_OneStep is\r\n * always associated with the base rate of the model. Subrates are managed\r\n * by the base rate from inside the generated code. Enabling/disabling\r\n * interrupts and floating point context switches are target specific. This\r\n * example code indicates where these should take place relative to executing\r\n * the generated code step function. Overrun behavior should be tailored to\r\n * your application needs. This example simply sets an error status in the\r\n * real-time model and returns from rt_OneStep.\r\n */\r\nvoid rt_OneStep(void);\r\nvoid rt_OneStep(void)\r\n{\r\n static bool OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n\r\n /* Check for overrun */\r\n if (OverrunFlag) {\r\n return;\r\n }\r\n\r\n OverrunFlag = true;\r\n\r\n /* Save FPU context here (if necessary) */\r\n /* Re-enable timer or interrupt here */\r\n /* Set model inputs here */\r\n\r\n /* Step the model */\r\n ADM_Integrated_Logic_step();\r\n\r\n /* Get model outputs here */\r\n\r\n /* Indicate task complete */\r\n OverrunFlag = false;\r\n\r\n /* Disable interrupts here */\r\n /* Restore FPU context here (if necessary) */\r\n /* Enable interrupts here */\r\n}\r\n\r\n/*\r\n * The example main function illustrates what is required by your\r\n * application code to initialize, execute, and terminate the generated code.\r\n * Attaching rt_OneStep to a real-time clock is target specific. This example\r\n * illustrates how you do this relative to initializing the model.\r\n */\r\nint main(int argc, const char *argv[])\r\n{\r\n /* Unused arguments */\r\n (void)(argc);\r\n (void)(argv);\r\n\r\n /* Initialize model */\r\n ADM_Integrated_Logic_initialize();\r\n\r\n /* Attach rt_OneStep to a timer or interrupt service routine with\r\n * period 0.002 seconds (base rate of the model) here.\r\n * The call syntax for rt_OneStep is\r\n *\r\n * rt_OneStep();\r\n */\r\n printf(\"Warning: The simulation will run forever. \"\r\n \"Generated ERT main won't simulate model step behavior. \"\r\n \"To change this behavior select the 'MAT-file logging' option.\\n\");\r\n fflush((NULL));\r\n while (1) {\r\n /* Perform application tasks here */\r\n }\r\n\r\n /* The option 'Remove error status field in real-time model data structure'\r\n * is selected, therefore the following code does not need to execute.\r\n */\r\n\r\n /* Terminate model */\r\n ADM_Integrated_Logic_terminate();\r\n return 0;\r\n}\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic.c","type":"source","group":"model","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \"ADM_Integrated_Logic.h\"\r\n#include \r\n#include \"ADM_Integrated_Logic_private.h\"\r\n#include \r\n#include \r\n\r\n/* Named constants for Chart: '/Chart' */\r\n#define ADM_Integrated_Logic_IN_HAC_OFF ((uint8_t)1U)\r\n#define ADM_Integrated_Logic_IN_HAC_ON ((uint8_t)2U)\r\n\r\n/* Block signals and states (default storage) */\r\nDW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\nExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\nExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y;\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/Calculate_F_c'\r\n * '/Calculate_F_c1'\r\n */\r\nvoid ADM_Integrated_Lo_Calculate_F_c(double rtu_W, double rtu_theta, double\r\n *rty_F_c)\r\n{\r\n /* : F_c= W*sin(theta); */\r\n *rty_F_c = rtu_W * sin(rtu_theta);\r\n}\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/MATLAB Function1'\r\n * '/MATLAB Function5'\r\n */\r\nvoid ADM_Integrated__MATLABFunction1(double rtu_u, double *rty_y)\r\n{\r\n *rty_y = rtu_u;\r\n\r\n /* : if u < 140 */\r\n if (rtu_u < 140.0) {\r\n /* : u = 140; */\r\n *rty_y = 140.0;\r\n }\r\n\r\n /* : y = u; */\r\n}\r\n\r\n/*\r\n * Output and update for atomic system:\r\n * '/MATLAB Function2'\r\n * '/MATLAB Function6'\r\n */\r\nvoid ADM_Integrated__MATLABFunction2(double rtu_u, double *rty_y)\r\n{\r\n *rty_y = rtu_u;\r\n\r\n /* : if u > -140 */\r\n if (rtu_u > -140.0) {\r\n /* : u = -140; */\r\n *rty_y = -140.0;\r\n }\r\n\r\n /* : y = u; */\r\n}\r\n\r\n/* Model step function */\r\nvoid ADM_Integrated_Logic_step(void)\r\n{\r\n double rtb_Add1;\r\n double rtb_Add1_tmp;\r\n double rtb_Add3;\r\n double rtb_Add_e;\r\n double rtb_Brake_Torque_Cmd;\r\n double rtb_Desired_Torque;\r\n double rtb_Error_m;\r\n double rtb_Gain_c;\r\n double rtb_Integrator_1;\r\n double rtb_Product1_e;\r\n double rtb_Product1_f;\r\n double rtb_Product1_iz;\r\n double rtb_Product1_m;\r\n double rtb_Product1_pd;\r\n double rtb_Sum;\r\n double rtb_Sum1_aj;\r\n double rtb_Sum1_i2;\r\n double rtb_Sum1_lm;\r\n double rtb_Sum1_o1;\r\n double rtb_Sum1_p;\r\n double rtb_Switch2;\r\n double rtb_UkYk1;\r\n double rtb_UkYk1_j;\r\n double rtb_Vx_Cmd_R;\r\n double rtb_Yk1_e;\r\n double rtb_Yk1_p;\r\n double rtb_deltafalllimit_m;\r\n double rtb_output_a;\r\n double rtb_output_p;\r\n double rtb_y_l;\r\n int32_t temp_gear;\r\n bool rtb_Compare;\r\n bool rtb_Compare_d;\r\n\r\n /* RelationalOperator: '/Compare' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_Operation_Mode'\r\n */\r\n rtb_Compare = (ADM_Integrated_Logic_U.GV_Operation_Mode == 2.0);\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * Constant: '/Upper_Torq'\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n /* : if Emergency_Flag == 1 */\r\n rtb_Switch2 = 0.016;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_Yk1_e = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_m;\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Integrator_1 = 0.002;\r\n\r\n /* Saturate: '/Pitch_Saturation' incorporates:\r\n * DiscreteIntegrator: '/Integrator_2'\r\n */\r\n if (ADM_Integrated_Logic_DW.Integrator_2_DSTATE > 10.0) {\r\n rtb_Add_e = 10.0;\r\n } else if (ADM_Integrated_Logic_DW.Integrator_2_DSTATE < -10.0) {\r\n rtb_Add_e = -10.0;\r\n } else {\r\n rtb_Add_e = ADM_Integrated_Logic_DW.Integrator_2_DSTATE;\r\n }\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Saturate: '/Pitch_Saturation'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_UkYk1 = rtb_Add_e - rtb_Yk1_e;\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.002) {\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1 < -0.002) {\r\n rtb_Integrator_1 = -0.002;\r\n } else {\r\n rtb_Integrator_1 = rtb_UkYk1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Yk1_e += rtb_Integrator_1;\r\n\r\n /* MATLAB Function: '/Calculate_F_c' incorporates:\r\n * Gain: '/Gain'\r\n */\r\n ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_value,\r\n 0.017453292519943295 * rtb_Yk1_e, &rtb_UkYk1);\r\n\r\n /* Gain: '/Gain2' incorporates:\r\n * Constant: '/Radius'\r\n * Product: '/Multiply3'\r\n * Sum: '/Required_Brake_Cal'\r\n */\r\n /* : F_R= C_r*W*cos(theta); */\r\n rtb_Integrator_1 = rtb_UkYk1 * 0.292 * 0.083822296730930432;\r\n\r\n /* Saturate: '/Saturation' */\r\n if (rtb_Integrator_1 > 60.0) {\r\n rtb_Integrator_1 = 60.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Saturate: '/Saturation'\r\n * UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1 = rtb_Integrator_1 - ADM_Integrated_Logic_DW.DelayInput2_DSTATE;\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.016) {\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1 < -0.16) {\r\n rtb_Switch2 = -0.16;\r\n } else {\r\n rtb_Switch2 = rtb_UkYk1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2' incorporates:\r\n * UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1 = rtb_Switch2 + ADM_Integrated_Logic_DW.DelayInput2_DSTATE;\r\n\r\n /* Gain: '/Grade_GAIN' */\r\n rtb_Desired_Torque = 0.8 * rtb_UkYk1;\r\n\r\n /* MATLAB Function: '/Vx_OutPut_Function' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n * Inport: '/GV_Vx_Command'\r\n * Inport: '/GV_Vx_Limit'\r\n * RelationalOperator: '/Compare'\r\n */\r\n /* : if Brake_Input == 0 */\r\n if (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand < 50.0) {\r\n /* : if Vx_Limit <= Vx_Kph */\r\n if (ADM_Integrated_Logic_U.GV_Vx_Limit <=\r\n ADM_Integrated_Logic_U.GV_Vx_Command) {\r\n /* : Vx_Output = Vx_Limit; */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_U.GV_Vx_Limit;\r\n } else {\r\n /* : else */\r\n /* : Vx_Output = Vx_Kph; */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_U.GV_Vx_Command;\r\n }\r\n } else {\r\n /* : else */\r\n /* : Vx_Output = 0; */\r\n rtb_deltafalllimit_m = 0.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/Vx_OutPut_Function' */\r\n\r\n /* RateLimiter: '/Input_Vx_RateLimiter' */\r\n rtb_output_a = rtb_deltafalllimit_m - ADM_Integrated_Logic_DW.PrevY;\r\n if (rtb_output_a > 0.004) {\r\n rtb_Vx_Cmd_R = ADM_Integrated_Logic_DW.PrevY + 0.004;\r\n } else if (rtb_output_a < -0.008) {\r\n rtb_Vx_Cmd_R = ADM_Integrated_Logic_DW.PrevY - 0.008;\r\n } else {\r\n rtb_Vx_Cmd_R = rtb_deltafalllimit_m;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY = rtb_Vx_Cmd_R;\r\n\r\n /* End of RateLimiter: '/Input_Vx_RateLimiter' */\r\n\r\n /* RelationalOperator: '/Compare' incorporates:\r\n * Constant: '/Constant'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n */\r\n rtb_Compare_d = (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand >= 100.0);\r\n\r\n /* Delay: '/Memory' */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_DW.Memory_DSTATE;\r\n\r\n /* MATLAB Function: '/Gear_FUNCTION1' incorporates:\r\n * Inport: '/GV_VCU_GearSelStat'\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n /* : SAFE_SPEED_THRESHOLD = 0; */\r\n /* 안전 기어 변경 속도(kph) */\r\n /* 기본값: 현재 기어 유지 */\r\n /* : output = Current_Gear; */\r\n /* 1. P단 요청이 있을 경우: 모든 상태에서 우선 처리 */\r\n /* : if Gear_Cmd == 0 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 0.0) {\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD && Brake_Torque_Cmd == 1 */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) && rtb_Compare_d) {\r\n /* : output = 0; */\r\n rtb_deltafalllimit_m = 0.0;\r\n\r\n /* P단 진입 허용 */\r\n } else {\r\n /* : else */\r\n /* : output = Current_Gear; */\r\n /* 조건 불충족 시 유지 */\r\n }\r\n } else {\r\n /* 2. 현재 기어 상태에 따라 처리 */\r\n /* : switch Current_Gear */\r\n switch ((int32_t)rtb_deltafalllimit_m) {\r\n case 0:\r\n /* : case 0 */\r\n /* P 상태 */\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) &&\r\n ((ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 1.0) ||\r\n (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 3.0) ||\r\n (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0))) {\r\n /* : if Gear_Cmd == 1 || Gear_Cmd == 3 || Gear_Cmd == 2 */\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* P -> N (모든 경우 N을 거쳐야 하므로) */\r\n }\r\n break;\r\n\r\n case 1:\r\n /* : case 1 */\r\n /* R 상태 */\r\n /* : if Gear_Cmd == 2 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0) {\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* R -> N 허용 */\r\n }\r\n break;\r\n\r\n case 2:\r\n /* : case 2 */\r\n /* N 상태 */\r\n /* : if Vehicle_Speed <= SAFE_SPEED_THRESHOLD && Brake_Torque_Cmd == 1 */\r\n if ((ADM_Integrated_Logic_U.GV_Vx_Fbk <= 0.0) && rtb_Compare_d) {\r\n /* : if Gear_Cmd == 1 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 1.0) {\r\n /* : output = 1; */\r\n rtb_deltafalllimit_m = 1.0;\r\n\r\n /* N -> R */\r\n } else if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 3.0) {\r\n /* : elseif Gear_Cmd == 3 */\r\n /* : output = 3; */\r\n rtb_deltafalllimit_m = 3.0;\r\n\r\n /* N -> D */\r\n }\r\n }\r\n break;\r\n\r\n case 3:\r\n /* : case 3 */\r\n /* D 상태 */\r\n /* : if Gear_Cmd == 2 */\r\n if (ADM_Integrated_Logic_U.GV_VCU_GearSelStat == 2.0) {\r\n /* : output = 2; */\r\n rtb_deltafalllimit_m = 2.0;\r\n\r\n /* D -> N 허용 */\r\n }\r\n break;\r\n }\r\n }\r\n\r\n /* End of MATLAB Function: '/Gear_FUNCTION1' */\r\n\r\n /* Chart: '/Chart' incorporates:\r\n * Constant: '/Constant'\r\n * Constant: '/Constant1'\r\n * Inport: '/GV_MCU_RPM'\r\n */\r\n if (ADM_Integrated_Logic_DW.is_active_c6_ADM_Integrated_Log == 0U) {\r\n ADM_Integrated_Logic_DW.is_active_c6_ADM_Integrated_Log = 1U;\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_OFF;\r\n\r\n /* State HAC OFF */\r\n } else if (ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic ==\r\n ADM_Integrated_Logic_IN_HAC_OFF) {\r\n /* : sf_internal_predicateOutput = RPM_Input < rpm_threshold_low; */\r\n if (ADM_Integrated_Logic_U.GV_MCU_RPM < -50.0) {\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_ON;\r\n\r\n /* State HAC ON */\r\n } else {\r\n /* Outport: '/Debug_HAC_RPM_Decision' */\r\n /* : HAC_Output = 0; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision = 0.0;\r\n }\r\n\r\n /* case IN_HAC_ON: */\r\n /* : sf_internal_predicateOutput = RPM_Input > rpm_threshold_high; */\r\n } else if (ADM_Integrated_Logic_U.GV_MCU_RPM > 150.0) {\r\n ADM_Integrated_Logic_DW.is_c6_ADM_Integrated_Logic =\r\n ADM_Integrated_Logic_IN_HAC_OFF;\r\n\r\n /* State HAC OFF */\r\n } else {\r\n /* Outport: '/Debug_HAC_RPM_Decision' */\r\n /* : HAC_Output = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision = 1.0;\r\n }\r\n\r\n /* End of Chart: '/Chart' */\r\n\r\n /* MATLAB Function: '/HAC_OFF_OK_Func' */\r\n /* Input Parameters: */\r\n /* Desired_Brake_Torque_Cmd: Commanded brake torque when HAC is ON */\r\n /* Desired_Torque: Required torque at the slope */\r\n /* Feedback_Torque: Torque output from the motor */\r\n /* HAC_Flag: Current HAC state flag */\r\n /* Output Parameters: */\r\n /* Brake_Torque_Cmd: Actual brake torque command */\r\n /* HAC_ON_OFF_CHECK: Status of HAC (ON or OFF) */\r\n /* Persistent variable to track if HAC has ever been ON */\r\n /* Initialize HAC_ON_FLAG if it is empty */\r\n /* : if isempty(HAC_ON_FLAG) */\r\n /* Persistent variable for torque smoothing logic */\r\n /* : if isempty(Smoothed_Torque) */\r\n /* Persistent variable to store HAC ON Desired Torque */\r\n /* : if isempty(HAC_Desired_Torque) */\r\n /* Persistent variable to track HAC ON time */\r\n /* : if isempty(HAC_ON_Timer) */\r\n /* Initialize outputs */\r\n /* : Brake_Torque_Cmd = 0; */\r\n rtb_Brake_Torque_Cmd = 0.0;\r\n\r\n /* Outport: '/Debug_HAC_FLAG' incorporates:\r\n * MATLAB Function: '/HAC_OFF_OK_Func'\r\n */\r\n /* : HAC_ON_OFF_CHECK = 0; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 0.0;\r\n\r\n /* MATLAB Function: '/HAC_OFF_OK_Func' incorporates:\r\n * Constant: '/Accel_Cmd '\r\n * Constant: '/Brake_Cmd'\r\n * Constant: '/Gear_D'\r\n * Inport: '/GV_BrakeTorqueCommand'\r\n * Inport: '/GV_MCU_EstTrq'\r\n * Outport: '/Debug_HAC_RPM_Decision'\r\n * RelationalOperator: '/Relational Operator'\r\n * RelationalOperator: '/Relational Operator1'\r\n * RelationalOperator: '/Relational Operator2'\r\n * Sum: '/HAC_Flags_Add'\r\n */\r\n /* Check if HAC is ON (HAC_Flag >= 4) */\r\n /* : if HAC_Flag >= 4 */\r\n if ((double)(((ADM_Integrated_Logic_U.GV_BrakeTorqueCommand <= 20.0) +\r\n (rtb_Vx_Cmd_R <= 2.0)) + (rtb_deltafalllimit_m == 3.0)) +\r\n ADM_Integrated_Logic_Y.Debug_HAC_RPM_Decision >= 4.0) {\r\n /* : if HAC_ON_FLAG == 0 */\r\n if (ADM_Integrated_Logic_DW.HAC_ON_FLAG == 0.0) {\r\n /* : HAC_ON_Timer = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer = 0.0;\r\n\r\n /* Reset timer when HAC turns ON */\r\n }\r\n\r\n /* : HAC_ON_FLAG = 1; */\r\n ADM_Integrated_Logic_DW.HAC_ON_FLAG = 1.0;\r\n\r\n /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */\r\n rtb_Brake_Torque_Cmd = 1000.0;\r\n\r\n /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque = 1000.0;\r\n\r\n /* : if HAC_ON_Timer < 3 */\r\n if (ADM_Integrated_Logic_DW.HAC_ON_Timer < 3.0) {\r\n /* Update Desired Torque for the first 3 seconds */\r\n /* : HAC_Desired_Torque = Desired_Torque; */\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque = rtb_Desired_Torque;\r\n\r\n /* : HAC_ON_Timer = HAC_ON_Timer + 1/200; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer += 0.005;\r\n\r\n /* Assuming 200 Hz update rate */\r\n }\r\n\r\n /* Outport: '/Debug_HAC_FLAG' */\r\n /* : HAC_ON_OFF_CHECK = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 1.0;\r\n\r\n /* : else */\r\n /* If HAC has been ON and HAC_Flag drops below 4 */\r\n /* : if HAC_ON_FLAG == 1 */\r\n } else if (ADM_Integrated_Logic_DW.HAC_ON_FLAG == 1.0) {\r\n /* Check if Feedback Torque exceeds Desired Torque */\r\n /* : if Feedback_Torque >= HAC_Desired_Torque */\r\n if (ADM_Integrated_Logic_U.GV_MCU_EstTrq >=\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque) {\r\n /* : HAC_ON_OFF_CHECK = 0; */\r\n /* Apply smoothing logic to reduce torque gradually */\r\n /* : Smoothed_Torque = Smoothed_Torque - 0.05 * Smoothed_Torque; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque -= 0.05 *\r\n ADM_Integrated_Logic_DW.Smoothed_Torque;\r\n\r\n /* Adjust smoothing factor as needed */\r\n /* : if Smoothed_Torque < 0.01 */\r\n if (ADM_Integrated_Logic_DW.Smoothed_Torque < 0.01) {\r\n /* Threshold to consider torque as zero */\r\n /* : Smoothed_Torque = 0; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque = 0.0;\r\n\r\n /* : HAC_ON_FLAG = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_FLAG = 0.0;\r\n\r\n /* Reset HAC_ON_FLAG if fully off */\r\n /* : HAC_Desired_Torque = 0; */\r\n ADM_Integrated_Logic_DW.HAC_Desired_Torque = 0.0;\r\n\r\n /* Reset Desired Torque when HAC is OFF */\r\n /* : HAC_ON_Timer = 0; */\r\n ADM_Integrated_Logic_DW.HAC_ON_Timer = 0.0;\r\n\r\n /* Reset Timer */\r\n }\r\n\r\n /* : Brake_Torque_Cmd = Smoothed_Torque; */\r\n rtb_Brake_Torque_Cmd = ADM_Integrated_Logic_DW.Smoothed_Torque;\r\n } else {\r\n /* : else */\r\n /* Keep the brake torque command if torque condition is not met */\r\n /* : Brake_Torque_Cmd = Desired_Brake_Torque_Cmd; */\r\n rtb_Brake_Torque_Cmd = 1000.0;\r\n\r\n /* : Smoothed_Torque = Desired_Brake_Torque_Cmd; */\r\n ADM_Integrated_Logic_DW.Smoothed_Torque = 1000.0;\r\n\r\n /* Outport: '/Debug_HAC_FLAG' */\r\n /* : HAC_ON_OFF_CHECK = 1; */\r\n ADM_Integrated_Logic_Y.Debug_HAC_FLAG = 1.0;\r\n }\r\n }\r\n\r\n /* MATLAB Function: '/GearCondition_Brake' */\r\n /* : if data == 1 */\r\n if (rtb_deltafalllimit_m == 1.0) {\r\n /* : output = -1; */\r\n rtb_output_a = -1.0;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : output = 1; */\r\n rtb_output_a = 1.0;\r\n } else {\r\n /* : else */\r\n /* : output = 0; */\r\n rtb_output_a = 0.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/GearCondition_Brake' */\r\n\r\n /* Gain: '/Brake_GAIN' incorporates:\r\n * DiscreteTransferFcn: '/Discrete Transfer Fcn'\r\n */\r\n rtb_Integrator_1 = 0.0625 * ADM_Integrated_Logic_DW.DiscreteTransferFcn_states\r\n * -80.0;\r\n\r\n /* Saturate: '/Saturation' */\r\n if (rtb_Integrator_1 > 1000.0) {\r\n rtb_Integrator_1 = 1000.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* Product: '/Multiply2' incorporates:\r\n * Saturate: '/Saturation'\r\n */\r\n rtb_Integrator_1 *= rtb_output_a;\r\n\r\n /* RateLimiter: '/Brake_Out_RateLimiter' */\r\n rtb_output_a = rtb_Integrator_1 - ADM_Integrated_Logic_DW.PrevY_o;\r\n if (rtb_output_a > 3.0) {\r\n rtb_Integrator_1 = ADM_Integrated_Logic_DW.PrevY_o + 3.0;\r\n } else if (rtb_output_a < -3.0) {\r\n rtb_Integrator_1 = ADM_Integrated_Logic_DW.PrevY_o - 3.0;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY_o = rtb_Integrator_1;\r\n\r\n /* End of RateLimiter: '/Brake_Out_RateLimiter' */\r\n\r\n /* Saturate: '/Brake_Saturation' */\r\n if (rtb_Integrator_1 > 1000.0) {\r\n rtb_Integrator_1 = 1000.0;\r\n } else if (rtb_Integrator_1 < 0.0) {\r\n rtb_Integrator_1 = 0.0;\r\n }\r\n\r\n /* End of Saturate: '/Brake_Saturation' */\r\n\r\n /* MATLAB Function: '/Emergency_Brake_Func' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n * Sum: '/Add'\r\n */\r\n /* : if Emergency_Flag == 1 */\r\n if (rtb_Compare) {\r\n /* : Emergency_Brake_Output = Vehicle_Speed*100; */\r\n rtb_output_a = ADM_Integrated_Logic_U.GV_Vx_Fbk * 100.0;\r\n } else {\r\n /* : else */\r\n /* : Emergency_Brake_Output = Brake_Torque_Cmd; */\r\n rtb_output_a = rtb_Brake_Torque_Cmd + rtb_Integrator_1;\r\n }\r\n\r\n /* End of MATLAB Function: '/Emergency_Brake_Func' */\r\n\r\n /* Saturate: '/Brake_Saturation' */\r\n if (rtb_output_a > 1500.0) {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = 1500.0;\r\n } else if (rtb_output_a < 0.0) {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = 0.0;\r\n } else {\r\n /* Outport: '/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = rtb_output_a;\r\n }\r\n\r\n /* End of Saturate: '/Brake_Saturation' */\r\n\r\n /* Outport: '/Debug_CC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_CC_Brake_Output = rtb_Integrator_1;\r\n\r\n /* Outport: '/Debug_HAC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Brake_Output = rtb_Brake_Torque_Cmd;\r\n\r\n /* MATLAB Function: '/Gear_pos_out' incorporates:\r\n * MATLAB Function: '/Target_RPM'\r\n */\r\n /* Gear R 단에서 - target rpm 값 */\r\n /* : if data == 0 */\r\n if (rtb_deltafalllimit_m == 0.0) {\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n } else {\r\n if (rtb_deltafalllimit_m == 2.0) {\r\n /* : elseif data == 2 */\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n } else if (rtb_deltafalllimit_m == 1.0) {\r\n /* : elseif data == 1 */\r\n /* : temp_gear = -1; */\r\n rtb_output_p = -1.0;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : temp_gear = 1; */\r\n rtb_output_p = 1.0;\r\n } else {\r\n /* : else */\r\n /* : temp_gear = 0; */\r\n rtb_output_p = 0.0;\r\n }\r\n\r\n if (rtb_deltafalllimit_m == 2.0) {\r\n /* : elseif data == 2 */\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n } else if (rtb_deltafalllimit_m == 1.0) {\r\n /* : elseif data == 1 */\r\n /* : temp_gear = -1; */\r\n temp_gear = -1;\r\n } else if (rtb_deltafalllimit_m == 3.0) {\r\n /* : elseif data == 3 */\r\n /* : temp_gear = 1; */\r\n temp_gear = 1;\r\n } else {\r\n /* : else */\r\n /* : temp_gear = 0; */\r\n temp_gear = 0;\r\n }\r\n }\r\n\r\n /* End of MATLAB Function: '/Gear_pos_out' */\r\n\r\n /* MATLAB Function: '/Target_RPM' */\r\n /* : output = temp_gear; */\r\n /* : gear_ratio = 11.93; */\r\n /* : Radius = 0.270781; */\r\n /* : engine_eff = 1; */\r\n /* Gear R 단에서 - target rpm 값 */\r\n /* : if data == 0 */\r\n /* : speed_m_per_s = Vx_Kph * 1000/3600; */\r\n /* : Target_RPM = (speed_m_per_s * gear_ratio * 60) / (Radius*2*pi)*engine_eff*temp_gear; */\r\n rtb_Brake_Torque_Cmd = rtb_Vx_Cmd_R * 1000.0 / 3600.0 * 11.93 * 60.0 /\r\n 1.7013672006633955 * (double)temp_gear;\r\n\r\n /* RateLimiter: '/TargetSpd_RateLimiter' */\r\n rtb_output_a = rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.PrevY_a;\r\n if (rtb_output_a > 0.4) {\r\n rtb_output_a = ADM_Integrated_Logic_DW.PrevY_a + 0.4;\r\n } else if (rtb_output_a < -0.8) {\r\n rtb_output_a = ADM_Integrated_Logic_DW.PrevY_a - 0.8;\r\n } else {\r\n rtb_output_a = rtb_Brake_Torque_Cmd;\r\n }\r\n\r\n ADM_Integrated_Logic_DW.PrevY_a = rtb_output_a;\r\n\r\n /* End of RateLimiter: '/TargetSpd_RateLimiter' */\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Brake_Torque_Cmd = ((rtb_output_a + ADM_Integrated_Logic_DW.d1_DSTATE) *\r\n 0.002 + 0.1041032953945969 * ADM_Integrated_Logic_DW.d_DSTATE) /\r\n 0.1081032953945969;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_i2 = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_i) *\r\n 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_p;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_o1 = (rtb_Sum1_i2 - ADM_Integrated_Logic_DW.d_DSTATE_c) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_h;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_lm = (rtb_Sum1_o1 - ADM_Integrated_Logic_DW.d_DSTATE_d) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_l;\r\n\r\n /* Gain: '/Gain' incorporates:\r\n * Constant: '/Constant3'\r\n * Constant: '/Constant4'\r\n * Constant: '/Constant5'\r\n * Product: '/Product'\r\n * Product: '/Product1'\r\n * Product: '/Product2'\r\n * Sum: '/Add5'\r\n */\r\n rtb_Gain_c = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Sum1_i2) + 21.8 *\r\n rtb_Sum1_o1) + rtb_Sum1_lm) * 9.44822373393802E-6;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant1'\r\n * Constant: '/Constant2'\r\n * Delay: '/Delay'\r\n * Delay: '/Delay1'\r\n * Delay: '/Delay2'\r\n * Delay: '/Delay3'\r\n * Gain: '/gain1'\r\n * Gain: '/gain3'\r\n * Product: '/x(n), x(n-1), x(n-2)'\r\n * Product: '/y(n-1)'\r\n * Product: '/y(n-2)'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * Sum: '/Sum5'\r\n * Sum: '/Sum6'\r\n */\r\n rtb_Product1_pd = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE + rtb_Gain_c)\r\n + ADM_Integrated_Logic_DW.Delay_DSTATE[0]) *\r\n 0.39478417604357435 - -7.2104316479128512 *\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE) -\r\n 2.6178993711731877 * ADM_Integrated_Logic_DW.Delay3_DSTATE\r\n [0]) / 6.1716689809139611;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_m = ((rtb_Product1_pd + ADM_Integrated_Logic_DW.d1_DSTATE_e) *\r\n 0.002 + 0.00861032953945969 *\r\n ADM_Integrated_Logic_DW.d_DSTATE_ij) / 0.01261032953945969;\r\n\r\n /* Sum: '/Subtract' incorporates:\r\n * Inport: '/GV_MCU_RPM'\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n rtb_Error_m = rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_U.GV_MCU_RPM;\r\n\r\n /* Saturate: '/Error_Saturation' incorporates:\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n if (rtb_Error_m > 2000.0) {\r\n rtb_Error_m = 2000.0;\r\n } else if (rtb_Error_m < -2000.0) {\r\n rtb_Error_m = -2000.0;\r\n }\r\n\r\n /* End of Saturate: '/Error_Saturation' */\r\n\r\n /* DeadZone: '/Dead Zone' incorporates:\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n */\r\n if (rtb_Error_m > 50.0) {\r\n rtb_Add_e = rtb_Error_m - 50.0;\r\n } else if (rtb_Error_m >= -50.0) {\r\n rtb_Add_e = 0.0;\r\n } else {\r\n rtb_Add_e = rtb_Error_m - -50.0;\r\n }\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Error_m = (rtb_Brake_Torque_Cmd - ADM_Integrated_Logic_DW.d_DSTATE_ir) *\r\n 1000.0 - ADM_Integrated_Logic_DW.d1_DSTATE_o;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_aj = (rtb_Error_m - ADM_Integrated_Logic_DW.d_DSTATE_m) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_hm;\r\n\r\n /* Sum: '/Sum1' incorporates:\r\n * Gain: '/gain'\r\n * Sum: '/Sum2'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Sum1_p = (rtb_Sum1_aj - ADM_Integrated_Logic_DW.d_DSTATE_mw) * 1000.0 -\r\n ADM_Integrated_Logic_DW.d1_DSTATE_g;\r\n\r\n /* Sum: '/Add3' incorporates:\r\n * Constant: '/Constant3'\r\n * Constant: '/Constant4'\r\n * Constant: '/Constant5'\r\n * Gain: '/Gain'\r\n * Memory: '/Memory'\r\n * Product: '/Product2'\r\n * Product: '/Product3'\r\n * Product: '/Product4'\r\n * Sum: '/Add2'\r\n */\r\n rtb_Add3 = (((156.8 * rtb_Brake_Torque_Cmd + 212.8 * rtb_Error_m) + 21.8 *\r\n rtb_Sum1_aj) + rtb_Sum1_p) * 9.44822373393802E-6 -\r\n ADM_Integrated_Logic_DW.Memory_PreviousInput;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_e = ((rtb_Add3 + ADM_Integrated_Logic_DW.d1_DSTATE_ej) * 0.002 +\r\n 0.029830988618379066 * ADM_Integrated_Logic_DW.d_DSTATE_j) /\r\n 0.03383098861837907;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant1'\r\n * Constant: '/Constant2'\r\n * Delay: '/Delay'\r\n * Delay: '/Delay1'\r\n * Delay: '/Delay2'\r\n * Delay: '/Delay3'\r\n * Gain: '/gain1'\r\n * Gain: '/gain3'\r\n * Product: '/x(n), x(n-1), x(n-2)'\r\n * Product: '/y(n-1)'\r\n * Product: '/y(n-2)'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * Sum: '/Sum5'\r\n * Sum: '/Sum6'\r\n */\r\n rtb_Product1_iz = ((((2.0 * ADM_Integrated_Logic_DW.Delay1_DSTATE_c +\r\n rtb_Product1_e) +\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[0]) *\r\n 0.00035530575843921691 - -7.9992893884831213 *\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE_n) -\r\n 3.9470487616123275 *\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[0]) /\r\n 4.0536618499045511;\r\n\r\n /* MATLAB Function: '/DOB_Gain' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n /* : if vx < 5 */\r\n if (ADM_Integrated_Logic_U.GV_Vx_Fbk < 5.0) {\r\n /* : gain = 0; */\r\n rtb_Switch2 = 0.0;\r\n } else {\r\n /* : else */\r\n /* : gain = (vx-5) * 0.2; */\r\n rtb_Switch2 = (ADM_Integrated_Logic_U.GV_Vx_Fbk - 5.0) * 0.2;\r\n }\r\n\r\n /* : if gain >=1 */\r\n if (rtb_Switch2 >= 1.0) {\r\n /* : gain =1; */\r\n rtb_Switch2 = 1.0;\r\n }\r\n\r\n /* End of MATLAB Function: '/DOB_Gain' */\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/DOBFlag'\r\n * Product: '/Product'\r\n */\r\n rtb_Integrator_1 = -(rtb_Product1_iz * 0.9);\r\n\r\n /* Saturate: '/DOB_Saturation' */\r\n if (rtb_Integrator_1 > 30.0) {\r\n rtb_Integrator_1 = 30.0;\r\n } else if (rtb_Integrator_1 < -30.0) {\r\n rtb_Integrator_1 = -30.0;\r\n }\r\n\r\n /* Sum: '/Subtract2' incorporates:\r\n * DeadZone: '/Dead Zone'\r\n * MultiPortSwitch: '/Multiport Switch1'\r\n * Product: '/Product'\r\n * Product: '/Multiply1'\r\n * Saturate: '/DOB_Saturation'\r\n * Sum: '/Add'\r\n */\r\n rtb_Add_e = (rtb_Add_e * 0.044648264844923756 + rtb_Product1_m) +\r\n rtb_Integrator_1 * rtb_Switch2;\r\n\r\n /* Saturate: '/Torq_Saturation' */\r\n if (rtb_Add_e > 80.0) {\r\n rtb_Add_e = 80.0;\r\n } else if (rtb_Add_e < -80.0) {\r\n rtb_Add_e = -80.0;\r\n }\r\n\r\n /* End of Saturate: '/Torq_Saturation' */\r\n\r\n /* MATLAB Function: '/Emergency_Motor_Func' */\r\n /* : if Emergency_Flag == 1 */\r\n if (rtb_Compare) {\r\n /* Outport: '/GV_Motor_Torque_Cmd' */\r\n /* : Emergency_Motor_Output = 0; */\r\n ADM_Integrated_Logic_Y.GV_Motor_Torque_Cmd = 0.0;\r\n } else {\r\n /* Outport: '/GV_Motor_Torque_Cmd' incorporates:\r\n * Product: '/Multiply'\r\n */\r\n /* : else */\r\n /* : Emergency_Motor_Output = Motor_Torque_Cmd; */\r\n ADM_Integrated_Logic_Y.GV_Motor_Torque_Cmd = rtb_output_p * rtb_Add_e;\r\n }\r\n\r\n /* End of MATLAB Function: '/Emergency_Motor_Func' */\r\n\r\n /* Outport: '/GV_Gear_Postion_Out' */\r\n ADM_Integrated_Logic_Y.GV_Gear_Postion_Out = rtb_deltafalllimit_m;\r\n\r\n /* Sum: '/Add2' incorporates:\r\n * Inport: '/GV_Vx_Fbk'\r\n */\r\n rtb_Vx_Cmd_R -= ADM_Integrated_Logic_U.GV_Vx_Fbk;\r\n\r\n /* Outport: '/GV_Hill_Torque_Assist' */\r\n ADM_Integrated_Logic_Y.GV_Hill_Torque_Assist = rtb_Desired_Torque;\r\n\r\n /* Outport: '/Debug_HAC_Pitch_angle' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Pitch_angle = rtb_Yk1_e;\r\n\r\n /* MATLAB Function: '/Calculate_F_c1' incorporates:\r\n * Gain: '/Gain3'\r\n */\r\n ADM_Integrated_Lo_Calculate_F_c(ADM_Integrated_Logic_ConstB.W_Value_for_Brake,\r\n 0.017453292519943295 * rtb_Yk1_e, &rtb_Switch2);\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AX_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Desired_Torque = ((ADM_Integrated_Logic_U.GV_IMU_AX_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ob) * 0.002 + 0.061661977236758134 *\r\n ADM_Integrated_Logic_DW.d_DSTATE_e) /\r\n 0.065661977236758137;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AY_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_output_p = ((ADM_Integrated_Logic_U.GV_IMU_AY_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_i) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_p) /\r\n 0.065661977236758137;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_AZ_Val'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Integrator_1 = ((ADM_Integrated_Logic_U.GV_IMU_AZ_Val +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o1) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_n)\r\n / 0.065661977236758137;\r\n\r\n /* MATLAB Function: '/Pitch_calculate' */\r\n /* This function calculates the pitch angle using accelerometer data. */\r\n /* Inputs: */\r\n /* ax - Acceleration in the x-axis */\r\n /* ay - Acceleration in the y-axis */\r\n /* az - Acceleration in the z-axis */\r\n /* Output: */\r\n /* pitch - Calculated pitch angle in degrees */\r\n /* Step 1: Calculate the denominator (sqrt(ay^2 + az^2)) */\r\n /* : denominator = sqrt(ay^2 + az^2); */\r\n rtb_Switch2 = sqrt(rtb_output_p * rtb_output_p + rtb_Integrator_1 *\r\n rtb_Integrator_1);\r\n\r\n /* Step 2: Compute pitch in radians using arctan(ax / denominator) */\r\n /* Protect against division by zero */\r\n /* : if denominator == 0 */\r\n if (rtb_Switch2 != 0.0) {\r\n /* : else */\r\n /* : pitch = atan(ax / denominator); */\r\n rtb_Switch2 = atan(rtb_Desired_Torque / rtb_Switch2);\r\n\r\n /* Calculate pitch in radians */\r\n } else {\r\n /* : pitch = 0; */\r\n /* If ay and az are both zero, pitch is set to 0 */\r\n }\r\n\r\n /* Sum: '/Sum' incorporates:\r\n * DiscreteIntegrator: '/Integrator_2'\r\n * MATLAB Function: '/Pitch_calculate'\r\n */\r\n /* Step 3: Convert radians to degrees */\r\n /* : pitch = pitch * (180 / pi); */\r\n /* Convert to degrees */\r\n rtb_Sum = ADM_Integrated_Logic_DW.Integrator_2_DSTATE - rtb_Switch2 *\r\n 57.295779513082323;\r\n\r\n /* Product: '/Product1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/gain'\r\n * Inport: '/GV_IMU_PitchRtVal'\r\n * Product: '/Product11'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n * Sum: '/Sum3'\r\n * Sum: '/Sum4'\r\n * UnitDelay: '/d'\r\n * UnitDelay: '/d1'\r\n */\r\n rtb_Product1_f = ((ADM_Integrated_Logic_U.GV_IMU_PitchRtVal +\r\n ADM_Integrated_Logic_DW.d1_DSTATE_a) * 0.002 +\r\n 0.061661977236758134 * ADM_Integrated_Logic_DW.d_DSTATE_d1) /\r\n 0.065661977236758137;\r\n\r\n /* Sum: '/Add1' incorporates:\r\n * Constant: '/Constant'\r\n * Gain: '/Gain1'\r\n * Inport: '/GV_Vx_Fbk'\r\n * Sum: '/Add3'\r\n */\r\n rtb_Add1_tmp = 400.0 - 6.5 * ADM_Integrated_Logic_U.GV_Vx_Fbk;\r\n\r\n /* MATLAB Function: '/MATLAB Function1' incorporates:\r\n * Sum: '/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_Yk1_p = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c;\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Inport: '/GV_RWA_RackAngleCommand'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_UkYk1_j = ADM_Integrated_Logic_U.GV_RWA_RackAngleCommand - rtb_Yk1_p;\r\n\r\n /* MATLAB Function: '/MATLAB Function2' incorporates:\r\n * Gain: '/Gain3'\r\n * Sum: '/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_UkYk1_j <= rtb_Switch2) {\r\n /* Product: '/delta fall limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_UkYk1_j >= rtb_Switch2) {\r\n rtb_Switch2 = rtb_UkYk1_j;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Yk1_p += rtb_Switch2;\r\n\r\n /* Outport: '/GV_Master_Rack_Angle_Cmd' */\r\n ADM_Integrated_Logic_Y.GV_Master_Rack_Angle_Cmd = rtb_Yk1_p;\r\n\r\n /* MATLAB Function: '/MATLAB Function5' */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '/delta rise limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n rtb_UkYk1_j = ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i;\r\n\r\n /* Sum: '/Difference Inputs1' incorporates:\r\n * Inport: '/GV_RWS_RackAngleCommand'\r\n *\r\n * Block description for '/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Add1 = ADM_Integrated_Logic_U.GV_RWS_RackAngleCommand - rtb_UkYk1_j;\r\n\r\n /* MATLAB Function: '/MATLAB Function6' incorporates:\r\n * Gain: '/Gain5'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '/Switch2' incorporates:\r\n * RelationalOperator: '/LowerRelop1'\r\n */\r\n if (rtb_Add1 <= rtb_Switch2) {\r\n /* Product: '/delta fall limit' incorporates:\r\n * SampleTimeMath: '/sample time'\r\n *\r\n * About '/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Switch2 = rtb_y_l * 0.002;\r\n\r\n /* Switch: '/Switch' incorporates:\r\n * RelationalOperator: '/UpperRelop'\r\n */\r\n if (rtb_Add1 >= rtb_Switch2) {\r\n rtb_Switch2 = rtb_Add1;\r\n }\r\n\r\n /* End of Switch: '/Switch' */\r\n }\r\n\r\n /* End of Switch: '/Switch2' */\r\n\r\n /* Sum: '/Difference Inputs2'\r\n *\r\n * Block description for '/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Switch2 += rtb_UkYk1_j;\r\n\r\n /* Outport: '/GV_RWS_RackAngleCmd1' */\r\n ADM_Integrated_Logic_Y.GV_RWS_RackAngleCmd1 = rtb_Switch2;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE = rtb_UkYk1;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_m = rtb_Yk1_e;\r\n\r\n /* Update for DiscreteIntegrator: '/Integrator_2' incorporates:\r\n * Constant: '/I_gain'\r\n * Constant: '/P_gain'\r\n * DiscreteIntegrator: '/Integrator_1'\r\n * Product: '/Product'\r\n * Product: '/Product1'\r\n * Sum: '/Sum1'\r\n * Sum: '/Sum2'\r\n */\r\n ADM_Integrated_Logic_DW.Integrator_2_DSTATE += (rtb_Product1_f -\r\n (ADM_Integrated_Logic_DW.Integrator_1_DSTATE * 5.0 + rtb_Sum * 100.0)) *\r\n 0.002;\r\n\r\n /* Update for Delay: '/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_DSTATE = rtb_deltafalllimit_m;\r\n\r\n /* Update for DiscreteTransferFcn: '/Discrete Transfer Fcn' */\r\n ADM_Integrated_Logic_DW.DiscreteTransferFcn_states = rtb_Vx_Cmd_R - -0.9375 *\r\n ADM_Integrated_Logic_DW.DiscreteTransferFcn_states;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE = rtb_output_a;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_i = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_p = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_c = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_h = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_l = rtb_Sum1_lm;\r\n\r\n /* Update for Delay: '/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE = rtb_Gain_c;\r\n\r\n /* Update for Delay: '/Delay' */\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[0] =\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[1];\r\n ADM_Integrated_Logic_DW.Delay_DSTATE[1] = rtb_Gain_c;\r\n\r\n /* Update for Delay: '/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE = rtb_Product1_pd;\r\n\r\n /* Update for Delay: '/Delay3' */\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[0] =\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[1];\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE[1] = rtb_Product1_pd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_e = rtb_Product1_pd;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ij = rtb_Product1_m;\r\n\r\n /* Update for Memory: '/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_PreviousInput = rtb_Add_e;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ir = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_m = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_hm = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_mw = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_g = rtb_Sum1_p;\r\n\r\n /* Update for UnitDelay: '/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ej = rtb_Add3;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_j = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE_c = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay' */\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[0] =\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[1];\r\n ADM_Integrated_Logic_DW.Delay_DSTATE_p[1] = rtb_Product1_e;\r\n\r\n /* Update for Delay: '/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE_n = rtb_Product1_iz;\r\n\r\n /* Update for Delay: '/Delay3' */\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[0] =\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1];\r\n ADM_Integrated_Logic_DW.Delay3_DSTATE_h[1] = rtb_Product1_iz;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AX_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ob = ADM_Integrated_Logic_U.GV_IMU_AX_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_e = rtb_Desired_Torque;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AY_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_i = ADM_Integrated_Logic_U.GV_IMU_AY_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_p = rtb_output_p;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_AZ_Val'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o1 = ADM_Integrated_Logic_U.GV_IMU_AZ_Val;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_n = rtb_Integrator_1;\r\n\r\n /* Update for DiscreteIntegrator: '/Integrator_1' */\r\n ADM_Integrated_Logic_DW.Integrator_1_DSTATE += 0.002 * rtb_Sum;\r\n\r\n /* Update for UnitDelay: '/d1' incorporates:\r\n * Inport: '/GV_IMU_PitchRtVal'\r\n */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_a = ADM_Integrated_Logic_U.GV_IMU_PitchRtVal;\r\n\r\n /* Update for UnitDelay: '/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d1 = rtb_Product1_f;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_c = rtb_Yk1_p;\r\n\r\n /* Update for UnitDelay: '/Delay Input2'\r\n *\r\n * Block description for '/Delay Input2':\r\n *\r\n * Store in Global RAM\r\n */\r\n ADM_Integrated_Logic_DW.DelayInput2_DSTATE_i = rtb_Switch2;\r\n}\r\n\r\n/* Model initialize function */\r\nvoid ADM_Integrated_Logic_initialize(void)\r\n{\r\n /* : HAC_ON_FLAG = 0; */\r\n /* : Smoothed_Torque = 0; */\r\n /* : HAC_Desired_Torque = 0; */\r\n /* : HAC_ON_Timer = 0; */\r\n}\r\n\r\n/* Model terminate function */\r\nvoid ADM_Integrated_Logic_terminate(void)\r\n{\r\n /* (no terminate code required) */\r\n}\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic.h","type":"header","group":"model","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_h_\r\n#define ADM_Integrated_Logic_h_\r\n#ifndef ADM_Integrated_Logic_COMMON_INCLUDES_\r\n#define ADM_Integrated_Logic_COMMON_INCLUDES_\r\n#include \r\n#include \r\n#include \"complex_types.h\"\r\n#endif /* ADM_Integrated_Logic_COMMON_INCLUDES_ */\r\n\r\n#include \"ADM_Integrated_Logic_types.h\"\r\n\r\n/* Block signals and states (default storage) for system '' */\r\ntypedef struct {\r\n double Delay_DSTATE[2]; /* '/Delay' */\r\n double Delay3_DSTATE[2]; /* '/Delay3' */\r\n double Delay_DSTATE_p[2]; /* '/Delay' */\r\n double Delay3_DSTATE_h[2]; /* '/Delay3' */\r\n double DelayInput2_DSTATE; /* '/Delay Input2' */\r\n double DelayInput2_DSTATE_m; /* '/Delay Input2' */\r\n double Integrator_2_DSTATE; /* '/Integrator_2' */\r\n double Memory_DSTATE; /* '/Memory' */\r\n double DiscreteTransferFcn_states; /* '/Discrete Transfer Fcn' */\r\n double d1_DSTATE; /* '/d1' */\r\n double d_DSTATE; /* '/d' */\r\n double d_DSTATE_i; /* '/d' */\r\n double d1_DSTATE_p; /* '/d1' */\r\n double d_DSTATE_c; /* '/d' */\r\n double d1_DSTATE_h; /* '/d1' */\r\n double d_DSTATE_d; /* '/d' */\r\n double d1_DSTATE_l; /* '/d1' */\r\n double Delay1_DSTATE; /* '/Delay1' */\r\n double Delay2_DSTATE; /* '/Delay2' */\r\n double d1_DSTATE_e; /* '/d1' */\r\n double d_DSTATE_ij; /* '/d' */\r\n double d_DSTATE_ir; /* '/d' */\r\n double d1_DSTATE_o; /* '/d1' */\r\n double d_DSTATE_m; /* '/d' */\r\n double d1_DSTATE_hm; /* '/d1' */\r\n double d_DSTATE_mw; /* '/d' */\r\n double d1_DSTATE_g; /* '/d1' */\r\n double d1_DSTATE_ej; /* '/d1' */\r\n double d_DSTATE_j; /* '/d' */\r\n double Delay1_DSTATE_c; /* '/Delay1' */\r\n double Delay2_DSTATE_n; /* '/Delay2' */\r\n double d1_DSTATE_ob; /* '/d1' */\r\n double d_DSTATE_e; /* '/d' */\r\n double d1_DSTATE_i; /* '/d1' */\r\n double d_DSTATE_p; /* '/d' */\r\n double d1_DSTATE_o1; /* '/d1' */\r\n double d_DSTATE_n; /* '/d' */\r\n double Integrator_1_DSTATE; /* '/Integrator_1' */\r\n double d1_DSTATE_a; /* '/d1' */\r\n double d_DSTATE_d1; /* '/d' */\r\n double DelayInput2_DSTATE_c; /* '/Delay Input2' */\r\n double DelayInput2_DSTATE_i; /* '/Delay Input2' */\r\n double PrevY; /* '/Input_Vx_RateLimiter' */\r\n double PrevY_o; /* '/Brake_Out_RateLimiter' */\r\n double PrevY_a; /* '/TargetSpd_RateLimiter' */\r\n double Memory_PreviousInput; /* '/Memory' */\r\n double HAC_ON_FLAG; /* '/HAC_OFF_OK_Func' */\r\n double Smoothed_Torque; /* '/HAC_OFF_OK_Func' */\r\n double HAC_Desired_Torque; /* '/HAC_OFF_OK_Func' */\r\n double HAC_ON_Timer; /* '/HAC_OFF_OK_Func' */\r\n uint8_t is_active_c6_ADM_Integrated_Log;/* '/Chart' */\r\n uint8_t is_c6_ADM_Integrated_Logic; /* '/Chart' */\r\n} DW_ADM_Integrated_Logic_T;\r\n\r\n/* Invariant block signals (default storage) */\r\ntypedef struct {\r\n const double W_value; /* '/Multiply' */\r\n const double W_Value_for_Brake; /* '/Multiply4' */\r\n} ConstB_ADM_Integrated_Logic_T;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\ntypedef struct {\r\n double GV_MCU_RPM; /* '/GV_MCU_RPM' */\r\n double GV_BrakeTorqueCommand; /* '/GV_BrakeTorqueCommand' */\r\n double GV_IMU_AX_Val; /* '/GV_IMU_AX_Val' */\r\n double GV_IMU_AY_Val; /* '/GV_IMU_AY_Val' */\r\n double GV_IMU_AZ_Val; /* '/GV_IMU_AZ_Val' */\r\n double GV_IMU_PitchRtVal; /* '/GV_IMU_PitchRtVal' */\r\n double GV_Vx_Command; /* '/GV_Vx_Command' */\r\n double GV_VCU_GearSelStat; /* '/GV_VCU_GearSelStat' */\r\n double GV_MCU_EstTrq; /* '/GV_MCU_EstTrq' */\r\n double GV_Vx_Limit; /* '/GV_Vx_Limit' */\r\n double GV_Vx_Fbk; /* '/GV_Vx_Fbk' */\r\n double GV_RWA_RackAngleCommand; /* '/GV_RWA_RackAngleCommand' */\r\n double GV_RWS_RackAngleCommand; /* '/GV_RWS_RackAngleCommand' */\r\n double GV_RWA_Fault_Flag; /* '/GV_RWA_Fault_Flag' */\r\n double GV_Operation_Mode; /* '/GV_Operation_Mode' */\r\n} ExtU_ADM_Integrated_Logic_T;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\ntypedef struct {\r\n double GV_Brake_Command; /* '/GV_Brake_Command' */\r\n double GV_Master_Rack_Angle_Cmd; /* '/GV_Master_Rack_Angle_Cmd' */\r\n double GV_Hill_Torque_Assist; /* '/GV_Hill_Torque_Assist' */\r\n double GV_Motor_Torque_Cmd; /* '/GV_Motor_Torque_Cmd' */\r\n double Debug_HAC_FLAG; /* '/Debug_HAC_FLAG' */\r\n double Debug_HAC_RPM_Decision; /* '/Debug_HAC_RPM_Decision' */\r\n double Debug_HAC_Pitch_angle; /* '/Debug_HAC_Pitch_angle' */\r\n double Debug_HAC_Brake_Output; /* '/Debug_HAC_Brake_Output' */\r\n double Debug_CC_Brake_Output; /* '/Debug_CC_Brake_Output' */\r\n double GV_RWS_RackAngleCmd1; /* '/GV_RWS_RackAngleCmd1' */\r\n double GV_Speed_Limit; /* '/GV_Speed_Limit' */\r\n double GV_Gear_Postion_Out; /* '/GV_Gear_Postion_Out' */\r\n} ExtY_ADM_Integrated_Logic_T;\r\n\r\n/* Block signals and states (default storage) */\r\nextern DW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW;\r\n\r\n/* External inputs (root inport signals with default storage) */\r\nextern ExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U;\r\n\r\n/* External outputs (root outports fed by signals with default storage) */\r\nextern ExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y;\r\nextern const ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB;/* constant block i/o */\r\n\r\n/* Model entry point functions */\r\nextern void ADM_Integrated_Logic_initialize(void);\r\nextern void ADM_Integrated_Logic_step(void);\r\nextern void ADM_Integrated_Logic_terminate(void);\r\n\r\n/*-\r\n * These blocks were eliminated from the model due to optimizations:\r\n *\r\n * Block '/BW_PI' : Unused code path elimination\r\n * Block '/Constant1' : Unused code path elimination\r\n * Block '/Constant16' : Unused code path elimination\r\n * Block '/Constant17' : Unused code path elimination\r\n * Block '/Constant2' : Unused code path elimination\r\n * Block '/Data Type Conversion2' : Unused code path elimination\r\n * Block '/Gain2' : Unused code path elimination\r\n * Block '/Abs' : Unused code path elimination\r\n * Block '/Brake_Saturation' : Unused code path elimination\r\n * Block '/Multiply5' : Unused code path elimination\r\n * Block '/Radius1' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/Scope2' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Duplicate' : Unused code path elimination\r\n * Block '/Data Type Propagation' : Unused code path elimination\r\n * Block '/ControlFlag' : Eliminated nontunable gain of 1\r\n * Block '/FBGain' : Eliminated nontunable gain of 1\r\n * Block '/FFGain' : Eliminated nontunable gain of 1\r\n * Block '/Data Type Conversion1' : Eliminate redundant data type conversion\r\n * Block '/Data Type Conversion3' : Eliminate redundant data type conversion\r\n * Block '/HAC_Gain' : Eliminated nontunable gain of 1\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n */\r\n\r\n/*-\r\n * The generated code includes comments that allow you to trace directly\r\n * back to the appropriate location in the model. The basic format\r\n * is /block_name, where system is the system number (uniquely\r\n * assigned by Simulink) and block_name is the name of the block.\r\n *\r\n * Use the MATLAB hilite_system command to trace the generated code back\r\n * to the model. For example,\r\n *\r\n * hilite_system('') - opens system 3\r\n * hilite_system('/Kp') - opens and selects block Kp which resides in S3\r\n *\r\n * Here is the system hierarchy for this model\r\n *\r\n * '' : 'ADM_Integrated_Logic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Brake_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Gear_Func1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_R'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c1'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Compare To Constant'\r\n * '' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Vx_OutPut_Function'\r\n */\r\n\r\n/*-\r\n * Requirements for '': ADM_Integrated_Logic\r\n\r\n */\r\n#endif /* ADM_Integrated_Logic_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_private.h","type":"header","group":"model","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_private.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_private_h_\r\n#define ADM_Integrated_Logic_private_h_\r\n#include \r\n#include \r\n#include \"complex_types.h\"\r\n#include \"ADM_Integrated_Logic_types.h\"\r\n#include \"ADM_Integrated_Logic.h\"\r\n\r\nextern void ADM_Integrated_Lo_Calculate_F_c(double rtu_W, double rtu_theta,\r\n double *rty_F_c);\r\nextern void ADM_Integrated__MATLABFunction1(double rtu_u, double *rty_y);\r\nextern void ADM_Integrated__MATLABFunction2(double rtu_u, double *rty_y);\r\n\r\n#endif /* ADM_Integrated_Logic_private_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_types.h","type":"header","group":"model","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Model files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_types.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef ADM_Integrated_Logic_types_h_\r\n#define ADM_Integrated_Logic_types_h_\r\n#endif /* ADM_Integrated_Logic_types_h_ */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"ADM_Integrated_Logic_data.c","type":"source","group":"data","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Data files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: ADM_Integrated_Logic_data.c\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#include \"ADM_Integrated_Logic.h\"\r\n\r\n/* Invariant block signals (default storage) */\r\nconst ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB = {\r\n 12753.0, /* '/Multiply' */\r\n 12753.0 /* '/Multiply4' */\r\n};\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"},{"name":"complex_types.h","type":"header","group":"utility","path":"C:\\Users\\MSI\\Documents\\WorkSpace\\git\\ADM\\[ADM] Integrated Logic\\ADM_Integrated_Logic_ert_rtw","tag":"","groupDisplay":"Utility files","code":"/*\r\n * Academic License - for use in teaching, academic research, and meeting\r\n * course requirements at degree granting institutions only. Not for\r\n * government, commercial, or other organizational use.\r\n *\r\n * File: complex_types.h\r\n *\r\n * Code generated for Simulink model 'ADM_Integrated_Logic'.\r\n *\r\n * Model version : 13.63\r\n * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023\r\n * C/C++ source code generated on : Wed Jun 4 15:25:59 2025\r\n *\r\n * Target selection: ert.tlc\r\n * Embedded hardware selection: NXP->Cortex-M4\r\n * Code generation objectives:\r\n * 1. Execution efficiency\r\n * 2. RAM efficiency\r\n * 3. Debugging\r\n * Validation result: Not run\r\n */\r\n\r\n#ifndef COMPLEX_TYPES_H\r\n#define COMPLEX_TYPES_H\r\n#include \r\n\r\n/*===========================================================================*\r\n * Complex number type definitions *\r\n *===========================================================================*/\r\n#define CREAL_T\r\n\r\ntypedef struct {\r\n float re;\r\n float im;\r\n} creal32_T;\r\n\r\ntypedef struct {\r\n double re;\r\n double im;\r\n} creal_T;\r\n\r\ntypedef creal_T creal64_T;\r\n\r\n#define CINT8_T\r\n\r\ntypedef struct {\r\n int8_t re;\r\n int8_t im;\r\n} cint8_T;\r\n\r\n#define CUINT8_T\r\n\r\ntypedef struct {\r\n uint8_t re;\r\n uint8_t im;\r\n} cuint8_T;\r\n\r\n#define CINT16_T\r\n\r\ntypedef struct {\r\n int16_t re;\r\n int16_t im;\r\n} cint16_T;\r\n\r\n#define CUINT16_T\r\n\r\ntypedef struct {\r\n uint16_t re;\r\n uint16_t im;\r\n} cuint16_T;\r\n\r\n#define CINT32_T\r\n\r\ntypedef struct {\r\n int32_t re;\r\n int32_t im;\r\n} cint32_T;\r\n\r\n#define CUINT32_T\r\n\r\ntypedef struct {\r\n uint32_t re;\r\n uint32_t im;\r\n} cuint32_T;\r\n\r\n#define CINT64_T\r\n\r\ntypedef struct {\r\n int64_t re;\r\n int64_t im;\r\n} cint64_T;\r\n\r\n#define CUINT64_T\r\n\r\ntypedef struct {\r\n uint64_t re;\r\n uint64_t im;\r\n} cuint64_T;\r\n\r\n#endif /* COMPLEX_TYPES_H */\r\n\r\n/*\r\n * File trailer for generated code.\r\n *\r\n * [EOF]\r\n */\r\n"}],"coverage":[{"id":"SimulinkCoverage","name":"Simulink Coverage","files":[]},{"id":"Bullseye","name":"Bullseye Coverage","files":[]},{"id":"LDRA","name":"LDRA Testbed","files":[]}],"features":{"annotation":false,"coverage":true,"profiling":true,"tooltip":true,"coverageTooltip":true,"showJustificationLinks":true,"useMWTable":false,"showProfilingInfo":true,"showTaskSummary":true,"showProtectedV2Report":true}}; \ No newline at end of file diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_reducedblocks.html b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_reducedblocks.html index 5bb0910a..075b67d6 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_reducedblocks.html +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_reducedblocks.html @@ -33,7 +33,7 @@ Description -<S17>/BW_PI +<S18>/BW_PI Unused code path elimination @@ -42,7 +42,7 @@ Unused code path elimination -<S17>/Constant1 +<S18>/Constant1 Unused code path elimination @@ -51,7 +51,7 @@ Unused code path elimination -<S17>/Constant16 +<S18>/Constant16 Unused code path elimination @@ -60,7 +60,7 @@ Unused code path elimination -<S17>/Constant17 +<S18>/Constant17 Unused code path elimination @@ -69,7 +69,7 @@ Unused code path elimination -<S17>/Constant2 +<S18>/Constant2 Unused code path elimination @@ -96,7 +96,7 @@ Unused code path elimination -<S39>/Abs +<S40>/Abs Unused code path elimination @@ -105,7 +105,7 @@ Unused code path elimination -<S39>/Brake_Saturation +<S40>/Brake_Saturation Unused code path elimination @@ -114,7 +114,7 @@ Unused code path elimination -<S39>/Multiply5 +<S40>/Multiply5 Unused code path elimination @@ -123,7 +123,7 @@ Unused code path elimination -<S39>/Radius1 +<S40>/Radius1 Unused code path elimination @@ -186,7 +186,7 @@ Unused code path elimination -<S7>/Scope2 +<S8>/Scope2 Unused code path elimination @@ -195,7 +195,7 @@ Unused code path elimination -<S12>/FixPt Data Type Duplicate +<S13>/FixPt Data Type Duplicate Unused code path elimination @@ -222,7 +222,7 @@ Unused code path elimination -<S13>/FixPt Data Type Duplicate +<S14>/FixPt Data Type Duplicate Unused code path elimination @@ -258,7 +258,7 @@ Eliminated nontunable gain of 1 -<S17>/FBGain +<S18>/FBGain Eliminated nontunable gain of 1 @@ -267,7 +267,7 @@ Eliminated nontunable gain of 1 -<S28>/FFGain +<S29>/FFGain Eliminated nontunable gain of 1 @@ -294,7 +294,7 @@ Eliminate redundant data type conversion -<S39>/HAC_Gain +<S40>/HAC_Gain Eliminated nontunable gain of 1 @@ -321,7 +321,7 @@ Eliminated since input and output rates are identical -<S12>/Zero-Order Hold +<S13>/Zero-Order Hold Eliminated since input and output rates are identical @@ -330,7 +330,7 @@ Eliminated since input and output rates are identical -<S13>/Zero-Order Hold +<S14>/Zero-Order Hold Eliminated since input and output rates are identical diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_subsystems.html b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_subsystems.html index 00c476b5..cdeafd00 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_subsystems.html +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_subsystems.html @@ -96,36 +96,6 @@ Auto normal - - - -<S8> - - -Auto - - -Reusable Function(S8) - - -normal - - - - - -<S10> - - -Auto - - -Reusable Function(S8) - - -normal - - @@ -135,7 +105,7 @@ Auto Auto -Reusable Function(S9) +Reusable Function(S9) normal @@ -150,7 +120,7 @@ Auto Auto -Reusable Function(S9) +Reusable Function(S9) normal @@ -159,7 +129,37 @@ Auto -<S16> +<S10> + + +Auto + + +Reusable Function(S10) + + +normal + + + + + +<S12> + + +Auto + + +Reusable Function(S10) + + +normal + + + + + +<S17> Auto @@ -174,21 +174,6 @@ Inline -<S18> - - -Auto - - -Inline - - -normal - - - - - <S19> @@ -201,10 +186,25 @@ Inline normal + + + +<S20> + + +Auto + + +Inline + + +normal + + -<S21> +<S22> Auto @@ -249,7 +249,7 @@ Inline -<S36> +<S6> Auto @@ -294,7 +294,7 @@ Inline -<S48> +<S39> Auto @@ -309,7 +309,7 @@ Inline -<S44> +<S48> Auto @@ -324,6 +324,21 @@ Inline +<S45> + + +Auto + + +Inline + + +normal + + + + + <S56> diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_survey.html b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_survey.html index 60cee260..f9297ce4 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_survey.html +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/pages/ADM_Integrated_Logic_survey.html @@ -46,7 +46,7 @@ MSI Model Version -13.55 +13.63 @@ -61,7 +61,7 @@ SingleTasking -
+
Configuration settings at time of code generation @@ -112,7 +112,7 @@ Simulink Coder Version Timestamp of Generated Source Code -Wed May 7 21:12:17 2025 +Wed Jun 4 15:25:59 2025 @@ -121,7 +121,7 @@ Wed May 7 21:12:17 2025 Location of Generated Source Code -C:\Users\MSI\SynologyDrive\3min_be\한자연\!과제\배송모빌리티\!진행상황\2025\25-04-28-월 통합 로직 수정본 수신(시뮬링크)\ADM_Integrated_Logic_ert_rtw +C:\Users\MSI\Documents\WorkSpace\git\ADM\[ADM] Integrated Logic\ADM_Integrated_Logic_ert_rtw diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/rtwtypeschksum.mat b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/rtwtypeschksum.mat index 6253b6bb..2df90056 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/rtwtypeschksum.mat and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/rtwtypeschksum.mat differ diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/simulink_cache.xml b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/simulink_cache.xml index d30a2232..5a1f16ec 100644 --- a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/simulink_cache.xml +++ b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/simulink_cache.xml @@ -1,6 +1,6 @@ - - b/4Ocq7cvoJ51L4wOLlW0ejC31fPAd/QR1Oothk33iPDtLnhel5TqHTswG2U6qoh56Kqn3efJ8fo9WGgU+neug== + + En9XcZ0o49C5vm+rHYLGSP71C3yNf0yfPVTPOlyDlZhARWoZmh1dydk5H9qUSK+WVNDE/OO1itXZ3b4fIdhN9A== \ No newline at end of file diff --git a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/tr b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/tr index 92b10456..9c04ff03 100644 Binary files a/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/tr and b/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/tmwinternal/tr differ diff --git a/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.l b/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.l new file mode 100644 index 00000000..a49f3e1e Binary files /dev/null and b/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.l differ diff --git a/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.mat b/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.mat new file mode 100644 index 00000000..b1637f00 Binary files /dev/null and b/[ADM] Integrated Logic/slprj/_jitprj/sblI0IkqxtjdC13UlaNFocH.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/info/binfo.mat b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/info/binfo.mat index 3ec24e9b..e32f0896 100644 Binary files a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/info/binfo.mat and b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/info/binfo.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlc b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlc new file mode 100644 index 00000000..71a5389e --- /dev/null +++ b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlc @@ -0,0 +1,18 @@ +%implements "chartSource" "C" +%function ChartConfig(block, system) void + %createrecord chartConfiguration { ... + executeAtInitialization 0 ... + } + %return chartConfiguration +%endfunction +%function ChartDataMap(block, system) void + %createrecord ChartDataElements {\ + NumChartData 0 \ + ChartDataDefaults {\ + RecordType "ChartData"\ + Dimensions []\ + IsTestPoint 0\ + }\ + } + %return ChartDataElements +%endfunction diff --git a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlh b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlh new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/rtw/ert/src/c19_ADM_Integrated_Logic.tlh @@ -0,0 +1 @@ + diff --git a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/sfun/info/binfo.mat b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/sfun/info/binfo.mat index 2686792f..3f53799c 100644 Binary files a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/sfun/info/binfo.mat and b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/_self/sfun/info/binfo.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/amsi_serial.mat b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/amsi_serial.mat index f4ee87b2..da21be51 100644 Binary files a/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/amsi_serial.mat and b/[ADM] Integrated Logic/slprj/_sfprj/ADM_Integrated_Logic/amsi_serial.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/EMLReport/sblI0IkqxtjdC13UlaNFocH.mat b/[ADM] Integrated Logic/slprj/_sfprj/EMLReport/sblI0IkqxtjdC13UlaNFocH.mat new file mode 100644 index 00000000..acd6ea21 Binary files /dev/null and b/[ADM] Integrated Logic/slprj/_sfprj/EMLReport/sblI0IkqxtjdC13UlaNFocH.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/precompile/nrDt32pFHQ88fJhspvA4AG.mat b/[ADM] Integrated Logic/slprj/_sfprj/precompile/nrDt32pFHQ88fJhspvA4AG.mat new file mode 100644 index 00000000..6bdc14dc Binary files /dev/null and b/[ADM] Integrated Logic/slprj/_sfprj/precompile/nrDt32pFHQ88fJhspvA4AG.mat differ diff --git a/[ADM] Integrated Logic/slprj/_sfprj/precompile/u5GuENm1ynGK41kC83oyfG.mat b/[ADM] Integrated Logic/slprj/_sfprj/precompile/u5GuENm1ynGK41kC83oyfG.mat new file mode 100644 index 00000000..277f2159 Binary files /dev/null and b/[ADM] Integrated Logic/slprj/_sfprj/precompile/u5GuENm1ynGK41kC83oyfG.mat differ diff --git a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/BlockTraceInfo.mat b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/BlockTraceInfo.mat index 29ed0231..04164899 100644 Binary files a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/BlockTraceInfo.mat and b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/BlockTraceInfo.mat differ diff --git a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/CompileInfo.xml b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/CompileInfo.xml index d0100ba8..d5eaf9bb 100644 --- a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/CompileInfo.xml +++ b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/CompileInfo.xml @@ -1,6 +1,6 @@ - + s4X8ZXVS8oDBVwNrFCiCRjE s7aRAkEzMZedSBExDBKXWuB sGqAazc85l6bkHy3ekd3icF @@ -12,27 +12,23 @@ sS5nBgaBemG22eTH9dJ6tL sTzKZ0t1CY4yWEg8I3QIHXE sazfgeuZLE2hj0Yzcg5InOH + sblI0IkqxtjdC13UlaNFocH sbwyRsIcGtxGV1VjtS9aLG sewORjqIgCBTc4P3QEjreuF sjHaSixO4aTSAxlu2wTQB7G stCZb9XcGX5Y1I7UZZxRZzD - + [{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""},{"Name":"","Profile":""}] ADM_Integrated_Logic - [{"Name":"GV_MCU_RPM","Profile":""},{"Name":"GV_BrakeTorqueCommand","Profile":""},{"Name":"GV_IMU_AX_Val","Profile":""},{"Name":"GV_IMU_AY_Val","Profile":""},{"Name":"GV_IMU_AZ_Val","Profile":""},{"Name":"GV_IMU_PitchRtVal","Profile":""},{"Name":"GV_Vx_Command","Profile":""},{"Name":"GV_VCU_GearSelStat","Profile":""},{"Name":"GV_MCU_EstTrq","Profile":""},{"Name":"GV_Vx_Limit","Profile":""},{"Name":"GV_Vx_Fbk","Profile":""},{"Name":"GV_RWA_RackAngleCommand","Profile":""},{"Name":"GV_RWA_Fault_Flag","Profile":""},{"Name":"GV_Operation_Mode","Profile":""},{"Name":"GV_RWS_RackAngleCommand","Profile":""},{"Name":"GV_Brake_Command","Profile":""},{"Name":"GV_Master_Rack_Angle_Cmd","Profile":""},{"Name":"GV_Hill_Torque_Assist","Profile":""},{"Name":"GV_Motor_Torque_Cmd","Profile":""},{"Name":"Debug_HAC_FLAG","Profile":""},{"Name":"Debug_HAC_RPM_Decision","Profile":""},{"Name":"Debug_HAC_Pitch_angle","Profile":""},{"Name":"Debug_HAC_Brake_Output","Profile":""},{"Name":"Debug_CC_Brake_Output","Profile":""},{"Name":"GV_RWS_RackAngleCmd1","Profile":""},{"Name":"GV_Speed_Limit","Profile":""},{"Name":"GV_Gear_Postion_Out","Profile":""}] + [{"Name":"GV_MCU_RPM","Profile":""},{"Name":"GV_BrakeTorqueCommand","Profile":""},{"Name":"GV_IMU_AX_Val","Profile":""},{"Name":"GV_IMU_AY_Val","Profile":""},{"Name":"GV_IMU_AZ_Val","Profile":""},{"Name":"GV_IMU_PitchRtVal","Profile":""},{"Name":"GV_Vx_Command","Profile":""},{"Name":"GV_VCU_GearSelStat","Profile":""},{"Name":"GV_MCU_EstTrq","Profile":""},{"Name":"GV_Vx_Limit","Profile":""},{"Name":"GV_Vx_Fbk","Profile":""},{"Name":"GV_RWA_RackAngleCommand","Profile":""},{"Name":"GV_RWS_RackAngleCommand","Profile":""},{"Name":"GV_RWA_Fault_Flag","Profile":""},{"Name":"GV_Operation_Mode","Profile":""},{"Name":"GV_Brake_Command","Profile":""},{"Name":"GV_Master_Rack_Angle_Cmd","Profile":""},{"Name":"GV_Hill_Torque_Assist","Profile":""},{"Name":"GV_Motor_Torque_Cmd","Profile":""},{"Name":"Debug_HAC_FLAG","Profile":""},{"Name":"Debug_HAC_RPM_Decision","Profile":""},{"Name":"Debug_HAC_Pitch_angle","Profile":""},{"Name":"Debug_HAC_Brake_Output","Profile":""},{"Name":"Debug_CC_Brake_Output","Profile":""},{"Name":"GV_RWS_RackAngleCmd1","Profile":""},{"Name":"GV_Speed_Limit","Profile":""},{"Name":"GV_Gear_Postion_Out","Profile":""}] - + ADM_Integrated_Logic ADM_Integrated_Logic - - 1 - 1.0 - DeducedFromSampleTime - inf - - + + true base workspace BaseWorkspace @@ -55,7 +51,7 @@ true true true - + true inf -inf @@ -68,10 +64,10 @@ 0 - - + + - + true inf -inf @@ -85,10 +81,10 @@ 0 - - + + - + true inf -inf @@ -102,10 +98,10 @@ 0 - - + + - + true inf -inf @@ -119,10 +115,10 @@ 0 - - + + - + true inf -inf @@ -136,10 +132,10 @@ 0 - - + + - + true inf -inf @@ -153,10 +149,10 @@ 0 - - + + - + true inf -inf @@ -170,10 +166,10 @@ 0 - - + + - + true inf -inf @@ -187,10 +183,10 @@ 0 - - + + - + true inf -inf @@ -204,10 +200,10 @@ 0 - - + + - + true inf -inf @@ -221,10 +217,10 @@ 0 - - + + - + true inf -inf @@ -238,10 +234,10 @@ 0 - - + + - + true inf -inf @@ -255,10 +251,10 @@ 0 - - + + - + true inf -inf @@ -272,10 +268,10 @@ 0 - - + + - + false true inf @@ -290,10 +286,10 @@ 0 - - + + - + true inf -inf @@ -307,8 +303,8 @@ 0 - - + + false true @@ -341,8 +337,6 @@ false 6 -1.0 - true - true 42 15 42 @@ -386,7 +380,7 @@ - + inf -inf @@ -397,10 +391,10 @@ 0 - - + + - + inf -inf 1 @@ -412,10 +406,10 @@ 0 - - + + - + inf -inf 2 @@ -427,10 +421,10 @@ 0 - - + + - + inf -inf 3 @@ -442,10 +436,10 @@ 0 - - + + - + inf -inf 4 @@ -457,10 +451,10 @@ 0 - - + + - + true inf -inf @@ -473,10 +467,10 @@ 0 - - + + - + inf -inf 6 @@ -488,10 +482,10 @@ 0 - - + + - + inf -inf 7 @@ -503,10 +497,10 @@ 0 - - + + - + inf -inf 8 @@ -518,10 +512,10 @@ 0 - - + + - + inf -inf 9 @@ -533,10 +527,10 @@ 0 - - + + - + true true inf @@ -550,10 +544,10 @@ -2147483648 - - + + - + inf -inf 11 @@ -565,8 +559,8 @@ 0 - - + + true @@ -576,73 +570,53 @@ 40 0 - - true - true - D1 - 1.0 - 40 - 1 - 2 323 <?xml version="1.0"?> <slexec_sto version="1.1" packageUris="http://schema.mathworks.com/mf0/slexec_mm_sto/R2024a_202305081229"> - <sto.Registry type="sto.Registry" uuid="a99bf6a0-2fb6-4e47-aa53-b413767338c1"> + <sto.Registry type="sto.Registry" uuid="d98a7b34-791e-40d2-bd18-94af78be784b"> <executionSpec>Undetermined</executionSpec> <identifier>ADM_Integrated_Logic</identifier> - <clockRegistry type="sto.ClockRegistry" uuid="0dee3d15-77d8-4f6f-b2b4-03ecc5fda46b"> - <clocks type="sto.Timer" uuid="a9cbe90e-c24f-4cc1-a448-1d590af8d792"> + <clockRegistry type="sto.ClockRegistry" uuid="c208dafa-24eb-47f5-9051-1dbe7e0da60b"> + <clocks type="sto.Timer" uuid="b5852aa5-852b-47c2-86c6-9381514ebad2"> <computedFundamentalDiscretePeriod>.002</computedFundamentalDiscretePeriod> - <fastestDiscreteRate type="sto.ClassicPeriodicDiscreteRate" uuid="b86cb183-9fae-4af4-a6a6-a86cc55ae215"/> + <fastestDiscreteRate type="sto.ClassicPeriodicDiscreteRate" uuid="77e09546-2aba-4929-8404-7eb20f0b8a7a"/> <isDefaultTimer>true</isDefaultTimer> <resolution>.002</resolution> <timeAdvanceMode>FixedStep</timeAdvanceMode> <identifier>ADM_Integrated_Logic::defaultTimer</identifier> - <rates type="sto.ClassicPeriodicDiscreteRate" uuid="b86cb183-9fae-4af4-a6a6-a86cc55ae215"> + <rates type="sto.ClassicPeriodicDiscreteRate" uuid="77e09546-2aba-4929-8404-7eb20f0b8a7a"> <annotation>D1</annotation> <clockId>ADM_Integrated_Logic::defaultTimer</clockId> <description>Discrete 1</description> <taskId>_task0</taskId> - <rateSpec type="sto.RateSpec" uuid="aaf9c4be-d1af-4575-b198-ef8e2e28f77c"> + <rateSpec type="sto.RateSpec" uuid="a6fe144e-9c77-44a1-b1ad-1cf642e7e108"> <period>.002</period> <rateType>ClassicPeriodicDiscrete</rateType> </rateSpec> </rates> - <rates type="sto.ClassicPeriodicDiscreteRate" uuid="2ca0c062-2046-4376-b382-08d68d4d08f1"> - <annotation>D2</annotation> - <clockId>ADM_Integrated_Logic::defaultTimer</clockId> - <colorIndex>1</colorIndex> - <description>Discrete 2</description> - <rateIdx>1</rateIdx> - <taskId>_task0</taskId> - <rateSpec type="sto.RateSpec" uuid="bffc88d5-9a4a-4df1-81a9-5d974d0e172e"> - <period>1.0</period> - <rateType>ClassicPeriodicDiscrete</rateType> - </rateSpec> - </rates> - <baseRate type="sto.ClassicPeriodicDiscreteRate" uuid="07957154-9470-4f03-8175-346d08966a28"> + <baseRate type="sto.ClassicPeriodicDiscreteRate" uuid="4a6a0b82-3938-4f8b-8efd-d60cf8ab9d1e"> <annotation>D1</annotation> <clockId>ADM_Integrated_Logic::defaultTimer</clockId> <description>Discrete 1</description> <taskId>_task0</taskId> - <rateSpec type="sto.RateSpec" uuid="3b74959a-c9a5-45aa-87cb-22ab20cd4250"> + <rateSpec type="sto.RateSpec" uuid="55704f94-f5c5-492d-819f-bb44cbe8f9d1"> <period>.002</period> <rateType>ClassicPeriodicDiscrete</rateType> </rateSpec> </baseRate> </clocks> - <clocks type="sto.Event" uuid="a813f83e-0a61-41a8-9755-13e83ce0c434"> + <clocks type="sto.Event" uuid="3c0612bc-439a-4d85-806a-927e3d1c1f81"> <eventType>PARAMETER_CHANGE_EVENT</eventType> <cNum>1</cNum> <clockType>Event</clockType> <identifier>ParameterChangeEvent</identifier> - <rates type="sto.ModelWideEventRate" uuid="3b6fd153-4f1a-4558-b5c1-9d99a2e4da49"> + <rates type="sto.ModelWideEventRate" uuid="2443a0dc-abbd-40cd-85a3-8be66d277022"> <clockId>ParameterChangeEvent</clockId> <rateIdx>-1</rateIdx> <taskId>ModelWideParameterChangeEvent</taskId> <useForExecution>NotForExecution</useForExecution> - <rateSpec type="sto.RateSpec" uuid="7e4d0ae2-cf60-4ac6-83a0-d1d7b019536f"> + <rateSpec type="sto.RateSpec" uuid="7aa39d98-ea44-49b5-8428-96c70d931a16"> <period>inf</period> <rateType>ModelWideParameterChangeEvent</rateType> </rateSpec> @@ -650,15 +624,15 @@ </clocks> <timeAdvanceMode>FixedStep</timeAdvanceMode> </clockRegistry> - <taskRegistry type="sto.TaskRegistry" uuid="95399263-7fa0-4b84-8e0d-f876a886187f"> - <rootTaskHierarchyElements type="sto.Task" uuid="09eca933-eafa-4dbe-a0b0-125fc1040d60"> + <taskRegistry type="sto.TaskRegistry" uuid="aa247c8c-1a2b-420b-9b43-c19ad2578bb9"> + <rootTaskHierarchyElements type="sto.Task" uuid="4a693ebd-bfc9-4b76-80bc-a0a4421a7246"> <isExplicit>true</isExplicit> - <rates type="sto.ModelWideEventRate" uuid="19bdbdea-0b0a-4b2d-89e7-06e3a8bfe29c"> + <rates type="sto.ModelWideEventRate" uuid="f3b2db74-81e4-4bb0-8432-eefe5a0ac0c1"> <clockId>ParameterChangeEvent</clockId> <rateIdx>-1</rateIdx> <taskId>ModelWideParameterChangeEvent</taskId> <useForExecution>NotForExecution</useForExecution> - <rateSpec type="sto.RateSpec" uuid="ed0512c7-8787-4d10-a745-4230c5d0475e"> + <rateSpec type="sto.RateSpec" uuid="573e186c-11bd-452f-8f9c-584a7bef0c3c"> <period>inf</period> <rateType>ModelWideParameterChangeEvent</rateType> </rateSpec> @@ -669,42 +643,30 @@ <identifier>ModelWideParameterChangeEvent</identifier> <priority>-1</priority> </rootTaskHierarchyElements> - <rootTaskHierarchyElements type="sto.Task" uuid="7221b9e3-9d11-4daf-9a45-cd086e372d0b"> + <rootTaskHierarchyElements type="sto.Task" uuid="e6e1e3aa-0d80-4eaa-9344-7aee144b5e57"> <isExecutable>true</isExecutable> <orderIndex>1</orderIndex> - <rates type="sto.ClassicPeriodicDiscreteRate" uuid="551675eb-25a7-4aa8-8f65-77b39c317924"> + <rates type="sto.ClassicPeriodicDiscreteRate" uuid="be007f3d-6ead-427f-a713-f1b6287099f1"> <annotation>D1</annotation> <clockId>ADM_Integrated_Logic::defaultTimer</clockId> <description>Discrete 1</description> <taskId>_task0</taskId> - <rateSpec type="sto.RateSpec" uuid="c483f807-bae8-48ef-bcaf-2c23d4c9a6cc"> + <rateSpec type="sto.RateSpec" uuid="82a27740-07a1-4477-815d-46fb33aa2e7f"> <period>.002</period> <rateType>ClassicPeriodicDiscrete</rateType> </rateSpec> </rates> - <rates type="sto.ClassicPeriodicDiscreteRate" uuid="a932c599-ab07-4ddf-bb91-0854fe22a2e7"> - <annotation>D2</annotation> - <clockId>ADM_Integrated_Logic::defaultTimer</clockId> - <colorIndex>1</colorIndex> - <description>Discrete 2</description> - <rateIdx>1</rateIdx> - <taskId>_task0</taskId> - <rateSpec type="sto.RateSpec" uuid="991fc93c-bd11-482f-b941-6a63de91589c"> - <period>1.0</period> - <rateType>ClassicPeriodicDiscrete</rateType> - </rateSpec> - </rates> <schedulingClockId>ADM_Integrated_Logic::defaultTimer</schedulingClockId> <timeKeeperClockId>ADM_Integrated_Logic::defaultTimer</timeKeeperClockId> <elementType>Task</elementType> <identifier>_task0</identifier> <priority>40</priority> </rootTaskHierarchyElements> - <taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="21777a8d-0c80-4f52-a258-33ae0b4263a9"> + <taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="f331c78d-3e3a-403c-8517-325569d5c950"> <clockIdentifier>ADM_Integrated_Logic::defaultTimer</clockIdentifier> <taskIdentifier>_task0</taskIdentifier> </taskDependencyGraph> - <taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="4731a8d3-ac77-4165-8d45-7c7c77d46c5d"> + <taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="1d5f7c23-cdb9-4646-9538-209ff4b608c0"> <clockIdentifier>ParameterChangeEvent</clockIdentifier> <taskIdentifier>ModelWideParameterChangeEvent</taskIdentifier> </taskDependencyGraph> @@ -714,10 +676,10 @@ </slexec_sto> .002 true - - - - + + + + true .002 2 @@ -728,7 +690,7 @@ FixedStepDiscrete SOLVER_TYPE_FIXEDSTEP 2 - + 8 64 32 @@ -747,9 +709,9 @@ 32 - - - + + + 0 1 2 @@ -805,186 +767,186 @@ 10 11 - + 10 - - - - + + + + 10 - - - - - - + + + + + + - - - - - + + + + + 1.0 .002 0.0 GV_MCU_RPM - + 1.0 .002 0.0 GV_BrakeTorqueCommand - + 1.0 .002 0.0 GV_IMU_AX_Val - + 1.0 .002 0.0 GV_IMU_AY_Val - + 1.0 .002 0.0 GV_IMU_AZ_Val - + 1.0 .002 0.0 GV_IMU_PitchRtVal - + 1.0 .002 0.0 GV_Vx_Command - + 1.0 .002 0.0 GV_VCU_GearSelStat - + 1.0 .002 0.0 GV_MCU_EstTrq - + 1.0 .002 0.0 GV_Vx_Limit - + 1.0 .002 0.0 GV_Vx_Fbk - + 1.0 .002 0.0 GV_RWA_RackAngleCommand - + 1.0 .002 0.0 GV_RWS_RackAngleCommand - + 1.0 .002 0.0 GV_RWA_Fault_Flag - + 1.0 .002 0.0 GV_Operation_Mode ADM_Integrated_Logic - + 1.0 .002 0.0 GV_Brake_Command - + 1.0 .002 0.0 GV_Master_Rack_Angle_Cmd - + 1.0 .002 0.0 GV_Hill_Torque_Assist - + 1.0 .002 0.0 GV_Motor_Torque_Cmd - + 1.0 .002 0.0 Debug_HAC_FLAG - + 1.0 .002 0.0 Debug_HAC_RPM_Decision - + 1.0 .002 0.0 Debug_HAC_Pitch_angle - + 1.0 .002 0.0 Debug_HAC_Brake_Output - + 1.0 .002 0.0 Debug_CC_Brake_Output - + 1.0 .002 0.0 GV_RWS_RackAngleCmd1 - + 1.0 inf 0.0 GV_Speed_Limit - + 1.0 .002 0.0 @@ -993,7 +955,7 @@ ROOT - + @@ -1144,33 +1106,23 @@ 0 - - D2 - 986198527 - true - 1 - - 1.0 - - 1 - - - - + + + sltpEvents - + sltpTaskGroups - - - + + + D1 - + ADM_Integrated_Logic::defaultTimer _task0 @@ -1179,6 +1131,6 @@ sltpTasks - + \ No newline at end of file diff --git a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/binfo.mat b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/binfo.mat index 98ca8235..2f007ef3 100644 Binary files a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/binfo.mat and b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/binfo.mat differ diff --git a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/minfo.mat b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/minfo.mat index 570b0f48..8ab3033d 100644 Binary files a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/minfo.mat and b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/minfo.mat differ diff --git a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/scv b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/scv index c5333c27..1913da63 100644 Binary files a/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/scv and b/[ADM] Integrated Logic/slprj/ert/ADM_Integrated_Logic/tmwinternal/scv differ diff --git a/[ADM] Integrated Logic/slprj/ert/_sharedutils/shared_file.dmr b/[ADM] Integrated Logic/slprj/ert/_sharedutils/shared_file.dmr index c1890a36..584df6f6 100644 Binary files a/[ADM] Integrated Logic/slprj/ert/_sharedutils/shared_file.dmr and b/[ADM] Integrated Logic/slprj/ert/_sharedutils/shared_file.dmr differ