Science Niles Audio Home Theater CD/LD/DVD Audio DACs Audio Power Espresso PID

PROJECTS & PRODUCTS GALLERY                                                            Main Menu




Niles ICS multizone home audio system

Niles iWare iPod dock and extender for ICS and ZR-6 multizone systems
Proposal for leveraging ANDROID phone media capabilities into the homeEMC testing of Niles iRemote TS ZigBee remote controlProposal for implementing party mode in a networked music system

IntelliControl ICS 6-source, 6-30 zone modular Multizone System: GXR2, RFG, RS232G, HT-MSU, iRemote + RBX-1,
                       iRemote TS, Contact, Display, Single, VS-6, iWare SmartDock and SmartDock2;
IntelliControl ICS source cards: IM-Net, TM-HD/R, IM-iPod, IM-iCard2, TM-XM, TM-Sirius, TM AM/FM, IM-Audio, IM-Server;
4-source, 4-zone Audio Multizone with AM/FM tuner: ZR-4, Solo-4 IR, ZR-KE, R-6 L;
6-source, 6-zone Audio Multizone with AM/FM tuner & iPod integration: ZR-6, TS-PRO, Solo-6 MD, Solo-6 IR, Numeric-6P, R8-L, ZR-KE;
Multizone video switcher: VS-6, IRG;
iPod integration: iWare SmartDock, SmartDock2; iWare ES1, ES2 extender system;
System integration amplifiers: SI-1230;
Satellite Radio accessories: IMT-50/75 MF, IMT-50/75 SMB, IMT-50/75, SRC-2M, SRK-1W, SRK-2W, SRK-4W, SRS-2W, SRS-4W;
Switching systems: CS12V;
Home theater controls: HT-MSU, iC-2 table-top Zigbee remote;
IR sensors: MS220, MS120, CS120, TS120, WS120;
Cat-5 Baluns: C5-A2, C5-A2WM, C5-DA, C5-DAWM, C5-HDDA, C5-HDDAWM,
                      C5-HDMI R/T, C5-HDMI RWM/TWM, C5-RF, C5-RFWM, C5-SV, C5-SVA2,
                      C5-SVA2WM, C5-SVWM, C5-V, C5-VWM, C5-VA2, C5-VA2WM, C5-VGA, C5-VGAWM.


TheaterMaster bass management signal flow
EAD Cinema EQ ("CinEQ") was based on Jim Fosgate's shelf filter TheaterMaster EOS updated bass management (stereo subs)


Jan   1995  TheaterMaster Classic $6,995 (standard model); $9,995 (Signature model). PCM63P-K DACs (2 per ch. for L,R bal output),
                  PMD100 HDCD decoding w/ultra-low passband ripple. Best-in-class DACs, dual Digital Flywheel VCXO DAC clocking circuits
                  for 44.1 kHz and 48 kHz (~10 ps clock jitter), and uncompromising class A analog design, produced audio quality unheard of in most
                  audiophile designs, let alone the new era of multi-channel home theater playback, where TheaterMaster was unique.
(TheaterMaster Classic, released at the 1995 Winter CES in Las Vegas, was a breakthrough product, six months ahead of its nearest
                  rivals. Shipping to customers in March of 1995, the TheaterMaster Classic received many accolades as the world's first consumer
                  decoder for the Dolby Digital/AC-3 5.1-channel digital surround sound format, a format that is now ubiquitous in our home
                  entertainment systems.)
