Help Needed! Simulating PID Controller in Simulink - Mark's Project

AI Thread Summary
Mark is seeking guidance on simulating a PID controller in Simulink for a temperature control project, as he has limited experience with the software. He asks for foundational tips on creating a Simulink model, optimizing it, and simulating the plant. A suggestion is made to consider coding the controller in C, providing a pseudo-code example for implementing the PID algorithm. Additionally, it is advised to incorporate hysteresis in the temperature control system to prevent constant cycling. Overall, the discussion emphasizes the importance of tuning the PID parameters for effective system response.
mark.strong
Messages
1
Reaction score
0
Hello

I'm a student working on a project in temperature control. I have to investigate some of the properties of a standard PID controller. Sadly my project supervisor is not very helpful and I was hoping somebody here could offer me a litte guidance. I would like to simulate my controller in Simulink to see if my mesured results match up to what the simulation predicts. However my knowledge of Simulink is very basic and so I'm not making much progress. I had the following questions:

What are th basics that one needs to keep in mind to make a simulink model?
How can I make the best model in simulink?
How do I simulate the plant in simulink?

Any ideas/tips/suggestions would be greatly appreciated.

Thanks
Mark
 
Engineering news on Phys.org
Recommend just writing it in C or something you're more familiar with. Here is your pseudo-code:

previous_error = 0
integral = 0

start:
error = setpoint - actual_position
integral = integral + (error*dt)
derivative = (error - previous_error)/dt
output = (Kp*error) + (Ki*integral) + (Kd*derivative)
previous_error = error
wait(dt)
goto start

You can play with Kp, Ki, and Kd to tune the system for good response. Remember, if you are simulating a temperature control system, you won't want it constantly cycling, so you will also want hysteresis in your system (i.e. leave it on too long, and leave it off for too long so that you don't break the darn thing).
 
Posted June 2024 - 15 years after starting this class. I have learned a whole lot. To get to the short course on making your stock car, late model, hobby stock E-mod handle, look at the index below. Read all posts on Roll Center, Jacking effect and Why does car drive straight to the wall when I gas it? Also read You really have two race cars. This will cover 90% of problems you have. Simply put, the car pushes going in and is loose coming out. You do not have enuff downforce on the right...
Thread 'Physics of Stretch: What pressure does a band apply on a cylinder?'
Scenario 1 (figure 1) A continuous loop of elastic material is stretched around two metal bars. The top bar is attached to a load cell that reads force. The lower bar can be moved downwards to stretch the elastic material. The lower bar is moved downwards until the two bars are 1190mm apart, stretching the elastic material. The bars are 5mm thick, so the total internal loop length is 1200mm (1190mm + 5mm + 5mm). At this level of stretch, the load cell reads 45N tensile force. Key numbers...
I'm trying to decide what size and type of galvanized steel I need for 2 cantilever extensions. The cantilever is 5 ft. The space between the two cantilever arms is a 17 ft Gap the center 7 ft of the 17 ft Gap we'll need to Bear approximately 17,000 lb spread evenly from the front of the cantilever to the back of the cantilever over 5 ft. I will put support beams across these cantilever arms to support the load evenly

Similar threads

Back
Top