Pelican Parts Forums

Pelican Parts Forums (http://forums.pelicanparts.com/)
-   Porsche 911 Technical Forum (http://forums.pelicanparts.com/porsche-911-technical-forum/)
-   -   Arduino - Digital AC control system for '80 911 (http://forums.pelicanparts.com/porsche-911-technical-forum/931191-arduino-digital-ac-control-system-80-911-a.html)

mysocal911 10-09-2016 09:35 AM

Quote:

Originally Posted by Discseven (Post 9312360)
Dave… believe system is conceptualized but am open to more brilliance than I'm capable of---(I'm not a programmer or techno savvy.) There are 3 rule "compartments." The first controls cabin temp. The second has priority over system to prevent evap from freezing. The 3rd is ancillary controls.

1. Cabin Temp Rules:
IF Cabin temp is > Set Temp, THEN compressor = ON

IF Cabin temp =< Set Temp, THEN compressor = OFF

IF compressor = OFF, and Cabin temp => Set Temp + 2 dF (hysteresis tolerance), THEN compressor = ON
2. Preventing Evap Freeze Rules:
IF Cabin temp > Set Temp, and Evap =< 32.1 dF, THEN compressor = OFF. (Evap temp always has priority as to whether compressor is ON or OFF.)

IF compressor = OFF, and Cabin Temp > Set Temp, and Evap => 32.1 dF + 2 dF, (hysteresis) THEN compressor = ON
3. There are some other control rules such as auto-display-OFF and screen contrast yet to sort out.

That's great! It's that simple:

1. You have one output controlling the compressor clutch relay thru a logic level FET, e.g. 2N7000.
2. You have four inputs which are continually read in a loop; the temp setting pot.,
the cabin temp, the Evap temp, and if desired the outside temp to provide another
feedback element if the control loop. The Arduino chip (AVR), like the PIC chip, provides
analog to digital inputs if your temp sensors lack that.
3. Good that you have thought of hysteresis which helps reduce the closed-loop possibility
of oscillations.

At this point you need to focus on your sensors to determine what the signals will look like
and what conversions will be necessary. That's the critical area of your design. After that,
you can develop a preliminary flow-chart of your design. Interfacing the controller with the
display is secondary in your design effort, as it is fairly straight-forward. Breadboard the
system and test it without the display function integrated to check the overall concept.

Jonny H 10-09-2016 11:10 AM

Quote:

Originally Posted by Discseven (Post 9312360)
1. Cabin Temp Rules:
IF Cabin temp is > Set Temp, THEN compressor = ON

IF Cabin temp =< Set Temp, THEN compressor = OFF

IF compressor = OFF, and Cabin temp => Set Temp + 2 dF (hysteresis tolerance), THEN compressor = ON
2. Preventing Evap Freeze Rules:
IF Cabin temp > Set Temp, and Evap =< 32.1 dF, THEN compressor = OFF. (Evap temp always has priority as to whether compressor is ON or OFF.)

IF compressor = OFF, and Cabin Temp > Set Temp, and Evap => 32.1 dF + 2 dF, (hysteresis) THEN compressor = ON

What you have there is the bare bones of a 'fuzzy logic' controller. I'm not trying to make this complicated for you but you will find it is not that simple to achieve satisfactory levels of control with a simplistic algorithm like this unless you take some precautions. The main reason is that the algorithm does not take into account time. What?? Read on...

Real world effects (like entering shade / bright sun or opening the door/window) will cause the cabin temperature sensor to not accurately reflect the 'nominal' temperature in the cabin.

To combat this you will firstly need to apply a suitable software filter to the cabin sensor input over time. A 'moving average' filter will probably be ok. It will act like a damper on the sensor value so the system doesn't react to spikes (like a brief door opening).

Secondly, you should use a 'trend' for the temperature (again, over time), rather than a snapshot. To understand this, imagine the car is hot and the A/C system has been on 'full'. You would hope that the cabin temperature would start to fall on an exponential gradient curve. If you suddenly got a below setpoint reading from the cabin sensor, the chances are it is a freak event (like you cracked the window or waved your hand). By your rules above, the compressor would switch off, which is undesirable. If however, you followed the 'trend' you would know that the input is false.

Now, the other issue is thermal inertia. You actually want to stop the compressor before you reach the setpoint, otherwise you will overshoot it. Worse, when the temperature rises, you will not be able to start the compressor in time because of your hysteresis. In hot weather, the car temperature will rise something like 5 times faster with the A/C off, than it cools with it on so the system is lopsided. You really need the compressor to be switched on well in advance of the cabin sensor going over set point or a massive overshoot will occur. How can this be done? Well, it is done with a PID controller. The PID controller takes into account 'history' and also 'looks ahead'. Yep, it's all about time again.

This is an interesting project and you will have lots of fun but expect the software to take at least 4 times longer than you expect.

Drop me a line if you need some help, I have been doing this stuff a very long time and know most of the pitfalls.

p.s. All modern car cabin temperature sensors are fitted in shade and have a small fan so that a known quantity of air is sampled over time (not that again!).

Rawknees'Turbo 10-09-2016 11:19 AM

Hey Karl, speaking of "padded rooms"; I use an electronic controller very similar to what you've described in this thread to control/override the thermostat of a window a/c that I use to super-cool my bedroom for sleeping purposes (I sleep best in temps below 60 degrees F - mid to low 50s are the best for me). It is a self contained unit that measures room temp, has a heater element that attaches to the a/c's evaporator temp probe, and a frost sensor for the evaporator. The only "trouble" for automotive use is that it is 120V (AC) powered (not to mention it is costly).

It is fully adjustable for temperature, frost sensing sensitivity, etc.

This is one of the most pleasing gadgets that I have ever bought for myself - have been using it every night for a little more than two years and works perfectly.

I discovered this little gem when I was doing online searching for instructions on how to build something similar since window a/c units are only capable of temps of about 64 degrees, and simply replacing the thermostat with a toggle switch does not work since the evaporator then freezes up (I tried this, buttofcourse).

https://www.amazon.com/CoolBot-Cooler-Controller-window-conditioner/dp/B003VSLTAI/ref=sr_1_1?ie=UTF8&qid=1476040680&sr=8-1&keywords=koolbot


https://images-na.ssl-images-amazon...._AC_US500_.jpg

Jonny H 10-09-2016 01:25 PM

^. Yep, that's a PID controller.

Here's your typical far eastern copy 12V PID:

12V DC Dual Display Digital PID F/C Temperature Controller with K Thermocouple | eBay

mysocal911 10-09-2016 02:10 PM

Quote:

Originally Posted by Jonny H (Post 9312586)
What you have there is the bare bones of a 'fuzzy logic' controller. I'm not trying to make this complicated for you but you will find it is not that simple to achieve satisfactory levels of control with a simplistic algorithm like this unless you take some precautions. The main reason is that the algorithm does not take into account time. What?? Read on...

Let's NOT make it overly complicated initially for the OP! Implement the design, i.e. do some basic
coding that controls the on/off of the compressor. Once that's accomplished, one can add more
sophisticated algorithms as system needs dictate. Adding time delays before changing the state
of compressor is simple to add to the algorithms.

Bottomline: He's NOT designing this controller as a replacement for the early problematic
Porsche Boxer 986 CCU.

sugarwood 10-09-2016 04:26 PM

I have a very stupid question. When someone like Wong programs his chips, he puts the car on a Dyno and reads various data while the car is running (air flow, etc). But, there is no OBD2 port. How do you connect a computer to read the data in the DME ??

Rawknees'Turbo 10-09-2016 07:55 PM

Quote:

Originally Posted by sugarwood (Post 9312936)
I have a very stupid question. When someone like Wong programs his chips, he puts the car on a Dyno and reads various data while the car is running (air flow, etc). But, there is no OBD2 port. How do you connect a computer to read the data in the DME ??

The data the he is reading is being gathered by the dyno's data acquisition system (tailpipe sniffer for air-to-fuel ratios, ignition timing monitoring via plug wire clamp or similar method, horsepower and torque output, knock detection, etc) and changes are made to the fuel and ignition systems in order to accomplish whatever his goals are - there is no plugging into, or reading data within the DME.

mysocal911 10-09-2016 09:16 PM

Quote:

Originally Posted by Rawknees'Turbo (Post 9313230)
The data the he is reading is being gathered by the dyno's data acquisition system (tailpipe sniffer for air-to-fuel ratios, ignition timing monitoring via plug wire clamp or similar method, horsepower and torque output, knock detection, etc) and changes are made to the fuel and ignition systems in order to accomplish whatever his goals are - there is no plugging into, or reading data within the DME.

Actually, you can remove the DME ECM chip and read the data stored for the fuel and ignition maps
using a Windows app. One can also use a chip emulator and another app to store and run modified
chip maps without having final EPROM chip installed, i.e. changing map values easily with a PC connected while ECM is installed in the vehicle.

Rawknees'Turbo 10-09-2016 09:22 PM

^^^

Thanks, I was unaware of that.

kuehl 10-10-2016 04:54 AM

Sugarwood,

If you have a need to modify your DME's maps, chat with Sal Carceller, you will find him in he forum under topics of MAF.

Sal helped me with my fuel and ignition maps.

There is no 'data' that changes or is collected and stored in the DME that I'm aware of.

sugarwood 10-10-2016 05:50 AM

Not changing anything, just upgraded to a Wong chip, and was doing a little background reading for fun. That's cool you can use a chip emulator without writing to an actual chip.

kuehl 10-10-2016 07:53 AM

Yup, you can use a Moates Ostrich to get things down pat and leave it attached, or
burning the new maps to a chip reduces connections and loss if the ostrich battery dies.

If you go down the MAF road, Sal is the got to guy.

Make sure you don't have any air leaks before change your chip; warp intake manifold flanges are common
if the engine has been worked on in the past.

Discseven 10-11-2016 12:28 PM

Quote:

Originally Posted by mysocal911 (Post 9312451)
That's great! It's that simple:

1. You have one output controlling the compressor clutch relay thru a logic level FET, e.g. 2N7000.
2. You have four inputs which are continually read in a loop; the temp setting pot.,
the cabin temp, the Evap temp, and if desired the outside temp to provide another
feedback element if the control loop. The Arduino chip (AVR), like the PIC chip, provides
analog to digital inputs if your temp sensors lack that.
3. Good that you have thought of hysteresis which helps reduce the closed-loop possibility
of oscillations.

At this point you need to focus on your sensors to determine what the signals will look like
and what conversions will be necessary. That's the critical area of your design. After that,
you can develop a preliminary flow-chart of your design. Interfacing the controller with the
display is secondary in your design effort, as it is fairly straight-forward. Breadboard the
system and test it without the display function integrated to check the overall concept.

Thanks for input Dave. Status = Techno-John and I have been going through hardware compatibility and system chats. All components have been sorted and I literally ordered everything a few moments ago... progress is on the table.

Worth noting is a comment on One-Wire. I thought this was an essential system protocol based on the number of wires from the display and multiple sensors feeding into the Arduino. John says One-Wire is good but not a requirement here. (As a One-Wire humidity sensor could not be found... this is good news for the parts monger.)

When I receive parts, all of it goes to John. He'll breadboard the system outside the car. I'll install after it's proven.


Quote:

Originally Posted by Jonny H (Post 9312586)
What you have there is the bare bones of a 'fuzzy logic' controller. I'm not trying to make this complicated for you but you will find it is not that simple to achieve satisfactory levels of control with a simplistic algorithm like this unless you take some precautions. The main reason is that the algorithm does not take into account time. What?? Read on...

Real world effects (like entering shade / bright sun or opening the door/window) will cause the cabin temperature sensor to not accurately reflect the 'nominal' temperature in the cabin.

To combat this you will firstly need to apply a suitable software filter to the cabin sensor input over time. A 'moving average' filter will probably be ok. It will act like a damper on the sensor value so the system doesn't react to spikes (like a brief door opening).

Secondly, you should use a 'trend' for the temperature (again, over time), rather than a snapshot. To understand this, imagine the car is hot and the A/C system has been on 'full'. You would hope that the cabin temperature would start to fall on an exponential gradient curve. If you suddenly got a below setpoint reading from the cabin sensor, the chances are it is a freak event (like you cracked the window or waved your hand). By your rules above, the compressor would switch off, which is undesirable. If however, you followed the 'trend' you would know that the input is false.

Now, the other issue is thermal inertia. You actually want to stop the compressor before you reach the setpoint, otherwise you will overshoot it. Worse, when the temperature rises, you will not be able to start the compressor in time because of your hysteresis. In hot weather, the car temperature will rise something like 5 times faster with the A/C off, than it cools with it on so the system is lopsided. You really need the compressor to be switched on well in advance of the cabin sensor going over set point or a massive overshoot will occur. How can this be done? Well, it is done with a PID controller. The PID controller takes into account 'history' and also 'looks ahead'. Yep, it's all about time again.

This is an interesting project and you will have lots of fun but expect the software to take at least 4 times longer than you expect.

Drop me a line if you need some help, I have been doing this stuff a very long time and know most of the pitfalls.

p.s. All modern car cabin temperature sensors are fitted in shade and have a small fan so that a known quantity of air is sampled over time (not that again!).

TIME... good point Jonny. Cabin temp sensor should have some hysteresis setting so as not to read to quickly. Exactly what is optimal (in Miami) will be a matter of road tests and sketch/programming adjustments. To start with we'll pick a number and go with it.

TREND... mo interesting. I interpret this as averaging data over a given period. Nice thinking.

THERMAL INERTIA... This is great stuff. You're pushing boundaries of AC control beyond even my insanity! This has the feel of "environmental prediction." I can see shutting the compressor down in advance of Set Temp being achieved based on inertia... but turning it on in advance??!! Impressive thinking. This is something to consider after system is up and running.

Thanks for drop line offer Jonny!


Quote:

Originally Posted by Rawknees'Turbo (Post 9312597)
Hey Karl, speaking of "padded rooms"; I use an electronic controller very similar to what you've described in this thread to control/override the thermostat of a window a/c that I use to super-cool my bedroom for sleeping purposes (I sleep best in temps below 60 degrees F - mid to low 50s are the best for me). It is a self contained unit that measures room temp, has a heater element that attaches to the a/c's evaporator temp probe, and a frost sensor for the evaporator. The only "trouble" for automotive use is that it is 120V (AC) powered (not to mention it is costly).

It is fully adjustable for temperature, frost sensing sensitivity, etc.

This is one of the most pleasing gadgets that I have ever bought for myself - have been using it every night for a little more than two years and works perfectly.

I discovered this little gem when I was doing online searching for instructions on how to build something similar since window a/c units are only capable of temps of about 64 degrees, and simply replacing the thermostat with a toggle switch does not work since the evaporator then freezes up (I tried this, buttofcourse).

https://www.amazon.com/CoolBot-Cooler-Controller-window-conditioner/dp/B003VSLTAI/ref=sr_1_1?ie=UTF8&qid=1476040680&sr=8-1&keywords=koolbot


https://images-na.ssl-images-amazon...._AC_US500_.jpg


Padded room with snow maker... way to go Rono. You chill for sure. That's interesting gizzmo. Looked into some units like that but they were expensive. Funny that you tried to over-ride system to improve... Fookin u at the helm Bro!

FrenchToast 10-11-2016 05:08 PM

Quote:

Originally Posted by tirwin (Post 9307161)

FWIW, I think that is just a 964/993 CCU unit that has been re-clad to look older.

http://ep.yimg.com/ca/I/yhst-3964979...1_24083725.jpg

Very cool project.

Discseven 10-12-2016 11:46 AM

^^^ Toast... Nice note on mod. And hats off to Singer for clever move on retro'ing new CCU. This project... not concerned with period appropriateness. Design goal is a high quality, finished look that integrates "nicely" with black '80 interior.

Today---tested for reflection off display (using iPhone as stand-in.) Is non-issue depending on viewing angle and angle that display is mounted at. Is definitely bad news if line of sight (via display) is out through rear window to bright background---display is useless in this case. Bottom line = angles are critical consideration. Setting it correctly avoids having to duck/bob to eliminate any intrusive reflection. It's possible to "sculpt" panel where display will mount so reflection is roof of car---works with black headliner. Other possibility is to mount display so it can rotate to preferred angle. This gets complicated to produce. (Reflection from my point of view is black/optimal... so not sure how much attention I'm going to give this.)

