Skip to main content

Case study: existing vs proposed system

Short answer

Architecture: existing manual/thermostat, analog gauges; proposed closed-loop microcontroller with PT100, ADC, RS-485 Modbus, SCADA. Microcontroller chosen for on-chip ADC/timers/UART, low cost, deterministic. Interfacing: PT100→amplifier→12-bit ADC (0.037°C/LSB) with EOC; flow timer; keypad scan; LCD 4-bit E strobe; RS-485 9600 8N1; outputs opto-isolated. Drawbacks: noise, drift, firmware, training.

Answer the following questions with regard to your case study: (a) Discuss the main architectural differences between the existing system and the proposed system. (b) Does your proposed system use a microcontroller or a microprocessor? Justify your choice, and make a neatly labeled block diagram of your proposed system. (c) In your proposed system, explain in detail the interfacing process of peripheral devices with the microcontroller or microprocessor in terms of data format, data rate, data converters, communication protocols, timing diagrams, and handshaking signals. (d) List the technical drawbacks present in your proposed design.

Assumed case study: a milk pasteurisation and packaging section of a dairy plant (HTST process: raw milk tank, heat exchanger, steam-heated holding tube, cooling, filling). The existing system uses analog panel indicators, bimetal thermostats, a manual steam valve and operator logging. (If your own visit was to another plant, replace the process names; the structure of the answer stays the same.)

(a) Architectural differences

PointExistingProposed
ControlManual / thermostatClosed-loop digital (microcontroller)
SensingAnalog gauges, bimetalPT100/level/flow sensors + ADC
ActuationManual valve, push-buttonRelay/SSR driven valve, pump
MonitoringVisual, logbookLCD + PC logging, alarms
CommunicationNoneRS-485 (Modbus)
FlexibilityFixedProgrammable set-points

(b) Microcontroller or microprocessor

A microcontroller (e.g. ATmega328/ARM Cortex-M) is chosen. It has an on-chip ADC, timers, UART, GPIO and flash/EEPROM, so few external parts are needed, and it gives lower cost and power and a deterministic response. The task also has few I/O points. A microprocessor would need external memory, ports and an ADC, which increases cost and complexity.

 PT100 --> Amp/SigCond --+
 Level sensor ----------+--> MUX/ADC (12-bit)
 Flow sensor ---(pulse)-+         |
 Keypad ----------------+---> [Microcontroller] <--> LCD 16x2
                               |  ARM/AVR + flash   |
   Opto + SSR/relay <----------+  watchdog, timers  +--> RS-485
     |                         |                          (Modbus)
 Pump / steam valve / alarm    +--> EEPROM log         PC / SCADA
 Power supply: 24 V + 5 V + UPS

(c) Interfacing of peripherals

  • Temperature (PT100): analog 0-5 V after the amplifier; 12-bit ADC (resolution 150/4096 = 0.037 C); data format: binary right-justified, scaled in software; sampling at 10 samples/s; anti-alias RC filter. Timing: start conversion, wait for the end-of-conversion (EOC) flag or interrupt, then read the data.
  • Flow sensor: a pulse train counted by a timer/counter input (frequency is proportional to flow).
  • Level switch: digital input through an optocoupler with a pull-up.
  • Keypad: 4x4 matrix, scanned on I/O ports, debounced for 20 ms.
  • LCD 16x2: 4-bit data mode with RS and E handshaking signals (E pulse at least 450 ns).
  • Relay/SSR (pump, valve): port pin -> optocoupler -> transistor driver -> relay with a flyback diode.
  • PC link: RS-485 transceiver (MAX485), 9600 baud (data rate), 8N1, half-duplex, direction pin (DE/RE) controlled by the MCU; Modbus RTU frame with CRC, register values sent as 16-bit words; one frame of 8 bytes needs 8.3 ms.
  • Handshaking: ADC SOC/EOC, LCD E strobe, RS-485 DE/RE and master-slave polling.

Timing diagrams (H = high, L = low):

 ADC conversion (SOC/EOC handshake)
 SOC   ____/-----\_________________________________
 EOC   -----------\____ converting ____/------------   (polarity depends on the ADC)
 DATA  ---------------------------------[ valid ]--
                                          ^ MCU reads the 12-bit result after EOC

 LCD write cycle (4-bit mode)
 RS,RW ====<  stable  >==========================    (set up before E rises)
 E     ______/---------\__________________________    (E high >= 450 ns)
 D4-D7 ======<   valid data   >==================     (latched on the falling edge of E)

 RS-485 transmit (one byte, 8N1)
 DE/RE ____/-------------------------\______         (high only while sending)
 TXD   ----\ start |D0 D1 ... D7| stop /-------      (1 bit = 104 us at 9600 baud)
 RXD                                  <- master listens for the slave reply
/* Assumed: 8-bit MCU, ADC on channel 0 (PT100 amplifier), relay on PORTB.0 */
unsigned int read_adc(void){            /* 12-bit conversion */
    ADC_START(); while(!ADC_DONE());   /* start, wait for EOC */
    return ADC_DATA;                    /* 0..4095 */
}
void control(void){
    float t = read_adc() * 150.0 / 4096; /* temperature in C */
    if (t < 72.5) STEAM_ON();           /* open steam valve */
    else if (t > 74.0) STEAM_OFF();     /* hysteresis control */
    wdt_reset();                        /* watchdog */
}

The control band (72.5 to 74 C) stays above the 72 C minimum holding temperature.

(d) Technical drawbacks of the proposed design

A single controller is a single point of failure; it is sensitive to noise and power cuts; memory and processing power are limited; calibration drifts; RS-485 is half-duplex and slower than industrial Ethernet; custom firmware needs maintenance; and it has no certified safety rating, which a PLC has.

✓ Answer checked by Claude Sonnet 5.5

All Instrumentation II chapter 10 questions →