⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c2812pmsmsim1.h

📁 dsp控制电机时与位置传感器相关程序 以及位置传感器的说明
💻 H
字号:
/*
 * File: c2812pmsmsim1.h
 *
 * Real-Time Workshop code generated for Simulink model c2812pmsmsim1.
 *
 * Model version                        : 1.287
 * Real-Time Workshop file version      : 7.0  (R2007b)  02-Aug-2007
 * Real-Time Workshop file generated on : Mon May 26 17:20:51 2008
 * TLC version                          : 7.0 (Jul 26 2007)
 * C source code generated on           : Mon May 26 17:20:56 2008
 */

#ifndef RTW_HEADER_c2812pmsmsim1_h_
#define RTW_HEADER_c2812pmsmsim1_h_
#ifndef c2812pmsmsim1_COMMON_INCLUDES_
# define c2812pmsmsim1_COMMON_INCLUDES_
#include <math.h>
#include <stddef.h>
#include <IQmathLib.h>
#include <string.h>
#include "rtwtypes.h"
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"
#include "DSP281x_Gpio.h"
#include "rtlibsrc.h"
#endif                                 /* c2812pmsmsim1_COMMON_INCLUDES_ */

#include "c2812pmsmsim1_types.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
# define rtmGetErrorStatus(rtm)        ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
# define rtmSetErrorStatus(rtm, val)   ((rtm)->errorStatus = (val))
#endif

#ifndef rtmStepTask
# define rtmStepTask(rtm, idx)         ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)
#endif

#ifndef rtmGetStopRequested
# define rtmGetStopRequested(rtm)      ((void*) 0)
#endif

/* Block signals (auto storage) */
typedef struct {
  int32_T RampControl_o2;              /* '<S24>/Ramp Control' */
  int32_T DataTypeConversion[3];       /* '<S4>/Data Type Conversion' */
  int32_T IQN1toIQN2;                  /* '<S32>/IQN1 to IQN2' */
  int32_T RampControl_o1;              /* '<S24>/Ramp Control' */
  int32_T Add1;                        /* '<S20>/Add1' */
  int32_T Torquedemand;                /* '<S5>/PID Controller' */
  int32_T ParkTransformation_o2;       /* '<S10>/Park Transformation' */
  int32_T ParkTransformation_o1;       /* '<S10>/Park Transformation' */
  int32_T Switch1;                     /* '<S20>/Switch1' */
  int32_T PIDController1;              /* '<S12>/PID Controller1' */
  int32_T desired_gain;                /* '<S12>/desired_gain' */
  int32_T IQNxint2;                    /* '<S22>/IQN x int2' */
  int16_T DataTypeConversion2;         /* '<S32>/Data Type Conversion2' */
  uint16_T C28xQEP;                    /* '<S2>/C28xQEP' */
  uint16_T CAPFIFOA1;                  /* '<S19>/CAPFIFOA1' */
  uint16_T Saturation;                 /* '<S19>/Saturation' */
  uint16_T C28xADC[3];                 /* '<S2>/C28x ADC' */
  uint16_T CAP1FBOT;                   /* '<S28>/CAP1FBOT' */
  uint16_T shift;                      /* '<S27>/shift' */
  uint16_T DataTypeConversion1;        /* '<S16>/Data Type Conversion1' */
  uint16_T DataTypeConversion2_o;      /* '<S16>/Data Type Conversion2' */
  uint16_T Add;                        /* '<S32>/Add' */
} BlockIO_c2812pmsmsim1;

/* Block states (auto storage) for system '<Root>' */
typedef struct {
  int32_T RampControl_RAMP_DLY_CNTL;   /* '<S24>/Ramp Control' */
  int32_T RampControl_PREV_SETPOINT;   /* '<S24>/Ramp Control' */
  int32_T RampGenerator_ANGLE_REG;     /* '<S24>/Ramp Generator' */
  int32_T PIDController_PREV_OUT;      /* '<S12>/PID Controller' */
  int32_T PIDController_UI_REG3;       /* '<S12>/PID Controller' */
  int32_T PIDController_UD_REG3;       /* '<S12>/PID Controller' */
  int32_T PIDController_PREV_OUT_a;    /* '<S5>/PID Controller' */
  int32_T PIDController_UI_REG3_h;     /* '<S5>/PID Controller' */
  int32_T PIDController_UD_REG3_i;     /* '<S5>/PID Controller' */
  int32_T PIDController1_PREV_OUT;     /* '<S12>/PID Controller1' */
  int32_T PIDController1_UI_REG3;      /* '<S12>/PID Controller1' */
  int32_T PIDController1_UD_REG3;      /* '<S12>/PID Controller1' */
  int32_T UnitDelay_DSTATE[2];         /* '<S15>/Unit Delay' */
  int32_T Add_DWORK1;                  /* '<S20>/Add' */
  int32_T UnitDelay_DSTATE_n;          /* '<S20>/Unit Delay' */
  uint16_T UnitDelay2_DSTATE;          /* '<S19>/Unit Delay2' */
  uint16_T UnitDelay1_DSTATE;          /* '<S19>/Unit Delay1' */
  uint16_T UnitDelay_DSTATE_o;         /* '<S32>/Unit Delay' */
  uint16_T C28xQEP_OLD_PULSE_COUNT;    /* '<S2>/C28xQEP' */
} D_Work_c2812pmsmsim1;

