Date: April 2013
Location: Oshawa, Ontario
Company: UOIT
Team: Cameron, Tyler
Objective:
Using the Freescale HCS12 development board, design the control software to maintain the temperature of a chamber at a set point. Further, build a chamber with the provided materials that includes a fan for cooling and a lamp for heating. This chamber will have an additional lamp to act as a passive heat source (like sunlight on a house).
Solution:
We split into a hardware and software role. Hardware development was simple, but critical.
I built a schematic that used a low power transistor to fire a higher power transistor. Doubling this circuit I could control the lamp and the fan from the low powered Freescale board. The passive heater was always on, so I connected it directly to the power source. The temperature sensor was a thermistor, so all that was required was a balanced resister and a 5V input easily provided by the board.
Once it was tested and I was happy, I joined back into the software side of things. Tyler had already written the timers and analog-digital conversion (ADC) code, so all that was left was the settings menu and and control code. The settings menu was controlled through 3 buttons: one to enter/exit, two to move the desired temperature up and down. The control code however was more involved. We created a simple controller that turned the fan on when it was 1 degree above the set point, and turned the lamp on when it was one degree below the set point. This was a dead-zone controller, and it was too simple for our liking. We had to bump things up.
Our second method used PWM to modulate the power of the lamp and fan. We also processed the temperature to find the first derivative. Based on how far off the set point we were, and how fast it was escaping control we could increase the heating and cooler power. AKA PD control! But this wasn’t all. Now we had a system that would rarely overshoot the set point, it was time to get fancy.
Fuzzy logic was a topic that was taught in the course but never used in the lab. The downside to using it was that we could program everything in C up until this point. We decided to sketch out and build the truth tables in assembly then in-line it into the existing structure. Starting off basic, we wanted to emulate the PD control through fuzzy logic. This could be extended to add time of day and day of week functions to accommodate “power savings.” We ran one test where we improperly in-lined everything and them ran out of time before we could try again. How I wish we had more time!