That's great to hear you are in touch with an OEM technical expert!

The thermodynamics itself isn't all that bad, but the lack of fan curves, heat transfer, and sunload functions makes this process very difficult. If he can give you some insight into how the OEMs do the calculations, it could greatly simplify your work. If you had a general idea of how they do things from the factory, the initial calibration might not be needed. Simply use the general approximation of the constants based off vehicle type (I'm sure the OEM's have general numbers in mind when they start the process too) and then fine-tune them by checking to see if the the temperature reached in a set period of time is lower or higher than what is predicted by energy balance.

You could even make it dynamic, fine-tuning the constants for a time interval based off the energy balance performance of the last interval. This would make the accuracy of the constants themselves nearly irrelevant. As you know, with multiple constants you are trying to solve for, there will be multiple sets of constants that will give the same solution, at least in the short term. By changing them dynamically, calculating the actual constants for the vehicle won't matter, because you have a solution, a set of constants, that will work for at least the next 5 minutes.

It's similar to how Solver in Excel works. Often, when using Solver in conjunction with least-squares regression to match complicated model functions to data, the constants you get are not physically possible (in the case of using Excel to model phsyical reality). Even with that in mind, the resulting solution does match the data over the range given. Eventually, the model will no longer match the data, but in the short term, it will match it very well, without actually knowing the constants.

Depending on what the mathematical equations of each function are (exponential,

power-law, hyperbolic, etc... ), all you need is a model using that sort of function (or even the whole

series of functions for all the thermodynamics inputs and outputs) and the energy balance data from the past 5 or 10 minutes. Then use Solver-methodology (I forget the numerical method used, I'll look it up in my numerical method book tonight, though it'll be much later) to tweak the constants so that the model match very closely to the constants in the past interval and apply those constants to the next interval.

Now that I think about it, an even shorter interval might be useful, to take into account varying sunloads, doors opening/closing,

windows being down, stop and go traffic, and the adding/subtracting additional passengers. Possibly 1 minute intervals?

I'm a Petroleum Engineering student, and while we are often warned about not allowing constants to range outside their phsyical boundaries when using regression with Solver in Excel, that is because we are attempting to extrapolate trends 30 or more years past the end of the data for our reserve calculations, so the model must be technically

sound, sometimes at the expense of model-data correlation. In the context of an automatic HVAC system, there is no need to extrapolate very far in the future, because you can simply take another measurement and do some quick calculations.

I've been reading all your threads on the topic, and I think you've been doing great work!

Luckily the vehicle I've chosen has simple variable resistor A/C controls (I think). It makes it a much simpler process on the

hardware side. I could probably even do it with simple digipots. Not the most elegant solution, with the system having to step up and down through all the selections (low to high fan speed, cold to hot temp, and selecting the modes, etc), but it's no worse than the way it currently is. You have to roll over each selection when doing it manually, I don't really mind if it has to spend a splt second while doing it automatically.

Hopefully the

software will soon allow coding it to save it's current position and load it when starting the following time, and just in case something crashes without saving the positions, a reset function could be written that increments the digipots until it is sure they are at a min or max value, resets the position variable, then restarts the incrementing from there. Again, not quite as elegant as a hardware solution (like the analog input feedback mentioned in the analog output board thread or storing the setting on the Brain itself), but it would work.

Thanks for all the hard work guys, you've been an inspiration!

## Bookmarks