- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am currently trying to implement a PID controller. I am fairly new to PSoC so this is going to be a bit of a challenge for me. The goal of the project is to control the output RMS of a DC-to-AC converter. The way this is done is the following, the RMS value is obtained through the sampling of the output sine wave. A SIMULINK diagram of the whole operation can be seen below.
The RMS is subtracted from whatever RMS value I set. The error then passes through a PI controller and then is multiplied with the control sine wave signal. I am generating the control sine wave and triangle waves in PSoC using the WaveDAC component. Since I am trying to use the sine wave as a control signal, from my understanding, I have to pass it through some ADC in order to multiply it by the output of the PI controller.
My problem the following: I have read articles on PID using C, and from what I have read, you need to use 16 bits for floating point math. I am using the PSoC
CY8CKIT-059 which only contains one Delta-Sigma ADC which can have up to 16 bit resolution whereas the SAR can only go up to 12. Is there a way I could get around this? Like I said, I am fairly new to PSoC as well as coding in C as is. The Top Design for my project can be seen below.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
molinac5,
Since you are operating in slow-time domain (60Hz), there is no need for fast math; do PID using float or double precision. Divide project into independent sections: (1) RMS measurement, (2) PID control, (3) PWM output with sine modulation.
1. RMS measurement project example:
Measuring an RMS signal on a PSoC5 - Hackster.io
Planet Analog - Aubrey Kagan - Measuring an RMS value on a PSoC5 ...
2. for PID code example, check links in this thread
3. PSoC is able to produce modulated PWM digitally - no need for using a comparator and triangulation of analog sine.
Finally, you should estimate the time budget for this endeavor realistically - this is not a weekend project.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
molinac5,
Since you are operating in slow-time domain (60Hz), there is no need for fast math; do PID using float or double precision. Divide project into independent sections: (1) RMS measurement, (2) PID control, (3) PWM output with sine modulation.
1. RMS measurement project example:
Measuring an RMS signal on a PSoC5 - Hackster.io
Planet Analog - Aubrey Kagan - Measuring an RMS value on a PSoC5 ...
2. for PID code example, check links in this thread
3. PSoC is able to produce modulated PWM digitally - no need for using a comparator and triangulation of analog sine.
Finally, you should estimate the time budget for this endeavor realistically - this is not a weekend project.
/odissey1