Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > PID control function for PSoC 3

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



PID control function for PSoC 3
Moderator:
RKRM

Post Reply
Follow this topic



PID control function for PSoC 3

pnielsen3 posted on 08 Nov 2012 9:09 AM PST
Top Contributor
107 Forum Posts

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

 

Thnak You,

Philip Nielsen

 




Re: PID control function for PSoC 3

danaaknight posted on 08 Nov 2012 10:40 AM PST
Top Contributor
1773 Forum Posts

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.

 

 



Re: PID control function for PSoC 3

pnielsen3 posted on 08 Nov 2012 11:13 AM PST
Top Contributor
107 Forum Posts

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



Re: PID control function for PSoC 3

pnielsen3 posted on 08 Nov 2012 11:44 AM PST
Top Contributor
107 Forum Posts

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



Re: PID control function for PSoC 3

hli posted on 08 Nov 2012 11:51 AM PST
Top Contributor
675 Forum Posts

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 .

 



Re: PID control function for PSoC 3

danaaknight posted on 08 Nov 2012 01:24 PM PST
Top Contributor
1773 Forum Posts

@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.

 



Re: PID control function for PSoC 3

danaaknight posted on 08 Nov 2012 01:26 PM PST
Top Contributor
1773 Forum Posts

A fairly good overview -

 

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

 

Regards, Dana.



Re: PID control function for PSoC 3

pnielsen3 posted on 09 Nov 2012 09:15 AM PST
Top Contributor
107 Forum Posts

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



Re: PID control function for PSoC 3

danaaknight posted on 09 Nov 2012 09:39 AM PST
Top Contributor
1773 Forum Posts

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.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20