From 10698e10f1fb04f7713025733eadf292fe7273c6 Mon Sep 17 00:00:00 2001 From: S2-CHICKEN <67466148+ppk150@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:27:08 +0900 Subject: [PATCH] =?UTF-8?q?Cruise=5FControl=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=5F=EC=B6=94=ED=9B=84=20can=20=EB=A7=A4?= =?UTF-8?q?=EC=B9=AD=20=ED=95=84=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GW/Debug_FLASH/.gitignore | 1 + GW/Debug_FLASH/GW.args | 1 + GW/Debug_FLASH/GW.elf | Bin 4712492 -> 4712492 bytes GW/Debug_FLASH/GW.map | 26 ++- GW/Debug_FLASH/src/MCU/subdir.mk | 5 +- GW/src/MCU/Cruise_Control.c | 348 +++++++++++++++++++++++++++++++ GW/src/MCU/Cruise_Control.h | 168 +++++++++++++++ 7 files changed, 546 insertions(+), 3 deletions(-) create mode 100644 GW/Debug_FLASH/.gitignore create mode 100644 GW/src/MCU/Cruise_Control.c create mode 100644 GW/src/MCU/Cruise_Control.h diff --git a/GW/Debug_FLASH/.gitignore b/GW/Debug_FLASH/.gitignore new file mode 100644 index 00000000..4f00cd9a --- /dev/null +++ b/GW/Debug_FLASH/.gitignore @@ -0,0 +1 @@ +/src/ diff --git a/GW/Debug_FLASH/GW.args b/GW/Debug_FLASH/GW.args index 533571a0..1d75627e 100644 --- a/GW/Debug_FLASH/GW.args +++ b/GW/Debug_FLASH/GW.args @@ -113,6 +113,7 @@ "./src/main.o" "./src/HAL/watchdog_hal/src/watchdog_hal.o" "./src/IDB_RCU/BREAK_Speed.o" +"./src/MCU/Cruise_Control.o" "./src/MCU/Low_SOC_mode.o" "./src/MCU/Motor_logic.o" "./src/MCU/NO_MCU_SIG.o" diff --git a/GW/Debug_FLASH/GW.elf b/GW/Debug_FLASH/GW.elf index bba66b85701a45f5db0d84903553481f8e4aebfa..09e618dfef06122cfc7bda66aaf9e43b4c0d07c0 100644 GIT binary patch delta 221 zcmWN^$w~qN9KhkfV=ifFYL<>^i)MQ|*=D(wlfJ=R2Z!mH z_yiq&pAhu$9lqi8TNy5V;6lO85+1zx@Uu*SASRw z*#Up{K$lIST@5(~nhaSE$Z^OK$K)wcq{IoQl+ifjoC;Mgxa5j!Zm3bGL6ckVxaWZuI*-4`kEy=@ z>GGk7L==w%CL*bUE<>4LzQ(388k_B?8n>*@Q^$U`9Jgyr*KsYa{NjF3T|F`Se{E}T EGnq_D+yDRo diff --git a/GW/Debug_FLASH/GW.map b/GW/Debug_FLASH/GW.map index 3e5eb803..9675222d 100644 --- a/GW/Debug_FLASH/GW.map +++ b/GW/Debug_FLASH/GW.map @@ -77,11 +77,11 @@ C:/NXP/S32DS.3.4/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/arm-none-eabi/new C:/NXP/S32DS.3.4/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/arm-none-eabi/newlib/lib/thumb/v7e-m/nofp\libm.a(lib_a-s_round.o) ./src/can.o (round) c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/thumb/v7e-m/nofp\libgcc.a(_arm_muldf3.o) - ./src/MCU/Low_SOC_mode.o (__aeabi_dmul) + ./src/MCU/Cruise_Control.o (__aeabi_dmul) c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/thumb/v7e-m/nofp\libgcc.a(_arm_mulsf3.o) ./RTD/src/Clock_Ip_Specific.o (__aeabi_fmul) c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/thumb/v7e-m/nofp\libgcc.a(_arm_addsubdf3.o) - C:/NXP/S32DS.3.4/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/arm-none-eabi/newlib/lib/thumb/v7e-m/nofp\libc_nano.a(lib_a-strtod.o) (__aeabi_dsub) + ./src/MCU/Cruise_Control.o (__aeabi_dsub) c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/thumb/v7e-m/nofp\libgcc.a(_arm_muldivdf3.o) ./src/board.o (__aeabi_ddiv) c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/thumb/v7e-m/nofp\libgcc.a(_arm_cmpdf2.o) @@ -8262,6 +8262,27 @@ Discarded input sections .debug_macro 0x00000000 0xde ./src/IDB_RCU/BREAK_Speed.o .debug_macro 0x00000000 0x4b9 ./src/IDB_RCU/BREAK_Speed.o .debug_macro 0x00000000 0x7a ./src/IDB_RCU/BREAK_Speed.o + .group 0x00000000 0xc ./src/MCU/Cruise_Control.o + .group 0x00000000 0xc ./src/MCU/Cruise_Control.o + .group 0x00000000 0xc ./src/MCU/Cruise_Control.o + .text 0x00000000 0x4f8 ./src/MCU/Cruise_Control.o + .data 0x00000000 0x0 ./src/MCU/Cruise_Control.o + .bss 0x00000000 0x110 ./src/MCU/Cruise_Control.o + .debug_info 0x00000000 0x3ee ./src/MCU/Cruise_Control.o + .debug_abbrev 0x00000000 0xd8 ./src/MCU/Cruise_Control.o + .debug_loc 0x00000000 0x22d ./src/MCU/Cruise_Control.o + .debug_aranges + 0x00000000 0x20 ./src/MCU/Cruise_Control.o + .debug_macro 0x00000000 0x23 ./src/MCU/Cruise_Control.o + .debug_macro 0x00000000 0xaa8 ./src/MCU/Cruise_Control.o + .debug_macro 0x00000000 0x10 ./src/MCU/Cruise_Control.o + .debug_macro 0x00000000 0x5e ./src/MCU/Cruise_Control.o + .debug_line 0x00000000 0x35e ./src/MCU/Cruise_Control.o + .debug_str 0x00000000 0x3440 ./src/MCU/Cruise_Control.o + .comment 0x00000000 0x81 ./src/MCU/Cruise_Control.o + .debug_frame 0x00000000 0x54 ./src/MCU/Cruise_Control.o + .ARM.attributes + 0x00000000 0x2e ./src/MCU/Cruise_Control.o .group 0x00000000 0xc ./src/MCU/Low_SOC_mode.o .group 0x00000000 0xc ./src/MCU/Low_SOC_mode.o .group 0x00000000 0xc ./src/MCU/Low_SOC_mode.o @@ -9519,6 +9540,7 @@ LOAD ./src/can.o LOAD ./src/main.o LOAD ./src/HAL/watchdog_hal/src/watchdog_hal.o LOAD ./src/IDB_RCU/BREAK_Speed.o +LOAD ./src/MCU/Cruise_Control.o LOAD ./src/MCU/Low_SOC_mode.o LOAD ./src/MCU/Motor_logic.o LOAD ./src/MCU/NO_MCU_SIG.o diff --git a/GW/Debug_FLASH/src/MCU/subdir.mk b/GW/Debug_FLASH/src/MCU/subdir.mk index 35b7637c..4e8f32c1 100644 --- a/GW/Debug_FLASH/src/MCU/subdir.mk +++ b/GW/Debug_FLASH/src/MCU/subdir.mk @@ -4,18 +4,21 @@ # Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ +../src/MCU/Cruise_Control.c \ ../src/MCU/Low_SOC_mode.c \ ../src/MCU/Motor_logic.c \ ../src/MCU/NO_MCU_SIG.c \ ../src/MCU/SPEED.c OBJS += \ +./src/MCU/Cruise_Control.o \ ./src/MCU/Low_SOC_mode.o \ ./src/MCU/Motor_logic.o \ ./src/MCU/NO_MCU_SIG.o \ ./src/MCU/SPEED.o C_DEPS += \ +./src/MCU/Cruise_Control.d \ ./src/MCU/Low_SOC_mode.d \ ./src/MCU/Motor_logic.d \ ./src/MCU/NO_MCU_SIG.d \ @@ -26,7 +29,7 @@ C_DEPS += \ src/MCU/%.o: ../src/MCU/%.c @echo 'Building file: $<' @echo 'Invoking: Standard S32DS C Compiler' - arm-none-eabi-gcc "@src/MCU/Low_SOC_mode.args" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + arm-none-eabi-gcc "@src/MCU/Cruise_Control.args" -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/GW/src/MCU/Cruise_Control.c b/GW/src/MCU/Cruise_Control.c new file mode 100644 index 00000000..57adbbf3 --- /dev/null +++ b/GW/src/MCU/Cruise_Control.c @@ -0,0 +1,348 @@ +/* + * Academic License - for use in teaching, academic research, and meeting + * course requirements at degree granting institutions only. Not for + * government, commercial, or other organizational use. + * + * File: TEST.c + * + * Code generated for Simulink model 'TEST'. + * + * Model version : 1.2 + * Simulink Coder version : 8.14 (R2018a) 06-Feb-2018 + * C/C++ source code generated on : Thu Aug 8 15:21:25 2024 + * + * Target selection: ert.tlc + * Embedded hardware selection: NXP->Cortex-M4 + * Code generation objectives: Unspecified + * Validation result: Not run + */ + +#include "Cruise_Control.h" + +/* Block signals and states (default storage) */ +CC_DW CC_rtDW; + +/* External inputs (root inport signals with default storage) */ +CC_ExtU CC_rtU; + +/* External outputs (root outports fed by signals with default storage) */ +CC_ExtY CC_rtY; + +/* Model step function */ +void TEST_step(void) +{ + real_T CC_rtb_Product4_j; + real_T CC_rtb_Product1; + real_T CC_rtb_Sum1_c; + real_T CC_rtb_Sum1_ll; + real_T CC_rtb_Sum1_pl; + real_T CC_rtb_Gain; + real_T CC_rtb_Subtract2; + real_T CC_rtb_Product1_m; + real_T CC_rtb_Product1_p; + real_T CC_rtb_Sum1_g; + real_T CC_rtb_Sum1_b; + real_T CC_rtb_Sum1_j; + real_T CC_rtb_Add3; + real_T CC_rtb_Product1_j; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Inport: '/TargetSpd' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Product1 = ((CC_rtU.CC_TargetSpd + CC_rtDW.CC_d1_DSTATE) * 0.002 + + 0.1041032953945969 * CC_rtDW.CC_d_DSTATE) / + 0.1081032953945969; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_c = (CC_rtb_Product1 - CC_rtDW.CC_d_DSTATE_c) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_h; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_ll = (CC_rtb_Sum1_c - CC_rtDW.CC_d_DSTATE_n) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_p; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_pl = (CC_rtb_Sum1_ll - CC_rtDW.CC_d_DSTATE_f) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_l; + + /* Gain: '/Gain' incorporates: + * Constant: '/Constant3' + * Constant: '/Constant4' + * Constant: '/Constant5' + * Product: '/Product' + * Product: '/Product1' + * Product: '/Product2' + * Sum: '/Add5' + */ + CC_rtb_Gain = (((156.8 * CC_rtb_Product1 + 212.8 * CC_rtb_Sum1_c) + 21.8 * + CC_rtb_Sum1_ll) + CC_rtb_Sum1_pl) * 9.44822373393802E-6; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant2' + * Delay: '/Delay' + * Delay: '/Delay1' + * Delay: '/Delay2' + * Delay: '/Delay3' + * Gain: '/gain1' + * Gain: '/gain3' + * Product: '/x(n), x(n-1), x(n-2)' + * Product: '/y(n-1)' + * Product: '/y(n-2)' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * Sum: '/Sum5' + * Sum: '/Sum6' + */ + CC_rtb_Product1_m = ((((2.0 * CC_rtDW.CC_Delay1_DSTATE + CC_rtb_Gain) + + CC_rtDW.CC_Delay_DSTATE[0]) * 0.14212230337568674 - -7.7157553932486262 * + CC_rtDW.CC_Delay2_DSTATE) - 3.0759914204534549 * + CC_rtDW.CC_Delay3_DSTATE[0]) / 5.2082531862979184; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Product1_p = ((CC_rtb_Product1_m + CC_rtDW.CC_d1_DSTATE_o) * 0.002 + + 0.00861032953945969 * CC_rtDW.CC_d_DSTATE_cy) / + 0.01261032953945969; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_g = (CC_rtb_Product1 - CC_rtDW.CC_d_DSTATE_d) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_oq; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_b = (CC_rtb_Sum1_g - CC_rtDW.CC_d_DSTATE_m) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_k; + + /* Sum: '/Sum1' incorporates: + * Gain: '/gain' + * Sum: '/Sum2' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Sum1_j = (CC_rtb_Sum1_b - CC_rtDW.CC_d_DSTATE_cl) * 1000.0 - + CC_rtDW.CC_d1_DSTATE_a; + + /* Sum: '/Add3' incorporates: + * Constant: '/Constant3' + * Constant: '/Constant4' + * Constant: '/Constant5' + * Gain: '/Gain' + * Memory: '/Memory' + * Product: '/Product2' + * Product: '/Product3' + * Product: '/Product4' + * Sum: '/Add2' + */ + CC_rtb_Add3 = (((156.8 * CC_rtb_Product1 + 212.8 * CC_rtb_Sum1_g) + 21.8 * + CC_rtb_Sum1_b) + CC_rtb_Sum1_j) * 9.44822373393802E-6 - + CC_rtDW.CC_Memory_PreviousInput; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant' + * Gain: '/gain' + * Product: '/Product11' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * UnitDelay: '/d' + * UnitDelay: '/d1' + */ + CC_rtb_Product1_j = ((CC_rtb_Add3 + CC_rtDW.CC_d1_DSTATE_g) * 0.002 + + 0.061661977236758134 * CC_rtDW.CC_d_DSTATE_dp) / + 0.065661977236758137; + + /* Product: '/Product1' incorporates: + * Constant: '/Constant1' + * Constant: '/Constant2' + * Delay: '/Delay' + * Delay: '/Delay1' + * Delay: '/Delay2' + * Delay: '/Delay3' + * Gain: '/gain1' + * Gain: '/gain3' + * Product: '/x(n), x(n-1), x(n-2)' + * Product: '/y(n-1)' + * Product: '/y(n-2)' + * Sum: '/Sum1' + * Sum: '/Sum2' + * Sum: '/Sum3' + * Sum: '/Sum4' + * Sum: '/Sum5' + * Sum: '/Sum6' + */ + CC_rtb_Product4_j = ((((2.0 * CC_rtDW.CC_Delay1_DSTATE_c + CC_rtb_Product1_j) + + CC_rtDW.CC_Delay_DSTATE_o[0]) * 2.5266187266788758E-5 - + -7.9999494676254663 * CC_rtDW.CC_Delay2_DSTATE_b) - + 3.9858101877483039 * CC_rtDW.CC_Delay3_DSTATE_b[0]) / + 4.01424034462623; + + /* Sum: '/Subtract2' incorporates: + * Inport: '/RPM_Fbk' + * Product: '/Product' + * Product: '/Product' + * Sum: '/Subtract' + * Sum: '/Add' + */ + CC_rtb_Subtract2 = ((CC_rtb_Product1 - CC_rtU.CC_RPM_Fbk) * + 0.027033512348390604 + CC_rtb_Product1_p) - + CC_rtb_Product4_j; + + /* Saturate: '/Saturation' */ + if (CC_rtb_Subtract2 > 20.0) { + CC_rtb_Subtract2 = 20.0; + } else { + if (CC_rtb_Subtract2 < -20.0) { + CC_rtb_Subtract2 = -20.0; + } + } + + /* End of Saturate: '/Saturation' */ + + /* Outport: '/Torque_Cmd' */ + CC_rtY.CC_Torque_Cmd = CC_rtb_Subtract2; + + /* Update for UnitDelay: '/d1' incorporates: + * Inport: '/TargetSpd' + */ + CC_rtDW.CC_d1_DSTATE = CC_rtU.CC_TargetSpd; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE = CC_rtb_Product1; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_c = CC_rtb_Product1; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_h = CC_rtb_Sum1_c; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_n = CC_rtb_Sum1_c; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_p = CC_rtb_Sum1_ll; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_f = CC_rtb_Sum1_ll; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_l = CC_rtb_Sum1_pl; + + /* Update for Delay: '/Delay1' */ + CC_rtDW.CC_Delay1_DSTATE = CC_rtb_Gain; + + /* Update for Delay: '/Delay' */ + CC_rtDW.CC_Delay_DSTATE[0] = CC_rtDW.CC_Delay_DSTATE[1]; + CC_rtDW.CC_Delay_DSTATE[1] = CC_rtb_Gain; + + /* Update for Delay: '/Delay2' */ + CC_rtDW.CC_Delay2_DSTATE = CC_rtb_Product1_m; + + /* Update for Delay: '/Delay3' */ + CC_rtDW.CC_Delay3_DSTATE[0] = CC_rtDW.CC_Delay3_DSTATE[1]; + CC_rtDW.CC_Delay3_DSTATE[1] = CC_rtb_Product1_m; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_o = CC_rtb_Product1_m; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_cy = CC_rtb_Product1_p; + + /* Update for Memory: '/Memory' */ + CC_rtDW.CC_Memory_PreviousInput = CC_rtb_Subtract2; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_d = CC_rtb_Product1; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_oq = CC_rtb_Sum1_g; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_m = CC_rtb_Sum1_g; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_k = CC_rtb_Sum1_b; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_cl = CC_rtb_Sum1_b; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_a = CC_rtb_Sum1_j; + + /* Update for UnitDelay: '/d1' */ + CC_rtDW.CC_d1_DSTATE_g = CC_rtb_Add3; + + /* Update for UnitDelay: '/d' */ + CC_rtDW.CC_d_DSTATE_dp = CC_rtb_Product1_j; + + /* Update for Delay: '/Delay1' */ + CC_rtDW.CC_Delay1_DSTATE_c = CC_rtb_Product1_j; + + /* Update for Delay: '/Delay' */ + CC_rtDW.CC_Delay_DSTATE_o[0] = CC_rtDW.CC_Delay_DSTATE_o[1]; + CC_rtDW.CC_Delay_DSTATE_o[1] = CC_rtb_Product1_j; + + /* Update for Delay: '/Delay2' */ + CC_rtDW.CC_Delay2_DSTATE_b = CC_rtb_Product4_j; + + /* Update for Delay: '/Delay3' */ + CC_rtDW.CC_Delay3_DSTATE_b[0] = CC_rtDW.CC_Delay3_DSTATE_b[1]; + CC_rtDW.CC_Delay3_DSTATE_b[1] = CC_rtb_Product4_j; +} + +/* Model initialize function */ +void TEST_initialize(void) +{ + /* (no initialization code required) */ +} + +/* + * File trailer for generated code. + * + * [EOF] + */ diff --git a/GW/src/MCU/Cruise_Control.h b/GW/src/MCU/Cruise_Control.h new file mode 100644 index 00000000..24dcec6b --- /dev/null +++ b/GW/src/MCU/Cruise_Control.h @@ -0,0 +1,168 @@ + /* + * Academic License - for use in teaching, academic research, and meeting + * course requirements at degree granting institutions only. Not for + * government, commercial, or other organizational use. + * + * File: TEST.h + * + * Code generated for Simulink model 'TEST'. + * + * Model version : 1.2 + * Simulink Coder version : 8.14 (R2018a) 06-Feb-2018 + * C/C++ source code generated on : Thu Aug 8 15:21:25 2024 + * + * Target selection: ert.tlc + * Embedded hardware selection: NXP->Cortex-M4 + * Code generation objectives: Unspecified + * Validation result: Not run + */ + + #ifndef RTW_HEADER_TEST_h_ + #define RTW_HEADER_TEST_h_ + #ifndef TEST_COMMON_INCLUDES_ + # define TEST_COMMON_INCLUDES_ + #include "rtwtypes.h" + #endif /* TEST_COMMON_INCLUDES_ */ + + /* Macros for accessing real-time model data structure */ + + /* Block signals and states (default storage) for system '' */ + typedef struct { + real_T CC_Delay_DSTATE[2]; /* '/Delay' */ + real_T CC_Delay3_DSTATE[2]; /* '/Delay3' */ + real_T CC_Delay_DSTATE_o[2]; /* '/Delay' */ + real_T CC_Delay3_DSTATE_b[2]; /* '/Delay3' */ + real_T CC_d1_DSTATE; /* '/d1' */ + real_T CC_d_DSTATE; /* '/d' */ + real_T CC_d_DSTATE_c; /* '/d' */ + real_T CC_d1_DSTATE_h; /* '/d1' */ + real_T CC_d_DSTATE_n; /* '/d' */ + real_T CC_d1_DSTATE_p; /* '/d1' */ + real_T CC_d_DSTATE_f; /* '/d' */ + real_T CC_d1_DSTATE_l; /* '/d1' */ + real_T CC_Delay1_DSTATE; /* '/Delay1' */ + real_T CC_Delay2_DSTATE; /* '/Delay2' */ + real_T CC_d1_DSTATE_o; /* '/d1' */ + real_T CC_d_DSTATE_cy; /* '/d' */ + real_T CC_d_DSTATE_d; /* '/d' */ + real_T CC_d1_DSTATE_oq; /* '/d1' */ + real_T CC_d_DSTATE_m; /* '/d' */ + real_T CC_d1_DSTATE_k; /* '/d1' */ + real_T CC_d_DSTATE_cl; /* '/d' */ + real_T CC_d1_DSTATE_a; /* '/d1' */ + real_T CC_d1_DSTATE_g; /* '/d1' */ + real_T CC_d_DSTATE_dp; /* '/d' */ + real_T CC_Delay1_DSTATE_c; /* '/Delay1' */ + real_T CC_Delay2_DSTATE_b; /* '/Delay2' */ + real_T CC_Memory_PreviousInput; /* '/Memory' */ + } CC_DW; + + /* External inputs (root inport signals with default storage) */ + typedef struct { + real_T CC_TargetSpd; /* '/TargetSpd' */ + real_T CC_RPM_Fbk; /* '/RPM_Fbk' */ + } CC_ExtU; + + /* External outputs (root outports fed by signals with default storage) */ + typedef struct { + real_T CC_Torque_Cmd; /* '/Torque_Cmd' */ + } CC_ExtY; + + /* Block signals and states (default storage) */ + extern CC_DW CC_rtDW; + + /* External inputs (root inport signals with default storage) */ + extern CC_ExtU CC_rtU; + + /* External outputs (root outports fed by signals with default storage) */ + extern CC_ExtY CC_rtY; + + /* Model entry point functions */ + extern void TEST_initialize(void); + extern void TEST_step(void); + + /*- + * These blocks were eliminated from the model due to optimizations: + * + * Block '/Constant1' : Unused code path elimination + * Block '/Constant16' : Unused code path elimination + * Block '/Constant17' : Unused code path elimination + * Block '/Constant2' : Unused code path elimination + * Block '/ControlFlag' : Eliminated nontunable gain of 1 + * Block '/Multiport Switch1' : Eliminated due to constant selection input + * Block '/FBGain' : Eliminated nontunable gain of 1 + * Block '/FFGain' : Eliminated nontunable gain of 1 + * Block '/BW_PI' : Unused code path elimination + * Block '/Add' : Unused code path elimination + * Block '/Constant' : Unused code path elimination + * Block '/Divide1' : Unused code path elimination + * Block '/Divide2' : Unused code path elimination + * Block '/Constant' : Unused code path elimination + * Block '/Constant1' : Unused code path elimination + * Block '/Constant2' : Unused code path elimination + * Block '/Product1' : Unused code path elimination + * Block '/Product11' : Unused code path elimination + * Block '/Product2' : Unused code path elimination + * Block '/Product3' : Unused code path elimination + * Block '/Sum1' : Unused code path elimination + * Block '/Sum2' : Unused code path elimination + * Block '/Sum3' : Unused code path elimination + * Block '/Sum4' : Unused code path elimination + * Block '/d' : Unused code path elimination + * Block '/d1' : Unused code path elimination + * Block '/gain2' : Unused code path elimination + * Block '/gain3' : Unused code path elimination + * Block '/Sum1' : Unused code path elimination + * Block '/Sum2' : Unused code path elimination + * Block '/d' : Unused code path elimination + * Block '/d1' : Unused code path elimination + * Block '/gain' : Unused code path elimination + * Block '/Ki' : Unused code path elimination + * Block '/Kp' : Unused code path elimination + * Block '/gain ' : Unused code path elimination + * Block '/Selector' : Unused code path elimination + */ + + /*- + * The generated code includes comments that allow you to trace directly + * back to the appropriate location in the model. The basic format + * is /block_name, where system is the system number (uniquely + * assigned by Simulink) and block_name is the name of the block. + * + * Use the MATLAB hilite_system command to trace the generated code back + * to the model. For example, + * + * hilite_system('') - opens system 3 + * hilite_system('/Kp') - opens and selects block Kp which resides in S3 + * + * Here is the system hierarchy for this model + * + * '' : 'TEST' + * '' : 'TEST/Cruise_Control' + * '' : 'TEST/Cruise_Control/DOB' + * '' : 'TEST/Cruise_Control/FF+PID Controller' + * '' : 'TEST/Cruise_Control/LPFM' + * '' : 'TEST/Cruise_Control/DOB/Dot3' + * '' : 'TEST/Cruise_Control/DOB/Dot4' + * '' : 'TEST/Cruise_Control/DOB/Dot5' + * '' : 'TEST/Cruise_Control/DOB/LPFM' + * '' : 'TEST/Cruise_Control/DOB/Second order LPF' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FB' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FB/P' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FB/PI' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FB/PI/HPF' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FB/PI/Integrator1' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF/Dot' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF/Dot2' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF/Dot3' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF/LPFM' + * '' : 'TEST/Cruise_Control/FF+PID Controller/FF/Second order LPF' + */ + #endif /* RTW_HEADER_TEST_h_ */ + + /* + * File trailer for generated code. + * + * [EOF] + */