1 | /* |
2 | * RaspberryPrediction.h |
3 | * |
4 | * Classroom License -- for classroom instructional use only. Not for |
5 | * government, commercial, academic research, or other organizational use. |
6 | * |
7 | * Code generation for model "RaspberryPrediction". |
8 | * |
9 | * Model version : 1.13 |
10 | * Simulink Coder version : 8.11 (R2016b) 25-Aug-2016 |
11 | * C source code generated on : Tue Dec 20 13:49:58 2016 |
12 | * |
13 | * Target selection: ert.tlc |
14 | * Note: GRT includes extra infrastructure and instrumentation for prototyping |
15 | * Embedded hardware selection: ARM Compatible->ARM Cortex |
16 | * Code generation objectives: Unspecified |
17 | * Validation result: Not run |
18 | */ |
19 | |
20 | #ifndef RTW_HEADER_RaspberryPrediction_h_ |
21 | #define RTW_HEADER_RaspberryPrediction_h_ |
22 | #include <math.h> |
23 | #include <string.h> |
24 | #include <float.h> |
25 | #include <stddef.h> |
26 | #ifndef RaspberryPrediction_COMMON_INCLUDES_ |
27 | # define RaspberryPrediction_COMMON_INCLUDES_ |
28 | #include "rtwtypes.h" |
29 | #include "rtw_extmode.h" |
30 | #include "sysran_types.h" |
31 | #include "rtw_continuous.h" |
32 | #include "rtw_solver.h" |
33 | #include "dt_info.h" |
34 | #include "ext_work.h" |
35 | #endif /* RaspberryPrediction_COMMON_INCLUDES_ */ |
36 | |
37 | #include "RaspberryPrediction_types.h" |
38 | |
39 | /* Shared type includes */ |
40 | #include "multiword_types.h" |
41 | #include "rt_nonfinite.h" |
42 | #include "rtGetInf.h" |
43 | |
44 | /* Macros for accessing real-time model data structure */ |
45 | #ifndef rtmGetBlkStateChangeFlag |
46 | # define rtmGetBlkStateChangeFlag(rtm) ((rtm)->blkStateChange) |
47 | #endif |
48 | |
49 | #ifndef rtmSetBlkStateChangeFlag |
50 | # define rtmSetBlkStateChangeFlag(rtm, val) ((rtm)->blkStateChange = (val)) |
51 | #endif |
52 | |
53 | #ifndef rtmGetContStateDisabled |
54 | # define rtmGetContStateDisabled(rtm) ((rtm)->contStateDisabled) |
55 | #endif |
56 | |
57 | #ifndef rtmSetContStateDisabled |
58 | # define rtmSetContStateDisabled(rtm, val) ((rtm)->contStateDisabled = (val)) |
59 | #endif |
60 | |
61 | #ifndef rtmGetContStates |
62 | # define rtmGetContStates(rtm) ((rtm)->contStates) |
63 | #endif |
64 | |
65 | #ifndef rtmSetContStates |
66 | # define rtmSetContStates(rtm, val) ((rtm)->contStates = (val)) |
67 | #endif |
68 | |
69 | #ifndef rtmGetDerivCacheNeedsReset |
70 | # define rtmGetDerivCacheNeedsReset(rtm) ((rtm)->derivCacheNeedsReset) |
71 | #endif |
72 | |
73 | #ifndef rtmSetDerivCacheNeedsReset |
74 | # define rtmSetDerivCacheNeedsReset(rtm, val) ((rtm)->derivCacheNeedsReset = (val)) |
75 | #endif |
76 | |
77 | #ifndef rtmGetFinalTime |
78 | # define rtmGetFinalTime(rtm) ((rtm)->Timing.tFinal) |
79 | #endif |
80 | |
81 | #ifndef rtmGetIntgData |
82 | # define rtmGetIntgData(rtm) ((rtm)->intgData) |
83 | #endif |
84 | |
85 | #ifndef rtmSetIntgData |
86 | # define rtmSetIntgData(rtm, val) ((rtm)->intgData = (val)) |
87 | #endif |
88 | |
89 | #ifndef rtmGetOdeF |
90 | # define rtmGetOdeF(rtm) ((rtm)->odeF) |
91 | #endif |
92 | |
93 | #ifndef rtmSetOdeF |
94 | # define rtmSetOdeF(rtm, val) ((rtm)->odeF = (val)) |
95 | #endif |
96 | |
97 | #ifndef rtmGetPeriodicContStateIndices |
98 | # define rtmGetPeriodicContStateIndices(rtm) ((rtm)->periodicContStateIndices) |
99 | #endif |
100 | |
101 | #ifndef rtmSetPeriodicContStateIndices |
102 | # define rtmSetPeriodicContStateIndices(rtm, val) ((rtm)->periodicContStateIndices = (val)) |
103 | #endif |
104 | |
105 | #ifndef rtmGetPeriodicContStateRanges |
106 | # define rtmGetPeriodicContStateRanges(rtm) ((rtm)->periodicContStateRanges) |
107 | #endif |
108 | |
109 | #ifndef rtmSetPeriodicContStateRanges |
110 | # define rtmSetPeriodicContStateRanges(rtm, val) ((rtm)->periodicContStateRanges = (val)) |
111 | #endif |
112 | |
113 | #ifndef rtmGetRTWExtModeInfo |
114 | # define rtmGetRTWExtModeInfo(rtm) ((rtm)->extModeInfo) |
115 | #endif |
116 | |
117 | #ifndef rtmGetZCCacheNeedsReset |
118 | # define rtmGetZCCacheNeedsReset(rtm) ((rtm)->zCCacheNeedsReset) |
119 | #endif |
120 | |
121 | #ifndef rtmSetZCCacheNeedsReset |
122 | # define rtmSetZCCacheNeedsReset(rtm, val) ((rtm)->zCCacheNeedsReset = (val)) |
123 | #endif |
124 | |
125 | #ifndef rtmGetdX |
126 | # define rtmGetdX(rtm) ((rtm)->derivs) |
127 | #endif |
128 | |
129 | #ifndef rtmSetdX |
130 | # define rtmSetdX(rtm, val) ((rtm)->derivs = (val)) |
131 | #endif |
132 | |
133 | #ifndef rtmGetErrorStatus |
134 | # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) |
135 | #endif |
136 | |
137 | #ifndef rtmSetErrorStatus |
138 | # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) |
139 | #endif |
140 | |
141 | #ifndef rtmGetStopRequested |
142 | # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) |
143 | #endif |
144 | |
145 | #ifndef rtmSetStopRequested |
146 | # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) |
147 | #endif |
148 | |
149 | #ifndef rtmGetStopRequestedPtr |
150 | # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) |
151 | #endif |
152 | |
153 | #ifndef rtmGetT |
154 | # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0]) |
155 | #endif |
156 | |
157 | #ifndef rtmGetTFinal |
158 | # define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal) |
159 | #endif |
160 | |
161 | /* Block signals for system '<S1>/Position transformation1' */ |
162 | typedef struct { |
163 | real_T X; /* '<S1>/Position transformation1' */ |
164 | real_T Y; /* '<S1>/Position transformation1' */ |
165 | } B_Positiontransformation1_Ras_T; |
166 | |
167 | /* Block signals (auto storage) */ |
168 | typedef struct { |
169 | real_T MagManlinearization1_o1[16]; /* '<S5>/MagMan linearization1' */ |
170 | real_T MathFunction[16]; /* '<S5>/Math Function' */ |
171 | real_T Linearmodeloftherollingball2ind[2];/* '<Root>/Linear model of the rolling ball (2 independent double integrators)' */ |
172 | real_T MagManlinearization1_o2; /* '<S5>/MagMan linearization1' */ |
173 | real_T MagManFoilwitherror_o1; /* '<S4>/MagMan Foil with error' */ |
174 | real_T MagManFoilwitherror_o2; /* '<S4>/MagMan Foil with error' */ |
175 | real_T MagManFoilwitherror_o3; /* '<S4>/MagMan Foil with error' */ |
176 | real_T DataTypeConversion1; /* '<S6>/Data Type Conversion1' */ |
177 | real_T DataTypeConversion2; /* '<S6>/Data Type Conversion2' */ |
178 | real_T Delay[2]; /* '<Root>/Delay' */ |
179 | real_T Sum1[2]; /* '<Root>/Sum1' */ |
180 | real_T Ao[32]; /* '<S5>/Embedded MATLAB Function' */ |
181 | real_T PWM[16]; /* '<Root>/Currents to PWM1' */ |
182 | int32_T MagManFoilwitherror_o4; /* '<S4>/MagMan Foil with error' */ |
183 | int32_T Sharedmemorycameraposition_o1;/* '<S6>/Shared memory camera position' */ |
184 | int32_T Sharedmemorycameraposition_o2;/* '<S6>/Shared memory camera position' */ |
185 | B_Positiontransformation1_Ras_T sf_Positiontransformation;/* '<S4>/Position transformation' */ |
186 | B_Positiontransformation1_Ras_T sf_Positiontransformation1;/* '<S1>/Position transformation1' */ |
187 | } B_RaspberryPrediction_T; |
188 | |
189 | /* Block states (auto storage) for system '<Root>' */ |
190 | typedef struct { |
191 | real_T MagManCoils_DSTATE; /* '<Root>/MagMan Coils' */ |
192 | real_T MagManFoilwitherror_DSTATE; /* '<S4>/MagMan Foil with error' */ |
193 | real_T Sharedmemorycameraposition_DSTA;/* '<S6>/Shared memory camera position' */ |
194 | real_T Delay_DSTATE[4]; /* '<Root>/Delay' */ |
195 | struct { |
196 | void *LoggedData[3]; |
197 | } Scope_PWORK; /* '<Root>/Scope' */ |
198 | |
199 | struct { |
200 | void *LoggedData[2]; |
201 | } Nomalizedposition1_PWORK; /* '<S1>/Nomalized position1' */ |
202 | |
203 | struct { |
204 | void *LoggedData[2]; |
205 | } Rawposition_PWORK; /* '<S1>/Raw position' */ |
206 | |
207 | struct { |
208 | void *LoggedData[2]; |
209 | } Nomalizedposition_PWORK; /* '<S4>/Nomalized position' */ |
210 | |
211 | struct { |
212 | void *LoggedData[3]; |
213 | } Scope1_PWORK; /* '<S4>/Scope1' */ |
214 | } DW_RaspberryPrediction_T; |
215 | |
216 | /* Continuous states (auto storage) */ |
217 | typedef struct { |
218 | real_T Linearmodeloftherollingball2ind[4];/* '<Root>/Linear model of the rolling ball (2 independent double integrators)' */ |
219 | } X_RaspberryPrediction_T; |
220 | |
221 | /* State derivatives (auto storage) */ |
222 | typedef struct { |
223 | real_T Linearmodeloftherollingball2ind[4];/* '<Root>/Linear model of the rolling ball (2 independent double integrators)' */ |
224 | } XDot_RaspberryPrediction_T; |
225 | |
226 | /* State disabled */ |
227 | typedef struct { |
228 | boolean_T Linearmodeloftherollingball2ind[4];/* '<Root>/Linear model of the rolling ball (2 independent double integrators)' */ |
229 | } XDis_RaspberryPrediction_T; |
230 | |
231 | #ifndef ODE1_INTG |
232 | #define ODE1_INTG |
233 | |
234 | /* ODE1 Integration Data */ |
235 | typedef struct { |
236 | real_T *f[1]; /* derivatives */ |
237 | } ODE1_IntgData; |
238 | |
239 | #endif |
240 | |
241 | /* Parameters (auto storage) */ |
242 | struct P_RaspberryPrediction_T_ { |
243 | real_T km4pi[9]; /* Variable: km4pi |
244 | * Referenced by: '<S4>/Sentinel Calibration matrix' |
245 | */ |
246 | real_T km4piCam[9]; /* Variable: km4piCam |
247 | * Referenced by: '<S1>/Sentinel Calibration matrix1' |
248 | */ |
249 | real_T Linearmodeloftherollingball2ind[2];/* Computed Parameter: Linearmodeloftherollingball2ind |
250 | * Referenced by: '<Root>/Linear model of the rolling ball (2 independent double integrators)' |
251 | */ |
252 | real_T Linearmodeloftherollingball2i_l[2];/* Computed Parameter: Linearmodeloftherollingball2i_l |
253 | * Referenced by: '<Root>/Linear model of the rolling ball (2 independent double integrators)' |
254 | */ |
255 | real_T Linearmodeloftherollingball2i_h[2];/* Computed Parameter: Linearmodeloftherollingball2i_h |
256 | * Referenced by: '<Root>/Linear model of the rolling ball (2 independent double integrators)' |
257 | */ |
258 | real_T Linearmodeloftherollingball2i_a[4];/* Expression: [0,1.5,0,2] |
259 | * Referenced by: '<Root>/Linear model of the rolling ball (2 independent double integrators)' |
260 | */ |
261 | real_T ReferenceForce_Value[2]; /* Expression: [0.05, -0.05] |
262 | * Referenced by: '<Root>/Reference Force' |
263 | */ |
264 | real_T Delay_InitialCondition; /* Expression: 0.0 |
265 | * Referenced by: '<Root>/Delay' |
266 | */ |
267 | real_T L_Gain; /* Expression: 0.15 |
268 | * Referenced by: '<Root>/L' |
269 | */ |
270 | uint32_T Delay_DelayLength; /* Computed Parameter: Delay_DelayLength |
271 | * Referenced by: '<Root>/Delay' |
272 | */ |
273 | }; |
274 | |
275 | /* Real-time Model Data Structure */ |
276 | struct tag_RTM_RaspberryPrediction_T { |
277 | const char_T *errorStatus; |
278 | RTWExtModeInfo *extModeInfo; |
279 | RTWSolverInfo solverInfo; |
280 | X_RaspberryPrediction_T *contStates; |
281 | int_T *periodicContStateIndices; |
282 | real_T *periodicContStateRanges; |
283 | real_T *derivs; |
284 | boolean_T *contStateDisabled; |
285 | boolean_T zCCacheNeedsReset; |
286 | boolean_T derivCacheNeedsReset; |
287 | boolean_T blkStateChange; |
288 | real_T odeF[1][4]; |
289 | ODE1_IntgData intgData; |
290 | |
291 | /* |
292 | * Sizes: |
293 | * The following substructure contains sizes information |
294 | * for many of the model attributes such as inputs, outputs, |
295 | * dwork, sample times, etc. |
296 | */ |
297 | struct { |
298 | uint32_T checksums[4]; |
299 | int_T numContStates; |
300 | int_T numPeriodicContStates; |
301 | int_T numSampTimes; |
302 | } Sizes; |
303 | |
304 | /* |
305 | * SpecialInfo: |
306 | * The following substructure contains special information |
307 | * related to other components that are dependent on RTW. |
308 | */ |
309 | struct { |
310 | const void *mappingInfo; |
311 | } SpecialInfo; |
312 | |
313 | /* |
314 | * Timing: |
315 | * The following substructure contains information regarding |
316 | * the timing information for the model. |
317 | */ |
318 | struct { |
319 | uint32_T clockTick0; |
320 | uint32_T clockTickH0; |
321 | time_T stepSize0; |
322 | uint32_T clockTick1; |
323 | uint32_T clockTickH1; |
324 | time_T tFinal; |
325 | SimTimeStep simTimeStep; |
326 | boolean_T stopRequestedFlag; |
327 | time_T *t; |
328 | time_T tArray[2]; |
329 | } Timing; |
330 | }; |
331 | |
332 | /* Block parameters (auto storage) */ |
333 | extern P_RaspberryPrediction_T RaspberryPrediction_P; |
334 | |
335 | /* Block signals (auto storage) */ |
336 | extern B_RaspberryPrediction_T RaspberryPrediction_B; |
337 | |
338 | /* Continuous states (auto storage) */ |
339 | extern X_RaspberryPrediction_T RaspberryPrediction_X; |
340 | |
341 | /* Block states (auto storage) */ |
342 | extern DW_RaspberryPrediction_T RaspberryPrediction_DW; |
343 | |
344 | /* Model entry point functions */ |
345 | extern void RaspberryPrediction_initialize(void); |
346 | extern void RaspberryPrediction_step(void); |
347 | extern void RaspberryPrediction_terminate(void); |
348 | |
349 | /* Real-time Model object */ |
350 | extern RT_MODEL_RaspberryPrediction_T *const RaspberryPrediction_M; |
351 | |
352 | /*- |
353 | * The generated code includes comments that allow you to trace directly |
354 | * back to the appropriate location in the model. The basic format |
355 | * is <system>/block_name, where system is the system number (uniquely |
356 | * assigned by Simulink) and block_name is the name of the block. |
357 | * |
358 | * Use the MATLAB hilite_system command to trace the generated code back |
359 | * to the model. For example, |
360 | * |
361 | * hilite_system('<S3>') - opens system 3 |
362 | * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 |
363 | * |
364 | * Here is the system hierarchy for this model |
365 | * |
366 | * '<Root>' : 'RaspberryPrediction' |
367 | * '<S1>' : 'RaspberryPrediction/Camera position' |
368 | * '<S2>' : 'RaspberryPrediction/Currents to Force' |
369 | * '<S3>' : 'RaspberryPrediction/Currents to PWM1' |
370 | * '<S4>' : 'RaspberryPrediction/Foil position ' |
371 | * '<S5>' : 'RaspberryPrediction/Force to Currents' |
372 | * '<S6>' : 'RaspberryPrediction/Camera position/Camera position from shared memory' |
373 | * '<S7>' : 'RaspberryPrediction/Camera position/Position transformation1' |
374 | * '<S8>' : 'RaspberryPrediction/Currents to Force/Nonlinearity of magnetic force' |
375 | * '<S9>' : 'RaspberryPrediction/Foil position /Position transformation' |
376 | * '<S10>' : 'RaspberryPrediction/Force to Currents/Embedded MATLAB Function' |
377 | */ |
378 | #endif /* RTW_HEADER_RaspberryPrediction_h_ */ |
379 | |