/* Invariant block signals (auto storage) */
typedef struct {
  const int32_T Add;                   /* '<S20>/Add' */
} ConstBlockIO_c2812pmsmsim1;

/* Real-time Model Data Structure */
struct RT_MODEL_c2812pmsmsim1 {
  const char_T *errorStatus;

  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    struct {
      uint16_T TID[2];
    } TaskCounters;
  } Timing;
};

/* Block signals (auto storage) */
extern BlockIO_c2812pmsmsim1 c2812pmsmsim1_B;

/* Block states (auto storage) */
extern D_Work_c2812pmsmsim1 c2812pmsmsim1_DWork;
extern ConstBlockIO_c2812pmsmsim1 c2812pmsmsim1_ConstB;/* constant block i/o */

/* Model entry point functions */
extern void c2812pmsmsim1_SetEventsForThisBaseStep(boolean_T *eventFlags);
extern void c2812pmsmsim1_initialize(boolean_T firstTime);
extern void c2812pmsmsim1_step(int_T tid);
extern void c2812pmsmsim1_terminate(void);

/* Real-time Model object */
extern RT_MODEL_c2812pmsmsim1 *c2812pmsmsim1_M;

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/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('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : c2812pmsmsim1
 * '<S1>'   : c2812pmsmsim1/F2812 eZdsp
 * '<S2>'   : c2812pmsmsim1/Inputs
 * '<S3>'   : c2812pmsmsim1/Motor Control Algorithm
 * '<S4>'   : c2812pmsmsim1/Scaling
 * '<S5>'   : c2812pmsmsim1/speed controller
 * '<S6>'   : c2812pmsmsim1/Inputs/Environment Controller
 * '<S7>'   : c2812pmsmsim1/Inputs/Environment Controller1
 * '<S8>'   : c2812pmsmsim1/Inputs/Subsystem
 * '<S9>'   : c2812pmsmsim1/Motor Control Algorithm/Environment Controller2
 * '<S10>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors
 * '<S11>'  : c2812pmsmsim1/Motor Control Algorithm/PWM scaling
 * '<S12>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control
 * '<S13>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/Subsystem
 * '<S14>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/Subsystem1
 * '<S15>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/saturation
 * '<S16>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/saturation/analog outputs
 * '<S17>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/saturation/analog outputs/Shift Arithmetic
 * '<S18>'  : c2812pmsmsim1/Motor Control Algorithm/Generating Raw Space Vectors/control/saturation/analog outputs/Shift Arithmetic1
 * '<S19>'  : c2812pmsmsim1/Scaling/CAP3INT
 * '<S20>'  : c2812pmsmsim1/Scaling/IIR filter
 * '<S21>'  : c2812pmsmsim1/Scaling/Shift Arithmetic
 * '<S22>'  : c2812pmsmsim1/Scaling/Subsystem
 * '<S23>'  : c2812pmsmsim1/Scaling/multiply by -1
 * '<S24>'  : c2812pmsmsim1/Scaling/startup_ramp
 * '<S25>'  : c2812pmsmsim1/Scaling/CAP3INT/Environment Controller
 * '<S26>'  : c2812pmsmsim1/Scaling/CAP3INT/Environment Controller1
 * '<S27>'  : c2812pmsmsim1/Scaling/CAP3INT/Shift Arithmetic
 * '<S28>'  : c2812pmsmsim1/Scaling/CAP3INT/Subsystem
 * '<S29>'  : c2812pmsmsim1/Scaling/IIR filter/Shift Arithmetic1
 * '<S30>'  : c2812pmsmsim1/Scaling/Subsystem/Environment Controller1
 * '<S31>'  : c2812pmsmsim1/Scaling/Subsystem/Environment Controller3
 * '<S32>'  : c2812pmsmsim1/Scaling/Subsystem/speed_calculator
 */
#endif                                 /* RTW_HEADER_c2812pmsmsim1_h_ */

/* File trailer for Real-Time Workshop generated code.
 *
 * [EOF]
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -