## How can I create a basic mathematical model from real life systems?

## How can I create a basic mathematical model from real life systems?

(OP)

In college, a simple transfer function was given and we were asked to tune the PID which is what I am trying to do, I cant do this without the transfer function of the real model and I do not know how to get acquire it myself?

I have a degree in ME, and I am struggling to create a mathematical model to simulate a humidifier in an HVAC system.

The final goal is to model the rate of change of humidity going into a room and being returned through the duct knowing the CFM, air changes per hour, max load of the humidifier, and rate of change in the room itself as the humidifier adds moisture to the air in %RH. (Input to the PID is setpoint in %RH, room %RH being read, and output is amount of humidification to add, based on the valve position... which can be assumed %RH to add to the stream)

TL;DR: How do I model a humidifier in an HVAC system with a transfer function to tune the PID controls?

I assumed that 1/(0.1s+1) would be a simple start for the sensor lag back to the controller, but how do i model the humidity being added to the room (i assumed based on volume, max flow rate from the humidifier or current position, and percent of this air being returned through the duct),

Any help is greatly appreciated!

I have a degree in ME, and I am struggling to create a mathematical model to simulate a humidifier in an HVAC system.

The final goal is to model the rate of change of humidity going into a room and being returned through the duct knowing the CFM, air changes per hour, max load of the humidifier, and rate of change in the room itself as the humidifier adds moisture to the air in %RH. (Input to the PID is setpoint in %RH, room %RH being read, and output is amount of humidification to add, based on the valve position... which can be assumed %RH to add to the stream)

TL;DR: How do I model a humidifier in an HVAC system with a transfer function to tune the PID controls?

I assumed that 1/(0.1s+1) would be a simple start for the sensor lag back to the controller, but how do i model the humidity being added to the room (i assumed based on volume, max flow rate from the humidifier or current position, and percent of this air being returned through the duct),

Any help is greatly appreciated!

## RE: How can I create a basic mathematical model from real life systems?

see also

https://thescipub.com/pdf/10.3844/ajeassp.2017.192...

https://core.ac.uk/download/pdf/11671155.pdf

http://folk.ntnu.no/skoge/prost/proceedings/ecc-20...

TTFN (ta ta for now)

I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg

FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

## RE: How can I create a basic mathematical model from real life systems?

Thank you, system identification is the word I need to start using in my googling.

Those links were helpful, now I suppose you take the laplace? i'd love to see some real examples worked out through matlab or similiar, or by hand.

## RE: How can I create a basic mathematical model from real life systems?

Put your system at the desired operating point in manual mode on all parameters that can affect the humidity - basically air flow and humidity valve position.

In manual on your humidity controller, input a step change in valve position and measure the response of humidity over time until it reaches steady state. The step has to be big enough so you see a response, but not so big you move too far away from your operating point. It might take a couple of attempts to find the right step size. Make sure you're sampling fast enough to see the response curve. Humidity will probably change slowly if the room volume is big enough compared to the input air flow rate, so a slow sampling rate will probably work.

Use that curve to estimate a transfer function model's parameters - a first-order lag plus dead time model will probably suffice. There are a lot of web tutorials now to do this. This TF includes the effects of valve and sensor, so don't worry about modeling those separately.

Use the model parameters to tune the PID according to heuristic tuning rules. Try PI first. Do not use Ziegler-Nichols rules - they might have been first to develop heuristic rules, so they made it into all the textbooks, but their rules are too aggressive and typically lead to a response with too much overshoot and oscillation. I like CHR rules for regulators with 0 % overshoot.

Put all controllers back in auto mode and keep an eye on the humidity over a couple of days. Also keep an eye on the humidity valve position for the same period. If it moves too frequently but humidity is staying in control, detune the controller. You don't want to wear your valve out too fast. If the valve hits its travel limits and humidity goes out of control, make the tuning more aggressive. If PI isn't controlling well, try PID.

If the room volume to flow ratio is too big, it creates a long time constant, and you may have to detune your controller or move on to cascade control.

There are plenty of web tutorials on "PID tuning" if this post didn't help you.

xnuke

"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand,

Atlas Shrugged.Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

## RE: How can I create a basic mathematical model from real life systems?

I used the a first-order lag plus dead time mode all day and tried to model the room, what it turns out is i figured out i modeled the valve delay opening. which is okay.

I am now trying to add transfer functions to simulate the room (probably in feedback based on RH) and mass flow rate of humidity in, and temperature.. much harder..

## RE: How can I create a basic mathematical model from real life systems?

https://deltamotion.com/peter/py/SysID%20SOPDT.zip

The link above is a python program that will find the PID gains for a temperature control system.

You will need to edit is so it applies to humidity. Your model is a simple first order model without dead time.

I think you will find a closer model will have more parameters.

There is a text file of data called HotRod.txt. The hotrod was a wood burner tool with a temperature sensor on it. A person on PLCs.net used these small temperature systems to train students.

He send me the data in 2005.

The data consists of 3 columns.

Time, % control ouput, PV or feedback data.

The model for the SOPDT process is well known but there are 5 items that must be calculated or estimated.

The open loop gain, two time constants, a dead time, and an offset. The program tries many iterations trying different combinations of these 5 items until the error is reduced to be small.

One the model is know, it is easy to calculate the controller gains.

Install Anaconda and learn how to use it. It is free and can do the same things as Matlab and more.

https://www.anaconda.com/

I also have a YouTube channel on control theory. My channel is not the typical stuff like this gain do this and that gain does that. It is all about how to apply control theory to real world applications. My YouTube is meant for graduate students and practicing engineers. The first two videos you want to watch is

https://www.youtube.com/watch?v=qzr6eL90Aok

then

https://www.youtube.com/watch?v=lermULNDz3M

In my not so humble opinion, teachers and text books teach control theory wrong.

The should start with system identification.

You can't control what you don't understand.

None of the rest of the crap that is learned is worth anything until system identification is first mastered.

BTW, I generally have have a lot of contempt for mechanical engineers because they too often design stuff without consideration of how it is going to be controlled.

It is good that you are starting out right.

Peter Nachtwey

Delta Computer Systems

http://www.deltamotion.com

http://forum.deltamotion.com/