Part Number: TMS320F28379D
Tool/software: Code Composer Studio
Hello everyone, I'm new to CCS and i need you to help me create a program for PID controller that control the speed of a DC motor through PWM.
I know there is a model in control Suite for PID, but i can't get it to work even like i added pid_grando.h file to librairie as shown below.
I also modified the example programm in the pdf, i added main function and my referrence and feedback values just to test the program.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include "pid_grando.h"
#include "IQmathLib.h"
#include "IQmath.lib"
#define
Uint16 output1;
/* Instance the PID module */
PID pid1={ PID_TERM_DEFAULTS, PID_PARAM_DEFAULTS, PID_DATA_DEFAULTS };
main()
{
pid1.param.Kp = _IQ(0.5);
pid1.param.Ki = _IQ(0.005);
pid1.param.Kd = _IQ(0);
pid1.param.Kr = _IQ(1.0);
pid1.param.Km =_IQ(1.0);
pid1.param.Umax= _IQ(1.0);
pid1.param.Umin= _IQ(-1.0);
}
void interrupt periodic_interrupt_isr()
{
pid1.Ref = 15; // Pass _iq inputs to pid1
pid1.Fbk = 3; // Pass _iq inputs to pid1
PID_MACRO(pid1); // Call compute macro for pid1
output1 = pid1.Out; // Access the output of pid1
}
------------------------------------------------------------------------------------------------------------------------------------
When i try to build this program i get the following error on my pid_grando.h file : identifier "_iq" is undefined
so i know that i missing something on the main main program above, can you tell me what am i missing ?