John has Nextion display he's going to test for in-sunlight visibility of displayed images.

While John attends sketching/programing, I'll be working on the mounting plate (that extends down from existing AC control panel) and how to finish it---black leather or black plastic cover? Plan is to fab added panel out of sheet aluminum... 0.032" material.

tirwin 10-12-2016 11:58 AM

Karl,

Some displays have a matte finish versus a glossy one for this very reason (daylight reflection). Consider the Teslas have a big display right in the center console. Maybe it's time to find a Tesla dealer and go for a test drive. :D

FrenchToast - excellent picking up on the 964 unit.

Discseven 10-12-2016 01:13 PM

^^^ Good point on material reflection characteristics Tim. John has display unit (in hand) that we'll use. I'll ask him.

Largest challenge so far has been a bezel to finish install with. Many of these small display manufacturers make a fine display... but NO bezel. Won't go into why we're using a Nextion 2.8 display with a 4D 2.8 bezel but that's where the display/bezel combo stands at this moment. Unfortunately this 2.8 bezel is full plastic. This means if used, there'll be the bezel plastic layer over the screen layer. Not optimal. Alternative is to make cut out bezel. Will eventually explore how to go about doing so. Suggestions are welcome.

Am going to test sculpting the mounting panel so looking at the display reflects my black headliner. Since cubby's verticals (where added mounting panel goes) are parallel, is simple matter to sculp & adjust panel until tilt of display is correct. Might be possible to preserve a ledge of storage space (in center console cubby) when doing this.

