2004 Microchip Technology Inc.
DS00908A-page 21
AN908
ACIM.c
/**********************************************************************
* *
* Author: John Theys/Dave Ross *
* *
* Filename: ACIM.c *
* Date: 10/31/03 *
* File Version: 3.00 *
* *
* Tools used: MPLAB -> 6.43 *
* Compiler -> 1.20.00 *
* *
* Linker File: p30f6010.gld *
* *
* *
***********************************************************************
*10/31/03 2.00 Released Motor runs fine, still some loose ends
*
*12/19/03 2.01 Cleaned up structure, created UserParms.h for all user defines.
*
*02/12/043.00-Removed unnecessary files from project.
*
-Changed iRPM to int to correct floating point calc problems.
*
-CalcVel() and velocity control loop only execute after number of loop periods
*
specified by iIrpPerCalc.
*
-Added iDispLoopCount variable to schedule execution of display and button routines
*
-trig.s file changed to use program space for storage of sine data.
*
-Added DiagnosticsOutput() function that uses output compare channels to
*
output control variable information.
*
-Added TORQUE_MODE definition to bypass velocity control loop.
*
-Turned off SATDW bit in curmodel.s file. The automatic saturation feature prevents
*
slip angle calculation from wrapping properly.
************************************************************************
*
Code Description
*
*
This file demonstrates Vector Control of a 3 phase ACIM using the dsPIC30F.
*
SVM is used as the modulation strategy.
***********************************************************************/
/*************************** GLOBAL DEFINITIONS ***********************/
#define INITIALIZE
#include "Motor.h"
#include "Parms.h"
#include "Encoder.h"
#include "SVGen.h"
#include "ReadADC.h"
#include "MeasCurr.h"
#include "CurModel.h"
#include "FdWeak.h"
#include "Control.h"
#include "PI.h"
#include "Park.h"
#include "OpenLoop.h"
#include "LCD.h"
#include "bin2dec.h"
#include "UserParms.h"
/*********************** END OF GLOBAL DEFINITIONS ********************/
unsigned short uWork;
short iCntsPerRev;
short iDeltaPos;