PID control function for PSoC 3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am trying to create a auto tuning PID function for a RH controller. Any ideas?

   

 

   

Thnak You,

   

Philip Nielsen

0 Likes
15 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There is a PSOC 1 project you could adopt / port to PSOC 3 -

   

 

   

      http://www.psocdeveloper.com/docs/appnotes/an-mode/detail/an-pointer/an2208.html

   

 

   

This is not auto tune, but you could always modify.

   

 

   

What are the requirements for the autotune functionality ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I have a RH controller. I am using a 100 ohm RTD sensor with a 300 pF humidity sensor. The sensor is compensated with temp.

   

Now I want to try and auto tune the output. I don't know the response time for the SES heater and cooler.

   

 

   

Thank You for replying to my email.

   

 

   

Philip

0 Likes
Anonymous
Not applicable

That was an excelent link. Thank you very much for showing me the link. I need to study the PDF file allot more.

   

 

   

Thanks

   

 

   

Philip

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Auto-tuning is difficult. Since we don't know how your control loop should look like, it is difficult to auto-tune the parameters (esp. when you don't know the parameters of the loop).

   

It might be better to measure the behavior of your control loop when it is oscillating, and then use the Ziegler-Nichols-method: http://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method .

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@hli, interesting reference.

   

 

   

This seems to state in a degenerative way, if I can't get the loop to oscillate, eg. not

   

enough gain, just use, what is in effect a step response, to characterize the T(s). If

   

you take the response at two different time points, and you know the order of the PID,

   

then the rest falls out.

   

 

   

Or a test cycle, breaking the loop, to characterize the feed forward paths and feedback

   

paths.

   

 

   

Quite a few ways to at at this I suspect.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

A fairly good overview -

   

 

   

http://en.wikipedia.org/wiki/PID_controller

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Everyones input is correct. I have built analog PIDS a long time ago. But it may be simpler to buy an off the shelf PID controler.

   

I am looking at PID controlers on the Web. I have seen them form $80 to $300. The only problem that I face is the PSoC 3 has a DAC that is only 8 bits. I am looking at adding an external DAQ and control it with SPI. I would like at least a 12 bit DAC.

   

 

   

Thanks For the great feedback. I deal PIDS all the time at work. And they are very tricky to tune.

   

 

   

Philip Nielsen

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Expanding DAC resolution, but may be too slow for PID -

   

 

   

http://www.cypress.com/?rID=47478

   

 

   

You could also use a PWM as a DAC. You would have to take into account

   

settling time of its mandatory LPF or Integrator on its output. Ap notes from

   

some other vendors -

   

 

   

http://www.ti.com/lit/an/slaa497/slaa497.pdf

   

http://documentation.renesas.com/doc/products/region/rtas/mpumcu/apn/dac.pdf

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi Dana,

   

 

   

There has been quite a bit of re-organisation in the PSOC sites and the following link does not work anymore.

   

http://www.psocdeveloper.com/docs/appnotes/an-mode/detail/an-pointer/an2208.html

   

 

   

Can you provide a new working link or send me the PSOC Project? we are doing something similar and would like to save some time.

   

Regards,

   

C.Cheng

0 Likes
Anonymous
Not applicable
0 Likes
Anonymous
Not applicable

Hi HL,

   

 

   

Thanks for the link to the AN2208 Appnote (in PDF).

   

Do you happen to know where is the PSOC Project (code etc) located?  Modifying existing Project Codes will be much easier.

   

Regards,

   

Ccheng

0 Likes
Anonymous
Not applicable

 sorry, Can find the zip file. you can submit a case to cypress, they should be able to find it for you.

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

AN2208 file attached.

   

 

   

Regards, Dana.

0 Likes
RoCa_1222471
Level 2
Level 2
First like received Welcome!

There are PID project examples also for PSOC4 devices using PSOC creator components?  Thank you

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum, Roby!

   

There are no examples for PID on a PSoC4 yet, but all components needed are provided in a PSoC4 chip. Some external connections will be needed for the opamps, but ADC, comparator, PWM and UART are all available in PSoC4.

   

 

   

Bob

   

PS: Just a hint: Do not hijack a two year old thread, rather create a new one.

0 Likes