Showing posts with label Controller. Show all posts
Showing posts with label Controller. Show all posts

Wednesday, 6 September 2017

Controller part 10 - GICARs of the world unite

A collection of GICAR controller circuits.

CIV`s Cimbali Junior 

Image



Dynamos' Gaggia lever 

Image

Image

Image

Image

Image

Image


Circuit from 1998 RL30 GICAR from an Aurora







Controller part 9 - autofill, electrolysis and GICARs

After an interesting discussion on the Home Barista forum about the possibility of a constant DC voltage causing electrolysis of the autofill probe I thought it would be a good idea to revisit the auto-fill circuitry. 

When I repaired the GICAR in my machine, I looked fairly closely at the circuit. I took a few notes, but I didn't draw it completely. Looking back at the notes, what I did see was an AC transformer with two taps, marked as 15V and the other for 20V (these measured 19 and 27 VAC (with no load)). I'm pretty sure that the probe was connected after a rectifier and that a capacitor was used to provide hysteresis. I therefore assumed that there was a constant DC voltage going to the probe. However, I just took the cover off my machine at home and put a multi-meter on the probe. The readings are not conclusive. I see roughly +160mV which seems to drop occasionally, possibly below zero. I don't see AC, but this is on a 200V scale with a cheap digital meter... I'll bring home a better meter this evening. It seems pretty unlikely that there is 19V or 27V AC present though.

Here are the photos of the GICAR controller that I took way back when:





Friday, 1 September 2017

Controller part 8 - eagle fight

Canada is a great place: trees, more trees, beer that doesn't taste like water, Montreal. We even have a puppy for prime minister. Getting things to Canada from the US on the other hand, is like chewing pebbles. I've been waiting since the end of July for paint samples to come by USPS. Lost in the mail. Resent. Still waiting. 

In the interim, I've been in a grim death-struggle with Eagle CAD, candidate for "World's Most Un-intuitive CAD Package". I also wired up the prototype controller. All the AC and signals to the lower board (the bull-dog clips are holding a piece of rubber over the exposed AC connections on the bottom) :


Then I made a break-out for the IO to the micro-controller from a piece of protoboard and some jumper wires. It plugs into un-used analog pins on the Arduino.



Overall it's a bit messy, but not too bad given that it is frankensteined together from various different projects. The only real problem is that the USB port is at the opposite end from all of the other connections. This is inconvenient for positioning the box in the base of the frame. The other mild annoyance is that the LCD screen is just too wide to fit across the short side of the box. So, at least for now, the interface will have to read from the side of the machine. 

The next step is to make custom boards for the keypad/screen and the power distribution/sensors/relays because protoboard just ain't gonna cut it. Ultimately, it would be better to incorporate all three boards into a single one, but that is a lengthy task which requires a much higher volume to make it worthwhile. Here is a first bash at the keypad shield. 


This is a pretty simple board: just the connections between the LCD and the microcontroller to make, plus an IDC connector to hook up a few flavors of power, ground and a bunch of pins to the lower board. The keypad design is clever - all the buttons are on a single analog pin, pressing one of them engages one of five different resistors. The pin reads the resistance and thus can distinguish which button has been pressed. 


There is, however, a mistake in the original design which has been blindly duplicated hundreds of thousands of times. The transistor that controls the LCD back-light is missing a diode (or minimally a resistor) to prevent current flowing back to the IO pin on the microcontroller and burning it out.


Suffice it to say that this shall be remedied.

Friday, 18 August 2017

Controller part 7 - proto case

Ok, I've been lax with the my posts and a few weeks have gone by. However, even though we are experiencing our brief period of non-inclement weather we refer to as 'summer', I have not been entirely idle.




I ordered a bunch of electronic parts for the controller box.



Including these LEDs from Bivar, which came in a fancy box and are somehow suggestive of marriage proposals.



(With this LED, I thee wed?)




I've not done enough PCB design work to be confident enough to order a board without building a prototype first. Normally I would just test the circuit on bread board, but this one has to handle AC distribution, so I decided to put one together on proto-board. After a lot of faffing around in Eagle CAD (candidate for the world's most un-intuitive CAD package) and time spent dragging the net for 3D models of the components, I settled on an enclosure size and cut the blank board to size. 



A first go at the layout of the lower and upper levels. AC-DC supply, 5V relay and opto-isolator board.



The Arduino fits over the top. 



And the LCD and keypad shield sit on top.




The models of the keypad shield PCB that I found on the internet don't quite match the one that I have. This meant that I spent a looooong time measuring the layout with calipers to figure out where the holes have to be cut in the enclosure box. This will be easier next time as I will design my own shield.

Four hours of setup for two minutes of cutting? Too late now if I got this wrong!





Thankfully, it fits.



The button hole cut-outs are a little on the large size. I think that the CAD model I used must be incorrect. Still, more than good enough for the prototype.

Thursday, 3 August 2017

Frame part 4 - rust paint

The pressure gauge is mounted to the top of the level gauge in the original which means that it has to be 'outside' the case. This is an expedient method but personally I find it a little too "steam engine" in an otherwise minimalist design. The advantage of exterior mounting it is that it is much easier to take off as the part that it mates with is fixed. With my mounting method, attaching the copper line directly to the gauge is more of a hassle. OTOH it isn't like you have to take the case off once a day...

I installed the SSR and slapped a coat of rust paint on the frame. This was also a case of expediency as the frame will be powdercoated. I just lost my patience with the rust. Amazing stuff that paint, you could almost put it on with a spoon and it will still level itself out...





Thursday, 25 May 2017

Controller part 6 - autofill

All the functionality shown in the state diagram will be built into the programming of the microcontroller (an Arduino at least for now as it is so convenient). The extreme democratization of microcontrollers just makes having discrete industrial controllers a non-starter. I could purchase Arduinos and just hand solder a rat's nest of components for less than the cost of a single Gicar, never mind the $300+ PID and $100 pressurestat. Once the electronic design is finished, a custom PCB will reduce the cost even further (if one neglects the not insignificant work that will go into it :).

What is required for the autofill is essentially a comparator - a circuit that checks to see if a voltage level is above or below a certain threshold. The essence of the circuit is a switch that is grounded by the water when it touches the probe.



The switch in the diagram is analogous to the probe touching the water or not (and assumes that the boiler is physically connected to the same ground as the microcontroller). When the switch is open, the analog pin on the Arduino "sees" the full 5 volts. When the switch is closed, the value "seen" by the pin drops to (close to) zero. In reality,  as a result of the resistance of the water, the boiler, the probe etc., this value is not zero; thus the need for a comparator. But this is easy to implement on the microcontroller:

autoFillProbeValue = analogRead(autoFillProbePin);
if (autoFillProbeValue < 500)  {
      digitalWrite(autofillSolenoidPin, HIGH);
    }
  else {
    digitalWrite(autofillSolenoidPin, LOW);             
   }

The Arduino is an 8-bit device and the logic level is 5v, so values between 0 and 5v are mapped by the analog to digital convertor to values between 0 and 1023 (2 to the 8th power values). So anything lower than 500 will open the solenoid. By putting in a timer which counts while the pin is high, it is possible to trigger an alarm when the tap has been on for too long. When that alarm is triggered, the state machine switches off the solenoid and the heater and waits for a reset signal before it will do anything else.

As the probe is sitting in water in close proximity to a heating element that is powered by a 15amp 120v circuit, I also added a diode rated for the voltage in the line to the probe. I will have to consult a higher power to see if there are any other safety precautions that should be taken.

Monday, 22 May 2017

Controller part 5 - code and callibration

The temperature and auto-fill controller code is done. I put a little extra logic to allow for calibration of the thermocouple sensor. For now, the screen shows the current state at the top left, time elapsed, bottom left, two temperature readings (upper is current reading from thermocouple, lower is the set point) and three bits of data: A is the alarm state, H is the heating element and F is the solenoid. The reading in ice-water was a few degrees above what it should be.

























A second data point is taken using boiling water.

























Then, the corrected temperature can be calculated using the formula: 

CorrectedValue = (((RawValue - RawLow) * ReferenceRange) / RawRange) + ReferenceLow

where ReferenceLow is 0.01 for ice water and ReferenceRange is the boiling point at your elevation minus the ReferenceLow.

Although there is a bit of swing in the readings, the corrected output for boiling point looks pretty good. I would say that this thermocouple setup is accurate to +/- 0.5C - which is certainly good enough for boiler control. Without better reference tools, I will just have to assume for now that the rest of the range (i.e. above 100 C) is similarly accurate. 























Tuesday, 16 May 2017

Controller part 5 - state machine

Meanwhile...
Here is something else to contemplate: a state machine diagram for the operation of the controller.


























Key - 

PWM - pulse width modulation (for the solid state relay that drives the heating element)
AF - autofill
OT - overtemperature

Controller part 4 - dweenos and sensors and proper LRFs

I've spent the last couple of days getting my head into code and hooking sensors to arduinos. This is a setup that controls a reflow oven lent to me - along with the code - by a friend.




I'll report back when I have something to show...

In the meanwhile, I had a go at some proper LRFs (little rubber feet).
I've come to the conclusion that plastic is, well, too plastic. Good coffee is a luxury that merits the use of premium materials.
In that spirit, I broke out the king of woods, the champion of the rainforest: mahogany.
I generally try to avoid working too much wood in the shop because of the mess. So much dust... For the same reason, I have not purchased a jointer or planer. So, a ripping blade in the table saw will have to do.

























After a change the blade to do the cross cuts.

























A 1/8" round-over in the router to finish 8 of the 12 edges.















































Then it is into the milling machine with a vacuum cleaner running to keep the dust from getting anywhere it shouldn't.

























Flip the block and drill a blind hole. For now, as this wood is hard enough to hold a bolt intended for metal, that is what I will use. Ultimately, I will likely anchor some threaded rod in with epoxy and use a nut. 




Cut and glue on some rubber pads to provide the necessary friction.

























Then. having previously sanded them to take off the burn marks from the table saw and router the blocks can be finished with some tung oil.

























...damn. Forgot to take a picture of them installed. Watch this space.

Tuesday, 9 May 2017

Controller part 3 - actually boiling water

Yesterday I actually did boil water.

I am missing a few pictures. The first thing to do was to take the 1/4-20 screw off the TC and to put it into an adaptor which threads into the top of the tank. The probe is now in direct contact with the airspace above the water. The lag between the installed TC and the faster-reading TC from the multimeter is now down to about 7 degrees. I set the temperature controller to auto-tune to a set point of 70 degrees C and did something else for an hour and a half. Then I moved the set point to 95C. I don't have the data with me but the controller overshoots by 5 or 10% or so during a cold start. After a short period (roughly 15 minutes total) the installed probe catches up with the reading from the multimeter. If the set point is then increased slowly, the two readings move pretty much in lock-step. This means that with a little tweaking of the PID coefficients (likely the D), the controller could probably be made to hit the set point with little or no overshoot. I think however, that it may just be easier to divide this into two problems. The first is heating up from a cold or warm start. The second is maintaining temperature at the set point. With a micro controller replacing the temperature controller it will be easy to set a safe initial set point, wait for the heat to disperse through the system so that readings become reliable, and then move the set point to its final value.

The good news is that the controller is already very good at keeping the temperature stable once it gets there.

The two pictures I did take yesterday :



Saturday, 6 May 2017

Controller part 2 - nearly boiling water

Today I (nearly) boiled water.

The result of the squirrelly form factor of the thermocouple is this ridiculous adaptor:


























I put a drop of heat-transfer grease on the tip of the TC to aid the conduction of the heat and attached the whole lot to the boiler. Then I did a quick test of the controller using a lamp in place of the heating element.


























Now for the real thing. I put the multimeter TC probe directly into the boiler so that I can compare it with the controller TC. Time to 'put the kettle on'. 





















As I feared, the lag created by the thermal mass of the lump of brass in the adapter and the less than ideal position in which it is installed (close to the bottom of the boiler) is significant. After about 8 minutes, the water got pretty close to boiling but the controller probe was nearly 30 degrees behind. After another ten minutes or so, the gap had narrowed to about 9 degrees, but this is far from ideal. Quite possibly, everything will stabilise once the heat is completely diffused through the entire system and in theory, with some calibration of the set point and proper PID coefficients, the overshoot can be reined in. However, a twenty minute plus sample rate just isn't acceptable. To remedy the situation, I am going to move the TC to the top of the boiler and look for a better form-factor - one that can be installed through the wall of the boiler.