ADM/[ADM] Integrated Logic/ADM_Integrated_Logic_ert_rtw/html/data/data.js

1 line
76 KiB
JavaScript

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 <stddef.h>\r\n#include <stdio.h> /* 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 <stdint.h>\r\n#include \"ADM_Integrated_Logic_private.h\"\r\n#include <math.h>\r\n#include <stdbool.h>\r\n\r\n/* Named constants for Chart: '<S8>/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 * '<S40>/Calculate_F_c'\r\n * '<S40>/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 * '<S1>/MATLAB Function1'\r\n * '<S1>/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 * '<S1>/MATLAB Function2'\r\n * '<S1>/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: '<S2>/Compare' incorporates:\r\n * Constant: '<S2>/Constant'\r\n * Inport: '<Root>/GV_Operation_Mode'\r\n */\r\n rtb_Compare = (ADM_Integrated_Logic_U.GV_Operation_Mode == 2.0);\r\n\r\n /* Product: '<S46>/delta rise limit' incorporates:\r\n * Constant: '<S8>/Upper_Torq'\r\n * SampleTimeMath: '<S46>/sample time'\r\n *\r\n * About '<S46>/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: '<S47>/Delay Input2'\r\n *\r\n * Block description for '<S47>/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: '<S47>/delta rise limit' incorporates:\r\n * SampleTimeMath: '<S47>/sample time'\r\n *\r\n * About '<S47>/sample time':\r\n * y = K where K = ( w * Ts )\r\n * */\r\n rtb_Integrator_1 = 0.002;\r\n\r\n /* Saturate: '<S8>/Pitch_Saturation' incorporates:\r\n * DiscreteIntegrator: '<S8>/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: '<S47>/Difference Inputs1' incorporates:\r\n * Saturate: '<S8>/Pitch_Saturation'\r\n *\r\n * Block description for '<S47>/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: '<S52>/Switch2' incorporates:\r\n * RelationalOperator: '<S52>/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.002) {\r\n /* Switch: '<S52>/Switch' incorporates:\r\n * RelationalOperator: '<S52>/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: '<S52>/Switch' */\r\n }\r\n\r\n /* End of Switch: '<S52>/Switch2' */\r\n\r\n /* Sum: '<S47>/Difference Inputs2'\r\n *\r\n * Block description for '<S47>/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: '<S40>/Calculate_F_c' incorporates:\r\n * Gain: '<S40>/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: '<S40>/Gain2' incorporates:\r\n * Constant: '<S40>/Radius'\r\n * Product: '<S40>/Multiply3'\r\n * Sum: '<S40>/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: '<S40>/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: '<S46>/Difference Inputs1' incorporates:\r\n * Saturate: '<S40>/Saturation'\r\n * UnitDelay: '<S46>/Delay Input2'\r\n *\r\n * Block description for '<S46>/Difference Inputs1':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '<S46>/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: '<S51>/Switch2' incorporates:\r\n * RelationalOperator: '<S51>/LowerRelop1'\r\n */\r\n if (rtb_UkYk1 <= 0.016) {\r\n /* Switch: '<S51>/Switch' incorporates:\r\n * RelationalOperator: '<S51>/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: '<S51>/Switch' */\r\n }\r\n\r\n /* End of Switch: '<S51>/Switch2' */\r\n\r\n /* Sum: '<S46>/Difference Inputs2' incorporates:\r\n * UnitDelay: '<S46>/Delay Input2'\r\n *\r\n * Block description for '<S46>/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n *\r\n * Block description for '<S46>/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: '<S8>/Grade_GAIN' */\r\n rtb_Desired_Torque = 0.8 * rtb_UkYk1;\r\n\r\n /* MATLAB Function: '<S15>/Vx_OutPut_Function' incorporates:\r\n * Constant: '<S55>/Constant'\r\n * Inport: '<Root>/GV_BrakeTorqueCommand'\r\n * Inport: '<Root>/GV_Vx_Command'\r\n * Inport: '<Root>/GV_Vx_Limit'\r\n * RelationalOperator: '<S55>/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: '<S15>/Vx_OutPut_Function' */\r\n\r\n /* RateLimiter: '<S1>/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: '<S1>/Input_Vx_RateLimiter' */\r\n\r\n /* RelationalOperator: '<S36>/Compare' incorporates:\r\n * Constant: '<S36>/Constant'\r\n * Inport: '<Root>/GV_BrakeTorqueCommand'\r\n */\r\n rtb_Compare_d = (ADM_Integrated_Logic_U.GV_BrakeTorqueCommand >= 100.0);\r\n\r\n /* Delay: '<S7>/Memory' */\r\n rtb_deltafalllimit_m = ADM_Integrated_Logic_DW.Memory_DSTATE;\r\n\r\n /* MATLAB Function: '<S7>/Gear_FUNCTION1' incorporates:\r\n * Inport: '<Root>/GV_VCU_GearSelStat'\r\n * Inport: '<Root>/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: '<S7>/Gear_FUNCTION1' */\r\n\r\n /* Chart: '<S8>/Chart' incorporates:\r\n * Constant: '<S8>/Constant'\r\n * Constant: '<S8>/Constant1'\r\n * Inport: '<Root>/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: '<Root>/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: '<Root>/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: '<S8>/Chart' */\r\n\r\n /* MATLAB Function: '<S8>/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: '<Root>/Debug_HAC_FLAG' incorporates:\r\n * MATLAB Function: '<S8>/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: '<S8>/HAC_OFF_OK_Func' incorporates:\r\n * Constant: '<S8>/Accel_Cmd '\r\n * Constant: '<S8>/Brake_Cmd'\r\n * Constant: '<S8>/Gear_D'\r\n * Inport: '<Root>/GV_BrakeTorqueCommand'\r\n * Inport: '<Root>/GV_MCU_EstTrq'\r\n * Outport: '<Root>/Debug_HAC_RPM_Decision'\r\n * RelationalOperator: '<S8>/Relational Operator'\r\n * RelationalOperator: '<S8>/Relational Operator1'\r\n * RelationalOperator: '<S8>/Relational Operator2'\r\n * Sum: '<S8>/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: '<Root>/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: '<Root>/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: '<S3>/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: '<S3>/GearCondition_Brake' */\r\n\r\n /* Gain: '<S3>/Brake_GAIN' incorporates:\r\n * DiscreteTransferFcn: '<S1>/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: '<S3>/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: '<S3>/Multiply2' incorporates:\r\n * Saturate: '<S3>/Saturation'\r\n */\r\n rtb_Integrator_1 *= rtb_output_a;\r\n\r\n /* RateLimiter: '<S3>/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: '<S3>/Brake_Out_RateLimiter' */\r\n\r\n /* Saturate: '<S3>/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: '<S3>/Brake_Saturation' */\r\n\r\n /* MATLAB Function: '<S1>/Emergency_Brake_Func' incorporates:\r\n * Inport: '<Root>/GV_Vx_Fbk'\r\n * Sum: '<S1>/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: '<S1>/Emergency_Brake_Func' */\r\n\r\n /* Saturate: '<S1>/Brake_Saturation' */\r\n if (rtb_output_a > 1500.0) {\r\n /* Outport: '<Root>/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: '<Root>/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = 0.0;\r\n } else {\r\n /* Outport: '<Root>/GV_Brake_Command' */\r\n ADM_Integrated_Logic_Y.GV_Brake_Command = rtb_output_a;\r\n }\r\n\r\n /* End of Saturate: '<S1>/Brake_Saturation' */\r\n\r\n /* Outport: '<Root>/Debug_CC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_CC_Brake_Output = rtb_Integrator_1;\r\n\r\n /* Outport: '<Root>/Debug_HAC_Brake_Output' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Brake_Output = rtb_Brake_Torque_Cmd;\r\n\r\n /* MATLAB Function: '<S3>/Gear_pos_out' incorporates:\r\n * MATLAB Function: '<S3>/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: '<S3>/Gear_pos_out' */\r\n\r\n /* MATLAB Function: '<S3>/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: '<S3>/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: '<S3>/TargetSpd_RateLimiter' */\r\n\r\n /* Product: '<S21>/Product1' incorporates:\r\n * Constant: '<S21>/Constant'\r\n * Gain: '<S21>/gain'\r\n * Product: '<S21>/Product11'\r\n * Sum: '<S21>/Sum1'\r\n * Sum: '<S21>/Sum2'\r\n * Sum: '<S21>/Sum3'\r\n * Sum: '<S21>/Sum4'\r\n * UnitDelay: '<S21>/d'\r\n * UnitDelay: '<S21>/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: '<S31>/Sum1' incorporates:\r\n * Gain: '<S31>/gain'\r\n * Sum: '<S31>/Sum2'\r\n * UnitDelay: '<S31>/d'\r\n * UnitDelay: '<S31>/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: '<S32>/Sum1' incorporates:\r\n * Gain: '<S32>/gain'\r\n * Sum: '<S32>/Sum2'\r\n * UnitDelay: '<S32>/d'\r\n * UnitDelay: '<S32>/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: '<S33>/Sum1' incorporates:\r\n * Gain: '<S33>/gain'\r\n * Sum: '<S33>/Sum2'\r\n * UnitDelay: '<S33>/d'\r\n * UnitDelay: '<S33>/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: '<S29>/Gain' incorporates:\r\n * Constant: '<S29>/Constant3'\r\n * Constant: '<S29>/Constant4'\r\n * Constant: '<S29>/Constant5'\r\n * Product: '<S29>/Product'\r\n * Product: '<S29>/Product1'\r\n * Product: '<S29>/Product2'\r\n * Sum: '<S29>/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: '<S35>/Product1' incorporates:\r\n * Constant: '<S35>/Constant1'\r\n * Constant: '<S35>/Constant2'\r\n * Delay: '<S35>/Delay'\r\n * Delay: '<S35>/Delay1'\r\n * Delay: '<S35>/Delay2'\r\n * Delay: '<S35>/Delay3'\r\n * Gain: '<S35>/gain1'\r\n * Gain: '<S35>/gain3'\r\n * Product: '<S35>/x(n), x(n-1), x(n-2)'\r\n * Product: '<S35>/y(n-1)'\r\n * Product: '<S35>/y(n-2)'\r\n * Sum: '<S35>/Sum1'\r\n * Sum: '<S35>/Sum2'\r\n * Sum: '<S35>/Sum3'\r\n * Sum: '<S35>/Sum4'\r\n * Sum: '<S35>/Sum5'\r\n * Sum: '<S35>/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: '<S34>/Product1' incorporates:\r\n * Constant: '<S34>/Constant'\r\n * Gain: '<S34>/gain'\r\n * Product: '<S34>/Product11'\r\n * Sum: '<S34>/Sum1'\r\n * Sum: '<S34>/Sum2'\r\n * Sum: '<S34>/Sum3'\r\n * Sum: '<S34>/Sum4'\r\n * UnitDelay: '<S34>/d'\r\n * UnitDelay: '<S34>/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: '<S3>/Subtract' incorporates:\r\n * Inport: '<Root>/GV_MCU_RPM'\r\n * MultiPortSwitch: '<S28>/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: '<S3>/Error_Saturation' incorporates:\r\n * MultiPortSwitch: '<S28>/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: '<S3>/Error_Saturation' */\r\n\r\n /* DeadZone: '<S18>/Dead Zone' incorporates:\r\n * MultiPortSwitch: '<S28>/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: '<S23>/Sum1' incorporates:\r\n * Gain: '<S23>/gain'\r\n * Sum: '<S23>/Sum2'\r\n * UnitDelay: '<S23>/d'\r\n * UnitDelay: '<S23>/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: '<S24>/Sum1' incorporates:\r\n * Gain: '<S24>/gain'\r\n * Sum: '<S24>/Sum2'\r\n * UnitDelay: '<S24>/d'\r\n * UnitDelay: '<S24>/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: '<S25>/Sum1' incorporates:\r\n * Gain: '<S25>/gain'\r\n * Sum: '<S25>/Sum2'\r\n * UnitDelay: '<S25>/d'\r\n * UnitDelay: '<S25>/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: '<S16>/Add3' incorporates:\r\n * Constant: '<S16>/Constant3'\r\n * Constant: '<S16>/Constant4'\r\n * Constant: '<S16>/Constant5'\r\n * Gain: '<S16>/Gain'\r\n * Memory: '<S3>/Memory'\r\n * Product: '<S16>/Product2'\r\n * Product: '<S16>/Product3'\r\n * Product: '<S16>/Product4'\r\n * Sum: '<S16>/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: '<S26>/Product1' incorporates:\r\n * Constant: '<S26>/Constant'\r\n * Gain: '<S26>/gain'\r\n * Product: '<S26>/Product11'\r\n * Sum: '<S26>/Sum1'\r\n * Sum: '<S26>/Sum2'\r\n * Sum: '<S26>/Sum3'\r\n * Sum: '<S26>/Sum4'\r\n * UnitDelay: '<S26>/d'\r\n * UnitDelay: '<S26>/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: '<S27>/Product1' incorporates:\r\n * Constant: '<S27>/Constant1'\r\n * Constant: '<S27>/Constant2'\r\n * Delay: '<S27>/Delay'\r\n * Delay: '<S27>/Delay1'\r\n * Delay: '<S27>/Delay2'\r\n * Delay: '<S27>/Delay3'\r\n * Gain: '<S27>/gain1'\r\n * Gain: '<S27>/gain3'\r\n * Product: '<S27>/x(n), x(n-1), x(n-2)'\r\n * Product: '<S27>/y(n-1)'\r\n * Product: '<S27>/y(n-2)'\r\n * Sum: '<S27>/Sum1'\r\n * Sum: '<S27>/Sum2'\r\n * Sum: '<S27>/Sum3'\r\n * Sum: '<S27>/Sum4'\r\n * Sum: '<S27>/Sum5'\r\n * Sum: '<S27>/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: '<S3>/DOB_Gain' incorporates:\r\n * Inport: '<Root>/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: '<S3>/DOB_Gain' */\r\n\r\n /* Product: '<S3>/Product1' incorporates:\r\n * Constant: '<S3>/DOBFlag'\r\n * Product: '<S3>/Product'\r\n */\r\n rtb_Integrator_1 = -(rtb_Product1_iz * 0.9);\r\n\r\n /* Saturate: '<S3>/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: '<S3>/Subtract2' incorporates:\r\n * DeadZone: '<S18>/Dead Zone'\r\n * MultiPortSwitch: '<S28>/Multiport Switch1'\r\n * Product: '<S30>/Product'\r\n * Product: '<S3>/Multiply1'\r\n * Saturate: '<S3>/DOB_Saturation'\r\n * Sum: '<S18>/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: '<S3>/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: '<S3>/Torq_Saturation' */\r\n\r\n /* MATLAB Function: '<S1>/Emergency_Motor_Func' */\r\n /* : if Emergency_Flag == 1 */\r\n if (rtb_Compare) {\r\n /* Outport: '<Root>/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: '<Root>/GV_Motor_Torque_Cmd' incorporates:\r\n * Product: '<S3>/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: '<S1>/Emergency_Motor_Func' */\r\n\r\n /* Outport: '<Root>/GV_Gear_Postion_Out' */\r\n ADM_Integrated_Logic_Y.GV_Gear_Postion_Out = rtb_deltafalllimit_m;\r\n\r\n /* Sum: '<S1>/Add2' incorporates:\r\n * Inport: '<Root>/GV_Vx_Fbk'\r\n */\r\n rtb_Vx_Cmd_R -= ADM_Integrated_Logic_U.GV_Vx_Fbk;\r\n\r\n /* Outport: '<Root>/GV_Hill_Torque_Assist' */\r\n ADM_Integrated_Logic_Y.GV_Hill_Torque_Assist = rtb_Desired_Torque;\r\n\r\n /* Outport: '<Root>/Debug_HAC_Pitch_angle' */\r\n ADM_Integrated_Logic_Y.Debug_HAC_Pitch_angle = rtb_Yk1_e;\r\n\r\n /* MATLAB Function: '<S40>/Calculate_F_c1' incorporates:\r\n * Gain: '<S40>/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: '<S41>/Product1' incorporates:\r\n * Constant: '<S41>/Constant'\r\n * Gain: '<S41>/gain'\r\n * Inport: '<Root>/GV_IMU_AX_Val'\r\n * Product: '<S41>/Product11'\r\n * Sum: '<S41>/Sum1'\r\n * Sum: '<S41>/Sum2'\r\n * Sum: '<S41>/Sum3'\r\n * Sum: '<S41>/Sum4'\r\n * UnitDelay: '<S41>/d'\r\n * UnitDelay: '<S41>/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: '<S42>/Product1' incorporates:\r\n * Constant: '<S42>/Constant'\r\n * Gain: '<S42>/gain'\r\n * Inport: '<Root>/GV_IMU_AY_Val'\r\n * Product: '<S42>/Product11'\r\n * Sum: '<S42>/Sum1'\r\n * Sum: '<S42>/Sum2'\r\n * Sum: '<S42>/Sum3'\r\n * Sum: '<S42>/Sum4'\r\n * UnitDelay: '<S42>/d'\r\n * UnitDelay: '<S42>/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: '<S43>/Product1' incorporates:\r\n * Constant: '<S43>/Constant'\r\n * Gain: '<S43>/gain'\r\n * Inport: '<Root>/GV_IMU_AZ_Val'\r\n * Product: '<S43>/Product11'\r\n * Sum: '<S43>/Sum1'\r\n * Sum: '<S43>/Sum2'\r\n * Sum: '<S43>/Sum3'\r\n * Sum: '<S43>/Sum4'\r\n * UnitDelay: '<S43>/d'\r\n * UnitDelay: '<S43>/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: '<S8>/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: '<S8>/Sum' incorporates:\r\n * DiscreteIntegrator: '<S8>/Integrator_2'\r\n * MATLAB Function: '<S8>/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: '<S44>/Product1' incorporates:\r\n * Constant: '<S44>/Constant'\r\n * Gain: '<S44>/gain'\r\n * Inport: '<Root>/GV_IMU_PitchRtVal'\r\n * Product: '<S44>/Product11'\r\n * Sum: '<S44>/Sum1'\r\n * Sum: '<S44>/Sum2'\r\n * Sum: '<S44>/Sum3'\r\n * Sum: '<S44>/Sum4'\r\n * UnitDelay: '<S44>/d'\r\n * UnitDelay: '<S44>/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: '<S1>/Add1' incorporates:\r\n * Constant: '<S1>/Constant'\r\n * Gain: '<S1>/Gain1'\r\n * Inport: '<Root>/GV_Vx_Fbk'\r\n * Sum: '<S1>/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: '<S1>/MATLAB Function1' incorporates:\r\n * Sum: '<S1>/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '<S13>/delta rise limit' incorporates:\r\n * SampleTimeMath: '<S13>/sample time'\r\n *\r\n * About '<S13>/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: '<S13>/Delay Input2'\r\n *\r\n * Block description for '<S13>/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: '<S13>/Difference Inputs1' incorporates:\r\n * Inport: '<Root>/GV_RWA_RackAngleCommand'\r\n *\r\n * Block description for '<S13>/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: '<S1>/MATLAB Function2' incorporates:\r\n * Gain: '<S1>/Gain3'\r\n * Sum: '<S1>/Add1'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '<S53>/Switch2' incorporates:\r\n * RelationalOperator: '<S53>/LowerRelop1'\r\n */\r\n if (rtb_UkYk1_j <= rtb_Switch2) {\r\n /* Product: '<S13>/delta fall limit' incorporates:\r\n * SampleTimeMath: '<S13>/sample time'\r\n *\r\n * About '<S13>/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: '<S53>/Switch' incorporates:\r\n * RelationalOperator: '<S53>/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: '<S53>/Switch' */\r\n }\r\n\r\n /* End of Switch: '<S53>/Switch2' */\r\n\r\n /* Sum: '<S13>/Difference Inputs2'\r\n *\r\n * Block description for '<S13>/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Yk1_p += rtb_Switch2;\r\n\r\n /* Outport: '<Root>/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: '<S1>/MATLAB Function5' */\r\n ADM_Integrated__MATLABFunction1(rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Product: '<S14>/delta rise limit' incorporates:\r\n * SampleTimeMath: '<S14>/sample time'\r\n *\r\n * About '<S14>/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: '<S14>/Delay Input2'\r\n *\r\n * Block description for '<S14>/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: '<S14>/Difference Inputs1' incorporates:\r\n * Inport: '<Root>/GV_RWS_RackAngleCommand'\r\n *\r\n * Block description for '<S14>/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: '<S1>/MATLAB Function6' incorporates:\r\n * Gain: '<S1>/Gain5'\r\n */\r\n ADM_Integrated__MATLABFunction2(-rtb_Add1_tmp, &rtb_y_l);\r\n\r\n /* Switch: '<S54>/Switch2' incorporates:\r\n * RelationalOperator: '<S54>/LowerRelop1'\r\n */\r\n if (rtb_Add1 <= rtb_Switch2) {\r\n /* Product: '<S14>/delta fall limit' incorporates:\r\n * SampleTimeMath: '<S14>/sample time'\r\n *\r\n * About '<S14>/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: '<S54>/Switch' incorporates:\r\n * RelationalOperator: '<S54>/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: '<S54>/Switch' */\r\n }\r\n\r\n /* End of Switch: '<S54>/Switch2' */\r\n\r\n /* Sum: '<S14>/Difference Inputs2'\r\n *\r\n * Block description for '<S14>/Difference Inputs2':\r\n *\r\n * Add in CPU\r\n */\r\n rtb_Switch2 += rtb_UkYk1_j;\r\n\r\n /* Outport: '<Root>/GV_RWS_RackAngleCmd1' */\r\n ADM_Integrated_Logic_Y.GV_RWS_RackAngleCmd1 = rtb_Switch2;\r\n\r\n /* Update for UnitDelay: '<S46>/Delay Input2'\r\n *\r\n * Block description for '<S46>/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: '<S47>/Delay Input2'\r\n *\r\n * Block description for '<S47>/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: '<S8>/Integrator_2' incorporates:\r\n * Constant: '<S8>/I_gain'\r\n * Constant: '<S8>/P_gain'\r\n * DiscreteIntegrator: '<S8>/Integrator_1'\r\n * Product: '<S8>/Product'\r\n * Product: '<S8>/Product1'\r\n * Sum: '<S8>/Sum1'\r\n * Sum: '<S8>/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: '<S7>/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_DSTATE = rtb_deltafalllimit_m;\r\n\r\n /* Update for DiscreteTransferFcn: '<S1>/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: '<S21>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE = rtb_output_a;\r\n\r\n /* Update for UnitDelay: '<S21>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '<S31>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_i = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '<S31>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_p = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '<S32>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_c = rtb_Sum1_i2;\r\n\r\n /* Update for UnitDelay: '<S32>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_h = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '<S33>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d = rtb_Sum1_o1;\r\n\r\n /* Update for UnitDelay: '<S33>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_l = rtb_Sum1_lm;\r\n\r\n /* Update for Delay: '<S35>/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE = rtb_Gain_c;\r\n\r\n /* Update for Delay: '<S35>/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: '<S35>/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE = rtb_Product1_pd;\r\n\r\n /* Update for Delay: '<S35>/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: '<S34>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_e = rtb_Product1_pd;\r\n\r\n /* Update for UnitDelay: '<S34>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ij = rtb_Product1_m;\r\n\r\n /* Update for Memory: '<S3>/Memory' */\r\n ADM_Integrated_Logic_DW.Memory_PreviousInput = rtb_Add_e;\r\n\r\n /* Update for UnitDelay: '<S23>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_ir = rtb_Brake_Torque_Cmd;\r\n\r\n /* Update for UnitDelay: '<S23>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_o = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '<S24>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_m = rtb_Error_m;\r\n\r\n /* Update for UnitDelay: '<S24>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_hm = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '<S25>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_mw = rtb_Sum1_aj;\r\n\r\n /* Update for UnitDelay: '<S25>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_g = rtb_Sum1_p;\r\n\r\n /* Update for UnitDelay: '<S26>/d1' */\r\n ADM_Integrated_Logic_DW.d1_DSTATE_ej = rtb_Add3;\r\n\r\n /* Update for UnitDelay: '<S26>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_j = rtb_Product1_e;\r\n\r\n /* Update for Delay: '<S27>/Delay1' */\r\n ADM_Integrated_Logic_DW.Delay1_DSTATE_c = rtb_Product1_e;\r\n\r\n /* Update for Delay: '<S27>/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: '<S27>/Delay2' */\r\n ADM_Integrated_Logic_DW.Delay2_DSTATE_n = rtb_Product1_iz;\r\n\r\n /* Update for Delay: '<S27>/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: '<S41>/d1' incorporates:\r\n * Inport: '<Root>/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: '<S41>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_e = rtb_Desired_Torque;\r\n\r\n /* Update for UnitDelay: '<S42>/d1' incorporates:\r\n * Inport: '<Root>/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: '<S42>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_p = rtb_output_p;\r\n\r\n /* Update for UnitDelay: '<S43>/d1' incorporates:\r\n * Inport: '<Root>/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: '<S43>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_n = rtb_Integrator_1;\r\n\r\n /* Update for DiscreteIntegrator: '<S8>/Integrator_1' */\r\n ADM_Integrated_Logic_DW.Integrator_1_DSTATE += 0.002 * rtb_Sum;\r\n\r\n /* Update for UnitDelay: '<S44>/d1' incorporates:\r\n * Inport: '<Root>/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: '<S44>/d' */\r\n ADM_Integrated_Logic_DW.d_DSTATE_d1 = rtb_Product1_f;\r\n\r\n /* Update for UnitDelay: '<S13>/Delay Input2'\r\n *\r\n * Block description for '<S13>/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: '<S14>/Delay Input2'\r\n *\r\n * Block description for '<S14>/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 <stdbool.h>\r\n#include <stdint.h>\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 '<Root>' */\r\ntypedef struct {\r\n double Delay_DSTATE[2]; /* '<S35>/Delay' */\r\n double Delay3_DSTATE[2]; /* '<S35>/Delay3' */\r\n double Delay_DSTATE_p[2]; /* '<S27>/Delay' */\r\n double Delay3_DSTATE_h[2]; /* '<S27>/Delay3' */\r\n double DelayInput2_DSTATE; /* '<S46>/Delay Input2' */\r\n double DelayInput2_DSTATE_m; /* '<S47>/Delay Input2' */\r\n double Integrator_2_DSTATE; /* '<S8>/Integrator_2' */\r\n double Memory_DSTATE; /* '<S7>/Memory' */\r\n double DiscreteTransferFcn_states; /* '<S1>/Discrete Transfer Fcn' */\r\n double d1_DSTATE; /* '<S21>/d1' */\r\n double d_DSTATE; /* '<S21>/d' */\r\n double d_DSTATE_i; /* '<S31>/d' */\r\n double d1_DSTATE_p; /* '<S31>/d1' */\r\n double d_DSTATE_c; /* '<S32>/d' */\r\n double d1_DSTATE_h; /* '<S32>/d1' */\r\n double d_DSTATE_d; /* '<S33>/d' */\r\n double d1_DSTATE_l; /* '<S33>/d1' */\r\n double Delay1_DSTATE; /* '<S35>/Delay1' */\r\n double Delay2_DSTATE; /* '<S35>/Delay2' */\r\n double d1_DSTATE_e; /* '<S34>/d1' */\r\n double d_DSTATE_ij; /* '<S34>/d' */\r\n double d_DSTATE_ir; /* '<S23>/d' */\r\n double d1_DSTATE_o; /* '<S23>/d1' */\r\n double d_DSTATE_m; /* '<S24>/d' */\r\n double d1_DSTATE_hm; /* '<S24>/d1' */\r\n double d_DSTATE_mw; /* '<S25>/d' */\r\n double d1_DSTATE_g; /* '<S25>/d1' */\r\n double d1_DSTATE_ej; /* '<S26>/d1' */\r\n double d_DSTATE_j; /* '<S26>/d' */\r\n double Delay1_DSTATE_c; /* '<S27>/Delay1' */\r\n double Delay2_DSTATE_n; /* '<S27>/Delay2' */\r\n double d1_DSTATE_ob; /* '<S41>/d1' */\r\n double d_DSTATE_e; /* '<S41>/d' */\r\n double d1_DSTATE_i; /* '<S42>/d1' */\r\n double d_DSTATE_p; /* '<S42>/d' */\r\n double d1_DSTATE_o1; /* '<S43>/d1' */\r\n double d_DSTATE_n; /* '<S43>/d' */\r\n double Integrator_1_DSTATE; /* '<S8>/Integrator_1' */\r\n double d1_DSTATE_a; /* '<S44>/d1' */\r\n double d_DSTATE_d1; /* '<S44>/d' */\r\n double DelayInput2_DSTATE_c; /* '<S13>/Delay Input2' */\r\n double DelayInput2_DSTATE_i; /* '<S14>/Delay Input2' */\r\n double PrevY; /* '<S1>/Input_Vx_RateLimiter' */\r\n double PrevY_o; /* '<S3>/Brake_Out_RateLimiter' */\r\n double PrevY_a; /* '<S3>/TargetSpd_RateLimiter' */\r\n double Memory_PreviousInput; /* '<S3>/Memory' */\r\n double HAC_ON_FLAG; /* '<S8>/HAC_OFF_OK_Func' */\r\n double Smoothed_Torque; /* '<S8>/HAC_OFF_OK_Func' */\r\n double HAC_Desired_Torque; /* '<S8>/HAC_OFF_OK_Func' */\r\n double HAC_ON_Timer; /* '<S8>/HAC_OFF_OK_Func' */\r\n uint8_t is_active_c6_ADM_Integrated_Log;/* '<S8>/Chart' */\r\n uint8_t is_c6_ADM_Integrated_Logic; /* '<S8>/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; /* '<S40>/Multiply' */\r\n const double W_Value_for_Brake; /* '<S40>/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; /* '<Root>/GV_MCU_RPM' */\r\n double GV_BrakeTorqueCommand; /* '<Root>/GV_BrakeTorqueCommand' */\r\n double GV_IMU_AX_Val; /* '<Root>/GV_IMU_AX_Val' */\r\n double GV_IMU_AY_Val; /* '<Root>/GV_IMU_AY_Val' */\r\n double GV_IMU_AZ_Val; /* '<Root>/GV_IMU_AZ_Val' */\r\n double GV_IMU_PitchRtVal; /* '<Root>/GV_IMU_PitchRtVal' */\r\n double GV_Vx_Command; /* '<Root>/GV_Vx_Command' */\r\n double GV_VCU_GearSelStat; /* '<Root>/GV_VCU_GearSelStat' */\r\n double GV_MCU_EstTrq; /* '<Root>/GV_MCU_EstTrq' */\r\n double GV_Vx_Limit; /* '<Root>/GV_Vx_Limit' */\r\n double GV_Vx_Fbk; /* '<Root>/GV_Vx_Fbk' */\r\n double GV_RWA_RackAngleCommand; /* '<Root>/GV_RWA_RackAngleCommand' */\r\n double GV_RWS_RackAngleCommand; /* '<Root>/GV_RWS_RackAngleCommand' */\r\n double GV_RWA_Fault_Flag; /* '<Root>/GV_RWA_Fault_Flag' */\r\n double GV_Operation_Mode; /* '<Root>/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; /* '<Root>/GV_Brake_Command' */\r\n double GV_Master_Rack_Angle_Cmd; /* '<Root>/GV_Master_Rack_Angle_Cmd' */\r\n double GV_Hill_Torque_Assist; /* '<Root>/GV_Hill_Torque_Assist' */\r\n double GV_Motor_Torque_Cmd; /* '<Root>/GV_Motor_Torque_Cmd' */\r\n double Debug_HAC_FLAG; /* '<Root>/Debug_HAC_FLAG' */\r\n double Debug_HAC_RPM_Decision; /* '<Root>/Debug_HAC_RPM_Decision' */\r\n double Debug_HAC_Pitch_angle; /* '<Root>/Debug_HAC_Pitch_angle' */\r\n double Debug_HAC_Brake_Output; /* '<Root>/Debug_HAC_Brake_Output' */\r\n double Debug_CC_Brake_Output; /* '<Root>/Debug_CC_Brake_Output' */\r\n double GV_RWS_RackAngleCmd1; /* '<Root>/GV_RWS_RackAngleCmd1' */\r\n double GV_Speed_Limit; /* '<Root>/GV_Speed_Limit' */\r\n double GV_Gear_Postion_Out; /* '<Root>/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 '<S18>/BW_PI' : Unused code path elimination\r\n * Block '<S18>/Constant1' : Unused code path elimination\r\n * Block '<S18>/Constant16' : Unused code path elimination\r\n * Block '<S18>/Constant17' : Unused code path elimination\r\n * Block '<S18>/Constant2' : Unused code path elimination\r\n * Block '<S1>/Data Type Conversion2' : Unused code path elimination\r\n * Block '<S1>/Gain2' : Unused code path elimination\r\n * Block '<S40>/Abs' : Unused code path elimination\r\n * Block '<S40>/Brake_Saturation' : Unused code path elimination\r\n * Block '<S40>/Multiply5' : Unused code path elimination\r\n * Block '<S40>/Radius1' : Unused code path elimination\r\n * Block '<S46>/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '<S51>/Data Type Duplicate' : Unused code path elimination\r\n * Block '<S51>/Data Type Propagation' : Unused code path elimination\r\n * Block '<S47>/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '<S52>/Data Type Duplicate' : Unused code path elimination\r\n * Block '<S52>/Data Type Propagation' : Unused code path elimination\r\n * Block '<S8>/Scope2' : Unused code path elimination\r\n * Block '<S13>/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '<S53>/Data Type Duplicate' : Unused code path elimination\r\n * Block '<S53>/Data Type Propagation' : Unused code path elimination\r\n * Block '<S14>/FixPt Data Type Duplicate' : Unused code path elimination\r\n * Block '<S54>/Data Type Duplicate' : Unused code path elimination\r\n * Block '<S54>/Data Type Propagation' : Unused code path elimination\r\n * Block '<S3>/ControlFlag' : Eliminated nontunable gain of 1\r\n * Block '<S18>/FBGain' : Eliminated nontunable gain of 1\r\n * Block '<S29>/FFGain' : Eliminated nontunable gain of 1\r\n * Block '<S1>/Data Type Conversion1' : Eliminate redundant data type conversion\r\n * Block '<S1>/Data Type Conversion3' : Eliminate redundant data type conversion\r\n * Block '<S40>/HAC_Gain' : Eliminated nontunable gain of 1\r\n * Block '<S46>/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '<S47>/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '<S13>/Zero-Order Hold' : Eliminated since input and output rates are identical\r\n * Block '<S14>/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 <system>/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('<S3>') - opens system 3\r\n * hilite_system('<S3>/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 * '<Root>' : 'ADM_Integrated_Logic'\r\n * '<S1>' : 'ADM_Integrated_Logic/Delivery_Mobility'\r\n * '<S2>' : 'ADM_Integrated_Logic/Delivery_Mobility/Compare To Constant'\r\n * '<S3>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1'\r\n * '<S4>' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Brake_Func'\r\n * '<S5>' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Gear_Func1'\r\n * '<S6>' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func'\r\n * '<S7>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position'\r\n * '<S8>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1'\r\n * '<S9>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1'\r\n * '<S10>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2'\r\n * '<S11>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5'\r\n * '<S12>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6'\r\n * '<S13>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic'\r\n * '<S14>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1'\r\n * '<S15>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic'\r\n * '<S16>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB'\r\n * '<S17>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain'\r\n * '<S18>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller'\r\n * '<S19>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake'\r\n * '<S20>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out'\r\n * '<S21>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM'\r\n * '<S22>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM'\r\n * '<S23>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3'\r\n * '<S24>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4'\r\n * '<S25>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5'\r\n * '<S26>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM'\r\n * '<S27>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF'\r\n * '<S28>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB'\r\n * '<S29>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF'\r\n * '<S30>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P'\r\n * '<S31>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot'\r\n * '<S32>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2'\r\n * '<S33>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3'\r\n * '<S34>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM'\r\n * '<S35>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF'\r\n * '<S36>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant'\r\n * '<S37>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1'\r\n * '<S38>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart'\r\n * '<S39>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func'\r\n * '<S40>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2'\r\n * '<S41>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM'\r\n * '<S42>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1'\r\n * '<S43>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2'\r\n * '<S44>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3'\r\n * '<S45>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate'\r\n * '<S46>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic'\r\n * '<S47>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1'\r\n * '<S48>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_R'\r\n * '<S49>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c'\r\n * '<S50>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c1'\r\n * '<S51>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '<S52>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '<S53>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic/Saturation Dynamic'\r\n * '<S54>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1/Saturation Dynamic'\r\n * '<S55>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Compare To Constant'\r\n * '<S56>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Vx_OutPut_Function'\r\n */\r\n\r\n/*-\r\n * Requirements for '<Root>': 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 <stdbool.h>\r\n#include <stdint.h>\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, /* '<S40>/Multiply' */\r\n 12753.0 /* '<S40>/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 <stdint.h>\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}};