Hi everyone,
I would like to do a PID controller for temperature. My temperature is read by an ADC 12bit then I would like to do the convertion to degree Celcius then feed it to the PID controller.
I checked how they did it on the example "f28379D_DCDC_Buck" and I am quiet sure to really understand it:
They first used a fixdt(0,16,12). This means :
- Unsigned data type,
- 16 bit,
- 12 fraction length.
Why did they choose Stored Integer (SI)? and why they choose 12 fraction length? This will give RealWorldValue = StoredInteger ✕ 2−FractionLength
Then the second converter is fixdt(1,32,24) means
- now it's signed data type,
- 32 bit, my guess is it because the PID controller require 32bit data type
- 24 fraction length, why did they choose fraction lengthÉ
I was curious and try on my board to feed 1V signal with 1V offset and check after each conversion the result:
As you can see the ADC conversion is good, peak is at 2700 ADC count, then 2700*2^(-12) gives 0.6592. But then I dont see any difference for the last conversion?!? What is it supposed to do?
Thank you