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}};