cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

CaDu_3933941
New Contributor II

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.

pastedImage_0.png

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,

pastedImage_4.png

0 Likes
1 Solution
odissey1
Honored Contributor II

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

Re: PID Controller

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

View solution in original post

0 Likes
2 Replies
ShipingW_81
Moderator
Moderator

Maybe you can refer to community thread PSoC 5LP PID Control and let me know if it helps.

0 Likes
odissey1
Honored Contributor II

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

Re: PID Controller

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

View solution in original post

0 Likes