How to fix Undefined reference to `arm_pid_init_q31', error?
Hi, everyone!
I am trying to implement PID controller from arm_math library. I use this code as kind of example for this
https://stm32f4-discovery.net/2014/11/project-03-stm32f4xx-pid-controller/
I am getting error - Undefined reference to `arm_pid_init_q31',
There is nothing much regarding PID in my code, I copied only lines regarding PID.
&sharpinclude <arm_math.h>
&sharpdefine PID_PARAM_KP 10 /* Proporcional */
&sharpdefine PID_PARAM_KI 10 /* Integral */&sharpdefine PID_PARAM_KD 10 /* Derivative */uint32_t PID_ERROR;
arm_pid_instance_q31 PID;
PID.Kp = PID_PARAM_KP; /* Proporcional */ PID.Ki = PID_PARAM_KI; /* Integral */ PID.Kd = PID_PARAM_KD; /* Derivative */ arm_pid_init_q31(&PID, 1);while(1)
{
output_voltage_mv = (3300*VOUT * 21) / 4096;
PID_ERROR = Vreg - output_voltage_mv; duty_cycle = arm_pid_q31(&PID, PID_ERROR);}
Can any help please?
#pid #arm_math