Jan   1995  SmartCable AC-3 demodulator for TheaterMaster Classic
June 1996  SwitchMaster Videophile video switcher accessory for TheaterMaster Classic
Oct  1996  DTS upgrade for TheaterMaster
Nov 1996  DVD upgrade for TheaterMaster Classic (to handle the 448 kb/s requirement of AC-3 on DVD, vs. LD's 320 kb/s requirement)

Jan   1998  TheaterMaster Encore $3,000/Ovation $4,500/Signature $6,500  PCM1702 20-bit multi-bit DAC (Signature), dual Zoran ZR83500
                  DSP, AutoSetup (speaker levels & time alignment), flexible bass management modes, 4th-order 48-bit digital filtering for clean signal
                  separation, Dolby Digital 5.1, stereo, enhanced mono, Hafler matrix, Dolby Pro Logic, MPEG Audio (stereo), Switched Resistive
                  Array volume control (Signature), Digital Flywheel VCXO DAC clocking circuit (10 ps clock jitter), Motorola 56009 DSP (DTS 5.1),
                  20-bit delta-sigma DAC (Encore, Ovation), ADC, PMD100 HDCD decoding w/ultra-low passband ripple, RS232 control and status,
                  fully compatible with EAD video SwitchMaster. 
Nov 1998  Auto Phase speaker setup added to AutoSetup.
        2000  TheaterMaster Ovation+ $5,500 (essentially an Ovation with Signature backboard)
Sept 2001  TheaterMaster Ovation 8, Signature 8, Ovation 8+, Signature 8a  Stereo subs, Ref Cinema ("6.2"), Cinema 7.1, Analog Pass-through via
                  Octopus cable, PCM1732 24-bit delta-sigma DACs w/ ultra-low passband ripple (0.00001 dB), DAC-8 pcb
Jan   2002  TheaterMaster 6000/8000/8000 Pro  Dedicated analog pass-through connector (No Octopus cable)
Oct  2003  TheaterMaster 8800/8800 Pro  Dolby Digital, Dolby Digital EX, Dolby PLII, DTS, DTS ES, DTS Neo:6, 8-ch. analog pass-through,
                  8-ch. fully balanced out (Pro) + RS232 +  integrated component/S/CVBS video switcher.


EAD DVDMaster 8000 Pro DVD-Audio playerEAD SmartCable AC-3 RF decoder   

CD-1000 1993  CD player
1993  CD transport with coax and ST glass S/PDIF outputs
1992  Universal Disc transport
T-8000 1993  Universal Disc transport with ST glass, coax, and Toslink S/PDIF outputs
TheaterVision 1997  Audiophile/videophile LD transport (AC-3 RF)
SmartCable 1995  AC-3 demodulator for interfacing the TheaterVision LD transport to the TheaterMaster
TheaterVision P
2001  DVD player with progressive scan 10-bit 2x oversampled video output $3,100 (NTSC and PAL, zone-free $3,600)
Ultra DVD 2001  DVD player with progressive scan video output
Ultradisc 2000
1998  Stable Platter CD player with HDCD
Ultradisc 2000t 1998  Stable Platter CD transport
DVDMaster 6000
DVD playback; includes 6-channel audio processing + balanced LF, RF
DVDMaster 8000 DVD, DVD-A playback; includes 8-channel balanced audio out with remote analog volume control
                             + bass management + RS232 + standard component video output
DVDMaster 8000 Pro (adds to base model: "Adagio" 480p video processing, component/VGA)
                                    (Awarded Stereophile Guide to Home Theater 2003 Editors' Choice award: Platinum Award DVD Player)
(Note: The DVDMaster 8000 and DVDMaster 8000 Pro products were the first DVD-Audio players with full 5.1-channel bass management)


DSP-7000                           1992  20-bit DACs, 4/8x oversampling, balanced/single-ended output options
DSP-7000 Series II             1993  ST glass input
DSP-7000 Series III $2495 1996  (Awarded Stereophile Class B rating for digital processors, 1997)
DSP-1000 Series III $1495 1997  (Awarded Stereophile Class C rating for digital processors, 1997)
DSP-9000                           1993  PCM63P-K DACs, balanced/single-ended output options; IR remote; switched-resistive array volume control.
DSP-9000 Series III $5995 1996  (Awarded Stereophile Class A rating for digital processors, 1997)


PowerMaster 2000 $7,250 1999  (20 A option +$100) 400 W, 5-ch., 12 V trigger, 100/120/220/240 VAC, 115 lbs
PowerMaster 1000 $3,000 1999  200 W, 5-ch.
PowerMaster 500   $1,700 1999  100 W, 5-ch., 50 lbs

PowerMaster 8300 
2002  300 W, 8-ch.
PowerMaster 7300  2004  300 W, 7-ch.
PowerMaster 7200 
2004  200 W, 7-ch.
PowerMaster 6300 
2003  300 W, 6-ch.
PowerMaster 6200 
2002  200 W, 6-ch.
PowerMaster 5300 
2004  300 W, 5-ch.
PowerMaster 5200 
2004  200 W, 5-ch.
PowerMaster 4300  2004  300 W, 4-ch.
PowerMaster 3300 
2004  300 W, 3-ch.
PowerMaster 2300  2004  300 W, 2-ch.



The brew performance of my Rancilio Silvia espresso machine was improved by using precision temperature control (which I achieved using a custom-tuned off-the-shelf proportional-integral-differential (PID) industrial temperature controller (a type of programmable logic controller, or PLC), with platinum resistance temperature probe, and a zero-crossing SSR).

With reference to the graph shown below, a set value (SV) of 102?C ? 2?C (yellow line) allows for the temperature gradient in the espresso machine's marine bronze group head, and a typical 10 to 13 ?C drop in the water temperature during the 25 second "pull" time of the double shot (the dip in temperature starting at 540 seconds). This SV achieves the Istituto Nazionale Espresso Italiano (INEI) recommended 67?C ? 3?C temperature in the cup...the results are delicious!


Although further tuning may eliminate the 30 second period, 2?C oscillation in parts of the process value (PV) temperature curve, this amount is not significant. It may also be possible to reduce the 8?C boiler recovery overshoot after pulling a double shot, but since I pull successive shots so rarely, it may not be worthwhile...perhaps I'll take another look at this on a future rainy day

Here is the original performance of the same Rancilio Silvia espresso machine, using the stock bimetal thermostat:

Several things to notice:

  • As in the case of the previous graph, a double shot is pulled using the INIE's recommendation of 25 s.
  • The PV temperature varies approximately 24?C due to the bimetal thermostat's large hysteresis and on-off mode of operation (vs. 2?C for the PID controller due to its proportional/integral/differential control).
  • The pull is shown occurring at the optimal point in the cooling cycle, when the PV has dropped to 102?C; something that espresso enthusiasts manipulate by running off water until the heater turns on. Failing to do this, the brew temperature could be as much as 17?C too hot, or 7?C too cold, depending on when in the cycle the shot pull is initiated (vs. this is taken care of automatically by the PID controller).
  • The drop in temperature during the pull of a double shot is 22?C (vs. 16?C for the PID controller, which starts heating as soon as the PV starts to drop, whereas the bimetal thermostat requires the PV to drop to 95?C before it turns on). The temperature drop during the pull will be greater than 22?C for the bimetal thermostat if the pull is initiated earlier in the on-off heat/cool cycle, since the boiler heater still cannot turn on until the PV has dropped to 95?C.

PID Temperature Controller Theory:

None of the available theoretical derivations for proportional/integral/differential controllers were to my liking, so I decided to create my own.

The basic structure of a PID controller is shown in the following block diagram:


Given that the temperature control loop error term e at time t is equal to the difference between the desired temperature (the setpoint value or SV) and the actual measured temperature (the process variable or PV), in other words,

from the block diagram we have,

where the heating power, Output(t), is the linear weighted sum of three terms, known as PID loop tuning constants:

kp = Proportional gain (determines how strongly the current error signal affects the output)
ki  = Integral gain (determines how strongly the output will be affected by the past error signal behavior)
kd = Derivative gain (determines how strongly the output anticipates the future behavior of the error signal)

This loop has a 2nd-order bandpass transfer function,

which has a pole at the origin, and two zeros at

Although we could certainly implement the above differential equation directly, using various analog computer elements (built using op amps, resistors and capacitors), for various reasons such as consistency, flexibility, repeatability, and lack of drift, most modern PID controllers are implemented as discrete time (sampled data) digital systems. This is achieved by rewriting the differential equation as a linear difference equation.

PID Controller Difference Equation:

Assuming a uniform sampling interval, ts, (1 or 2 seconds is adequate for an espresso machine) the derivation of a difference equation for a PID controller is relatively straightforward. Good accuracy can be obtained by approximating the derivative as a 1st-order difference, and the integral using the trapezoidal rule (trapezium rule to the British). The resulting iterative equation requires storage of all past error samples. However, by transforming the equation into a recursion, we need only store two past error samples, e[n-1] and e[n-2],

which has overall data storage requirements for just three variables, Output[n-1], e[n-1], and e[n-2]. The new discrete-time constants are related to the old continuous-time constants, as follows:

Note that unlike kp, ki, and kd (which are respectively: dimensionless, 1/t, and t), the new gain constants, K1, K2, and K3, are all dimensionless. Consequently, K1, K2, and K3, do not have a simple correspondence with anything physical in the controller feedback loop. Regarded as gain constants, K1, K2, and K3 can be seen as representing the coefficients of an infinite impulse response (IIR) digital filter. Choosing suitable values for them will give a type of bandpass filter response matched to the heating and cooling time constants of the espresso machine's boiler. Many off-the-shelf PID units have an automatic tuning mode that can deal with this.

So, there you have it! The mystique of PID essentially boils down to a single line of code (the equation in the yellow box, above), consisting of three multiplications and three additions, replacing all of that calculus with a discrete-time approximation that is "close enough." The controller consists of a main control loop iterating this simple line of code perhaps once per second (achieved using a periodic timer interrupt). Together with a little house-keeping for three memory locations that store the filter's state between iterations, that's all there is to a PID controller.


If the PID sampling rate (1/iteration time) is insufficient, time-domain aliasing error may be significant, and the control loop will not track rapid changes properly. Another possible source of error is data quantization. A detailed analysis shows that a digital PID temperature controller with sixteen-bit arithmetic is sufficiently accurate for espresso making (achieves an accuracy of around 1% or better). Normally the PID controller will drive a solid-state relay (SSR) that is in series with the boiler heater and power source. However, since most SSR are designed to be controlled by a simple on/off logic signal, this requires a small additional piece of code to convert the Output[n] variable produced by the linear discrete time difference equation, to a corresponding pulse-width, in other words, code that will convert the output to a proportional on/off duty cycle. Many designs also prevent a phenomenon called integrator wind-up, by including additional code to limit the magnitude of e[n]. Between iterations and before reading the next e[n], don't forget to transfer e[n-1] to e[n-2], followed by e[n] to e[n-1]. If you are an adventurous DIYer,  you may like to implement this by moving a pointer on a three-level circular stack. 

As mentioned above, the water boiler requires a heating power that is proportional to the linear Output[n] variable, something that cannot be achieved using a typical solid-state relay (SSR), most of which are simple on-off AC power switch replacements designed to be controlled by an on-off binary logic signal. Therefore, in order to smoothly control the heater power proportional to Output[n], most PID controllers arrange for the logic signal to switch on and off with a corresponding duty cycle, with a period that is much smaller than the thermal time constant of the espresso water boiler (say 1%). A period of a second or two is usually fast enough, and most PID controllers use this approach due to its hardware simplicity and low cost. The method does have its issues, however, since cycling the full boiler heater current on and off at random times relative to the mains waveform has the potential for creating strong RF interference (RFI), and  may also cause lighting devices on the same circuit to flicker up and down in brightness due to mains wiring voltage drop. We normally don't need to be too concerned about RFI since good SSRs mitigate it through built-in mains zero-crossing detection, which switches the load only when the current is small.

There are many different ways to do the conversion of the (typically 8-bit) digital  Output[n] signal to a duty cycle, However, I'll describe just one, as an example: The firmware turns on the SSR drive bit, and starts a timer. When the timer reaches the Output[n] value, the SSR drive bit is turned off, and the timer is reset. Another timer (or even the same timer) can be used to complete the cycle by determine the downtime between pulses sent to the SSR. In choosing the timer delays, we need to keep in mind that SSRs switch whole numbers of AC mains cycles, i.e., in multiples of  16.7 ms (20 ms) for 60 Hz (50 Hz) mains voltage. For 1% control resolution this implies output pulse widths that vary from single cycle to 100 cycles, i.e., 16.7 ms (20 ms) to 1.67 s (2.0 s).    

Due to the modest arithmetic and speed requirements of espresso PID, even tiny microcontrollers costing less  than $2.00, such as the Microchip PIC12F617 can do the job. Therefore, given how little hardware is needed to build a digital PID controller, why pay $50 to $200 for a commercial unit? Apart from the pretty lights and readouts, a list of good reasons would undoubtedly include auto-tune and the modular convenience of an off-the-shelf solution.. Such solutions also typically include out-of-bounds checking and limiting for process variables, and have a built-in interface which relays useful process information (such as PV) to the user, which also allows easy modification of  process constants. The tuning algorithms used in off-the-shelf controllers tend to be proprietary, and no attempt will be made to cover them here.


The objective when tuning a PID temperature controller is to achieve the required temperature as quickly as possible, with minimum overshoot, and maintain a temperature that is as stable as possible, recovering quickly after the influx of cold water into the boiler while pulling a shot.  The Auber PID controller I used is "fuzzy logic enhanced," which due to an unfortunate lack of information about what exactly that is, and how it interacts with the PID algorithm, makes the controller more difficult to fine-tune. I was not satisfied with the performance (i.e., the temperature vs. time curve) after using auto-tune (I ran auto-tune many times), so decided in the end to use auto-tune only as a starting point, and then manually attempt to adjust the controller for better overshoot performance. A particular quirk is a 5 ?C overshoot after pulling the first shot (the bump at 720 seconds in the first graph, above), which slows the recovery time. I suspect that its algorithmic fuzziness is not taking into account the higher starting temperature after the initial ramp up. Fortunately, I don't often pull more than a single double shot, and when I do, I can run off a quick burst of water to cool the boiler slightly.

There are other PID controllers on the market without the fuzzy logic, which may be easier to adjust, but they are much more expensive than the Auber Instruments unit. The PID parameters I am currently using are: SV = 102 oC, Hy(steresis) = 0.3, t = 2 s, FILT(er) = 10, P = 220, I = 600, D = 80. However, even if the controller performance is not yet quite ideal, one consolation is that (compared to the mechanical thermostat it replaced) the temperature performance is still hugely improved, consistent with the ultimate aim of good espresso extraction: preservation of the flavor. Too cold and the extraction does not happen properly, causing flavor imbalance; too hot and some flavor components will be burned.

These (relatively small) issues aside, because (apparently) the Auber's fuzziness is active only during auto-tune, and not during normal processing, its process behavior is absolutely consistent, as should be the case for any good digital PID. Moreover, the same parameters can be dialed in to an identical model Auber controller on another same model espresso machine, and without further tuning, the results will be identical.

INEI Standard for an Espresso Single Shot:

  INEI restretto (Single Shot) (Double Shot)
Necessary portion of ground coffee: 7 g ? 0.5 g 14-17 g
Exit temperature of water from the porta-filter: 88 ?C ? 2 ?C 88-95 ?C
Temperature of the drink in the cup: 67 ?C ? 3 ?C  
Entry water pressure: 9 bar ? 1 bar 9-10 bar
Percolation time: 25 s ? 2.5 s 22-28 s
Viscosity at 45 ?C > 1.5 mPa.s  
Total fat > 2 mg/ml  
Caffeine < 100 mg/cup  
Volume (including crema): 25 ml ? 2.5 ml (0.85 fluid oz) 47-62.5 ml (1.5-2 fluid oz)

Espresso coffee brewing is governed by four important factors known as the four Ms ("quattro M" in Italian):

Miscela - the coffee blend and the roast
Macinazione - the grinding (a high-quality, low speed, conical burr-grinder is best)
Macchina - the espresso machine (water quality, water temperature, pump pressure)
Mano - the manual skill of the barista (dose, distribute evenly in the porta-filter basket, tamp, brew)  

The espresso should dribble smoothly out of the porta-filter like warm honey, ideally have a deep reddish-brown color, and (in a fresh espresso roast) have a crema that makes up 10-30% of the beverage. Once all of the crema has floated to the top, it should look rather solid, and stay intact for several minutes before sinking. Crema is a fine-celled foam of oils that capture the taste and aromatic essence of the coffee. The first drop of a truly high-quality espresso shot should always be pure crema. A bottomless porta-filter may be used to visually assess how evenly the hot water is passing through the tamped puck of ground coffee.