kuehl 10-12-2016 01:24 PM

Quote:

Originally Posted by Discseven (Post 9316567)
^^^

Today---tested for reflection off display. Bottom line = angles are critical consideration.

I've gone through the same issue with various LED and OLED displays for engine management, although the later (oled) has higher contrasts; either has pro's and con's. And, any late model vehicle I've owned with an oem "LED" display, such as center dash units for sound-climate-nav, are simply terrible with ambient light.

You could review OLED displays that are curve able (flexible). Or mount your display in a frame you can pivot.

Otherwise use a white on black display (white text on black background) for highest contrast; you might find that contrast scheme blends in better
with the cockpit as opposed to full color, or, use dimmable dedicated digital LEDs.

Discseven 10-13-2016 01:48 PM

^^^ CG... Display is full color graphic so background will be jet black. Text will be high contrast. Screen set up is seen earlier in thread.

After considering importance of angle that display is mounted at, have decided it being best to tilt it back a few degrees when mounted (in center console.) This will ensure display's face reflecting black headliner (from driver's perspective.) Rather than make mounting plate from aluminum sheet, am going to sculpt the mounting plate out of something. Not sure what yet. Sculpting means AC controls face plate will---without question---be finished off in a leather covering (to accommodate 3 dimensional curves.) This plan adds a good deal of work. Am thinking "finished product" will be more appealing than taking easy route.

John tested legibility of actual Nextion display in car. Visibility is good.

Rawknees'Turbo 10-13-2016 01:50 PM

Quote:

Originally Posted by Discseven (Post 9318187)
. . .This plan adds a good deal of work. Am thinking "finished product" will be more appealing than taking easy route.

Karlicious, I expect nothing less of you, Bro - pimp or go home!!! :)


All times are GMT -8. The time now is 04:57 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website


DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.