This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: PID control problem

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

I set the ADC and interrupt for the boost pid circuit, and the PID setting is rewritten according to the Wikipedia code.

zh.wikipedia.org/.../PID controller

previous_error = 0

integral = 0

start:

error = setpoint-measured_value

integral = integral + error*dt

output = Kp*error + Ki*integral

previous_error = error

wait(dt)

goto start

And expected to use PID to control the boost output voltage, I connected the adc A0 pin on the f28335 (as shown in the picture),

And use a variable resistance of 10k to simulate the voltage received in AO/100/4095*600 (analog input 0~600 output voltage)

The current problem is that CMPA.half.CMPA will be full

May I ask what restrictions should I add, when boost output comes to my pid controller, it can control pwm?


The attachment is my code, the ccs version is Version: 6.1.1.00022