What is best way to control heater using a PSOC5

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

cross mob
Doorknob
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

Trying to control 3 thermal coils using two thermocouples... I have the thermocouples working great but struggling to regulate my metal barrel with the 3 coils attached. Does anyone have a suggestion for controlling heat well using the PSoC5

0 Likes
1 Solution

ScCl,

For PID controller implementation please check this thread

Re: PID Controller

The derivative term is not needed for boiler application, which makes it simpler. Since "boiler" sounds like 50-gallon apparatus, the PWM can be simple ON-OFF with with intervals in seconds. I would use a single temperature sensor and run heaters in 3-bit fashion, e.g. two heaters ON and #3 is 50% duty cycle, etc.

/odissey1

View solution in original post

0 Likes
11 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

ScCl,

Three heaters with  two thermocouples - smells like a moonshine rectificator! Why there are two thermocouples? Are they for temperature uniformity check? Same about having 3 heaters, are they controlled separately? To better understand the issue: what is the size of the apparatus?

/odissey1

0 Likes

Odissey .. you are right I do need a third thermal couple.  I was going to just control my first heater and adjust the second two based on the first one.  I thought it would be easy just to turn it on and read the temperature and adjust the duty cycle of  my PWM's.  I did my best in code to regulate the first but I had a heck of a time getting even a single heater it to regulate properly.  After some research I know understand the best way to do what I want to do is with a PID control loop.  I spent all weekend studying up on this type of control system.

From my understanding I need to implement this type of control  system in my PSoC5 with measuring just as you noted 3 thermal couples to do it properly.

pastedImage_0.png

In the end this is the full function I need to implement.

pastedImage_1.png

I am in the process of trying to do this in my system.  I searched the cypress site and id not see any information as if some one else has done this before.  I will do my best to share my finds so others may learn.

0 Likes

ScCl,

For PID controller implementation please check this thread

Re: PID Controller

The derivative term is not needed for boiler application, which makes it simpler. Since "boiler" sounds like 50-gallon apparatus, the PWM can be simple ON-OFF with with intervals in seconds. I would use a single temperature sensor and run heaters in 3-bit fashion, e.g. two heaters ON and #3 is 50% duty cycle, etc.

/odissey1

0 Likes
lock attach
Attachments are accessible only for community members.

Thanks for links ... I found Brett's "Beginner's PID" most useful and informative.  Brett's shows a basic PID in a Ardunio implantation with step by step modifications to make it robust industrial controller.  Now that  I know basically there application and  function I am sure surprised that there is no information as to the implementation of a PID from Cypress on line.  I did not down load his version from there website ... which i do plan on doing in the future.  I did however do my own basic and it seems to work OK for a first try.  I will attach my PID project i tested.  My issue is i can not get my temperature accurate from my CY8CKIT-059 to a daughter board I made.  I suppose I have some noise I am not accounting for.  I was hoping some one would have some insight as to why i can not get good readings for temperature.  I am running a good 10 degrees off were it should be.  I was wondering if i did not account for separating the digital grounds from the analog grounds??

In my real project i will be measuring 3 thermal-couples not just one.  However I tried just one and am getting the same bad readings.

I will attach shots of my PCB for review for layout problems.

pastedImage_3.png

pastedImage_4.png

pastedImage_5.png

pastedImage_6.png

Thanks

Scott

0 Likes

I found this information from TimWescott very useful for tuning a PID.  He explains his points very well with examples which for for a not so bright guy like me I found very  helpful!

https://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pdf

My favorite

https://m.eet.com/media/1112634/f-wescot.pdf

0 Likes

ScCl,

Are those thermocouples hard-built into the boiler? Can you use, for example, digital thermometers like DS18B20? They are very easy to interface with PSoC using this component, and they are immune to analog noise, providing 0.1C accuracy

Component to read DS18B20 digital temperature sensors

/odissey1

0 Likes

Odissey ... that part would be nice to use but the temperatures i am needing to measure are between 200-500 degrees centigrade.  So thermal couples are my only choice i believe.  If i can not get it to work, but according to the application notes AN75511, CE219905 and CE219929 and one other i cant remember its possible to get under 1% accuracy.  I am not seeing this with my testing at all and i have tried both the low end and the high end solutions.  I am going to spend a few more days seeing if i can resolve my issues, if  i can not i am going to try a integrated solution from Maxim.  There part number MAX31855  works on a SPI buss.  It not super accurate but more than acceptable for my project.   It would be nice however to get  my 059/Daughter board solution run right if possible.

Scott

0 Likes

Odissey,

Can your component for the D18B20 be modified to measure the temperatures on a newer Maxim 1 Wire Buss part MAX31850/MAX31851 designed to measure thermocouples?  This would be very helful if it would be easy to change.

Thanks

Scott

0 Likes

ScCl

I looked through MAX31850/MAX31851 datasheet and 1-wire communication protocol seems similar. That is not a guarantee it will work but it may be helpful. If you decide to go this route, I will send you links to other 1-wire codes, which may be simple, as they don't read all sensors in parallel. On the other side, this chip looks pricy ($11) to me, so it's unlikely that I will buy it for testing at this moment.

At the same time, Isee similar MAX31855 chips with SPI protocol at low price of $2.5, which looks more promising, as PSoC5 has hardware SPI blocks.

/odissey1

0 Likes

Odissey,

I looked at the MAX31855 but it has a data word that is 32 bits and the SPI component in PSoC only handles 16 bits.  I also notice that the SPI component only allows for one chip select in PSoC5 were the one in PSoC4 allows for more than one.  Is there something in my very limited experience in SPI applications that i am missing to utilize such a part?

ScCL

0 Likes

ScCl,

Can't say anything on 16/32 SPI word length. According to the timing diagram there is no max limit on clock period. Simple solution is to pull the Clock pin up/dn and to read state of the data pin in code. This should work if there is no other fast algorithms running. I would check Sparkfun/Adafruit for code.

/odissey1

0 Likes