07-09-14, 04:41 PM | #81 | |
Supreme EcoRenovator
|
Quote:
Last edited by jeff5may; 07-09-14 at 07:55 PM.. |
|
The Following User Says Thank You to jeff5may For This Useful Post: | Ormston (07-09-14) |
07-09-14, 04:52 PM | #82 |
Helper EcoRenovator
Join Date: Jul 2014
Location: Hungary
Posts: 34
Thanks: 0
Thanked 16 Times in 10 Posts
|
my controller source code
Hello,
First of all thank you for kind welcome! I added my source code to github. As I can't add links yet, please go to https:// github dot com slash takyka slash heatpump to get it. The starting point is "heatpump.ino" I know, the code is ugly looking, sorry for that. But at least no goto used at all. :-) There is Hungarian text in some places (presented by the software on the web status page) I will translate it to English sometime. I will start a new thread here to discuss the sw in detail (if you want to). T. |
07-09-14, 05:29 PM | #83 |
Apprentice EcoRenovator
Join Date: Mar 2013
Location: UK
Posts: 131
Thanks: 13
Thanked 35 Times in 32 Posts
|
Last year i wrote a overly complicated weather compensation function to control our ASHP (we have no internal thermostat).
It was based on the method Worcester Bosch(Rebadged IVT) GSHP's use and matched the heat curves in their manual perfectly. All winter i adjusted the settings, the heat curve, the ofset, the hysteresis and sometimes the house was the correct temperature. Then the weather would change and we'd be too hot again, more adjustment and a week later it'd be chilly in the house. By march when i turned the heating off we had is sussed and the only time the system didn't cope well was after a few days with very high solar gain. The short version, it took a whole winter of messing to get the weather compensation set correctly. Towards the end of winter i was asked to look at a GSHP and a ASHP at 2 properties owned by a local builder, both were alarming due to incorrectly set weather compensation with the heat pumps objecting to the return temp or the water being far higher than they expected. The heat pumps were fighting the internal thermostats. The GSHP used the system i had copied(I had commissioned the heat pump for him 2 years earlier) so i made a guess at how much to turn it down and told him to call me if it still alarmed. Nothing yet The ASHP (by the same manufacturer) had a complete different method of setting up the weather compensation. One that doesn't involve picking a number between 1 and 10 and waiting to see what happens and even better in can be re-created in Arduino with only line of code. For anyone that wants weather compensation and hasn't fallen asleep yet. DesiredWaterTemp = map(osTemp, coldOS, hotOS, coldWater, hotWater); Descriptions DesiredWaterTemp is the return temp from your heat emitter or buffer tank. osTemp it the current outside temp coldOS is the outside temp on a cold day, you need to record this value and the required water return temp needed to heat your house. coldWater is the return water temp you recorded on the above cold day hotOS is the outside temp on a warm day (that still requires heating), you need to record this value and the required water return temp needed to heat your house. hotWater is the return water temp you recorded on the above hot day Hope someone finds this useful Steve |
07-09-14, 09:47 PM | #84 |
Supreme EcoRenovator
|
AC,
OK, I did some research about the RS485 serial, and it seems to be almost just like standard (RS232) serial, only with balanced line output. The arduinos don't natively support it, so you're going to have to add an adapter. The bad new is if you use the built in serial port to translate, you will need 3 pins: D0, D1, and 1 more digital pin. So for a generic MAX485 board, you will connect the 3 digital pins, 5V, and ground to the module, totaling 5 pins. Last edited by jeff5may; 07-09-14 at 09:50 PM.. |
07-09-14, 11:01 PM | #85 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
Quote:
I've been ripping & rending on my house lately, to move things in the direction of a highly insulated room with a low-temperature hydronic floor (in preparation for the heat pump install). So, I've been more focused on nail pounding, than keyboard pounding. So, I think I'll build a board using the hardware you choose, but my application will be a bit different... so that will get us at least that much closer closer to a GPC board, made from very widely available hardware. I understand the thinking behind having a serial port because that can not only allow monitoring & logging, but it opens the possibility of making a standalone controller become a sub controller in a more complex setup... right? So jeff5may, if you think we have enough pins to do the job, let's go with it. Keep me current as to what you consider to be the hardware requirements, and I'll do an order... So far, it looks like:
* * * BTW, I was having a bit of trouble getting to takyka's code at 'github', so HERE_IS_A_LINK to his code, which he has generously shared with us. Thank you so much! -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... Last edited by AC_Hacker; 07-09-14 at 11:16 PM.. |
|
07-09-14, 11:09 PM | #86 |
Supreme EcoRenovator
Join Date: Oct 2008
Location: Austin, TX
Posts: 1,154
Thanks: 14
Thanked 257 Times in 241 Posts
|
STM32 is cheaper and more capable than Arduino Mega.
__________________
To my surprise, shortly after Naomi Wu gave me a bit of fame for making good use of solar power, Allie Moore got really jealous of her... |
07-10-14, 06:13 AM | #87 |
Helper EcoRenovator
Join Date: Jul 2014
Location: Hungary
Posts: 34
Thanks: 0
Thanked 16 Times in 10 Posts
|
What functionality is planned here for the controller, a 32bit microcontroller is not mandatory. However a good thing.
I don't have any problem, handling floating point numbers by Mega even it has to deal lot's of stuff concurrently. Having a 32bit controller is good thing, but huge advantage of arduino, the popularity, convenient, beginner friendly development, wide range of shields and libraries. These things help work off 8bit controller's handicap. Can be I'm wrong here, I don't know nothing about STM32 ecosystem. Related to 1wire, I'm not afraid to share one 1w line with multiple sensors. To (re)place new sensor and assign it to any function is easy from my config menu. No need to reprogram the controller. Any time attached sensor is detected automatically and listed as unused. I like ds18b20 because it's calibrated out of factory and high resolution. However it's quite slow. rs485 does not specify any protocol, used for communication. It is specification to the electrical characteristics of the communication. If you want to use rs485 to communicate to remote PC I would recommend ethernet and TCP/IP instead. You may avoid PC side programming and implementation of a communication protocol. If I would start the development of my controller with my current experience, I would go with beagle bone black instead of any microcontroller. To implement concurent tasks, having web interface is a pain in microcontrollers. Why I didn't choose BBB in the begining, I was afraid about realtime processing capabilities. Meanwhile I realised, there are two PRUs (32bit independent microcontrollers capable to reach I/O and shared memory) in BBB. Those could handle easily time critical tasks. T. |
07-10-14, 10:27 PM | #88 |
Supreme EcoRenovator
|
AC,
For the first version of a controller, I would like to use an uno. Having less pins isn't a bad thing unless you want to do something like takyka did, and have gobs of sensors and comms in lots of platforms at once. Actually, i kinda picked the lcd shield i did because it gobbles up some pins, while making others available to directly wire to the shield. That way, the uno can be easily yanked to change sketches or whatever and be put right back into the unit. While it's running, the keypad is available to mess with "user" functions and menus built into the sketch. Or you can use an icsp connector in situ (or usb - hopefully: not 100% sure until i see it work with serial comms off pins)to program. Either way, the shield will still fit on a mega and have more pins open for expansion later. I have a good question for you: what kind of data is the thing you will be controlling this unit with going to be sending and receiving? Switch states? readings of what frequency? Keep alive sgnals? When we get this uno version working, a mega version can be built with a massive amount of possibilities (aka huge configuration file, a handful of libraries, and massive setup/conditions/states/ menus) built in. By then, it will be easier for me to attack and manage the beast. |
07-10-14, 11:52 PM | #89 |
Supreme EcoRenovator
Join Date: Oct 2008
Location: Austin, TX
Posts: 1,154
Thanks: 14
Thanked 257 Times in 241 Posts
|
Use a RTOS (such as FreeRTOS) to handle multiple tasks at once.
__________________
To my surprise, shortly after Naomi Wu gave me a bit of fame for making good use of solar power, Allie Moore got really jealous of her... |
07-11-14, 02:11 AM | #90 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
Quote:
These are such splendid ideas. Don't you really think they belong on your "Advanced Heat Pump Controller" thread? You did start one, right? -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
|
Thread Tools | |
Display Modes | |
|
|