Presentation on theme: "ECE504 ST Project Jeff Rice"— Presentation transcript:
1ECE504 ST Project Jeff Rice Arduino Based Temperature Controller, Ethernet Enabled**Please Click on Icon to Hear Sound, then clickOn slide when sound over to advance**
2Presentation Structure Arduino OverviewReview of Temperature Controller Project stages and resultsMicroprocessors role in industrial & utility controllers
3Arduino Overview Pin connectors for I/O Serial port interface (SPI) Crystal Oscillator (clock source)USB port and onboard USB-serial chip allows easy programming in C languageVolt Regulator – to allow wide input voltage rangeThe arduino platform is an open source hardware and software development package, intended for both programmers and non-programmers. The boards come in several flavors. Shown here is the Arduino Uno, the most popular version of the current revision of the Arduino boards available. The intent of the Arduino is to be a simple, easy to use development platform that is both readily available and has a wide array of users extending the basic functionality through libraries. The hardware is simple, adding a voltage regulator (to allow more input voltages), a crystal oscillator (to allow for basic chip timing and timekeeping in programs), i/o pins (for controlling external hardware) and USB and FDTI serial interfaces to the basic chip. The base chip is an Atmel corporation ATMega 328p 8 bit microprocessor with a pre-loaded bootloader.Brains – Atmel ATMega RISC microprocessor with pre-loaded bootloaderResult - $30 microproc. Based dev. Development board with wide usage and many open source libraries.
4Arduino: Open Source Enabled Actuators: LEDs, Solenoids, MotorsPeripherals: LCDs, remote I/O (I2C)Direct Inputs: Heat, Light, MotionArduinoBoardZigbeeLibrariesLCDX10 (PLC)I2CServoPIDSD CardCapSenseStepper MotorLowPowerText MessagingModbusPrintingTonesPC or Mac runningArduino IDEWhile the CS majors may be well used online forums, standardization and open source libraries as tools speed development, I was surprised at the ease with which one can walk right into programming one of these development boards. About ten years ago I worked with Motorola 6800 series chips and the learning curve between those and this were an order of magnitude different. The chief reasons for this were not differences in hardware but rather a wide support structure through the internet where code, code problems and code fixes are shared and documented. There are typically multiple libraries readily found for any software or hardware task which are open source and well commented. And the IDE is elegantly simple, allowing a user to code in C using high level functions or direct bit operations on the micro registers.
5Arduino HistoryProcessingBen Fry & Casey Reyes create Processing, programming language for Artists (MIT, 2001)WIRINGWiring IDE, development board & language created (Ivrea Italy, 2003)ARDUINOArduino developed for low cost student development (Ivrea Italy, 2005)As a side note, the Arduino project was a furthering of two previous languages and associated hardware. The original framework was developed at MIT as Processing, a language for artists, that was taken and reworked into a language to program the Atmel microprocessor called “wiring”. Wiring was then further refined to lower the cost of the board as well as further simplify it to reach a broader audience of prototypers and inventors, and the result was the “Arduino” platform. One thing I liked about Arduino is that it is largely focused on being a community driven project.
6Thyristor ReviewThyristors are widely used three terminal power semiconductors – if you gate it the unit conducts until reversed biased.Mature technology, mass produced and widely used for motor drives & invertersGate not isolated from Cathode
7Thyristor Trouble (continued) 5v gate signal driven by micro and power supply, thyristor cathode and anode hooked to AC mains supply.Not realizing the gate was not isolated, it seemed like the logical solution to drive the gate pulses with the microcontroller whileThis brings forward an important design criteria (other than doing sufficient research before flipping the on switch). Isolation is both difficult and very important for control circuits interacting with high power.
8Using a Solid State Relay Duty cycle control over 1 second interval120 segment resolution (# of half sine waves)Solid state relay required due to cycles needed. Unit will switch twice per second, meaning over 7000 operations per day.While the unit I used was a “zero crossing” type, there are also “random fire” types.
9As you can see design for solid state relays have the trigger built in As you can see design for solid state relays have the trigger built in. On this diagram the main power components (Triac is a bidirectional Thyristor) can be found by looking just down and to the left from the skull and crossbones. You can there is some design involved in isolating and signal conditioning in the trigger circuit preceding the Triac.Image by Tony van Roon (http://www.sentex.ca/~mec1995/gadgets/relays/relays.html)
10Digital Temperature Sensor Hardware SetupAC BreakerDigital Temperature SensorArduinoHere are the local parts of the setup PID temperature controller unit.Sensor = digital temp sensor on serial “one wire” interface. This interface was created by Dallas Semiconductor and is used in a number of sensor applications. It is a low data rate multidrop communications system. Interestingly, the reason it is called one wire is that the devices are made to be powered via the communications line Typically units are in a listening mode which is low power and store charge on an internal 800pf . If a unit must switch into a high power mode to perform some processing or a function the main processor will signal the sensor to start the task and hold the data bus high for a pre-determined amount of time while the sensor accomplishes its task. Then the main processor polls the sensor and data is exchanged.Output = microprocessor triggers the solid state relay maintained for part of a second corresponding to output percentageThere is an LCD which displays the duty cycle of the heater, the temperature read from the sensor and the temperature setpoint.Local LCD HMIHeating ElementSolid State Relay
11PID Control Loops Overview PID Loops: very common control loopPID = Proportional, Integral, DerivativeControlled Variable, Setpoint, OutputAs there was some question about the term “PID” in the progress reports I thought I’d briefly review what a PID controller is. PID is a type of continuously acting control loop. PLCs and other control devices not tied to a specific process but used in many different situations will typically have them as a basic programming block. Wikipedia list them in the PID article as “the most commonly used feedback controller”. By changing parameters in the PID control loop this general controller can be made to correctly respond to most process control problems.The PID controller takes the error, which is the difference between the setpoint and current value of the process. For my project this is the difference between the actual vessel temperature and setpoint.P = Proportional -> error * constant Kp = response. P is the most basic response, but you will stabilize with the setpoint and actual value off by some amount.I = Integral – error integrated over time * constant Ki = response. I will integrate the error and so over time will influence the output to make the setpoint and actual value come togetherD = Derivative of error signal * constant Kd. D increases the response speed and helps avoids overshoot.All three responses taken together change the output.Image source = Wikipedia
12Simple Web Setup Any Computer with a Web Browser Web Browser Ethernet To achieve the web serverEthernet Expansion Board with Wiznet 5100 TCP/IP ChipArduino UnitPID LibraryEthernetLibrarySSR Firing RoutineOne Wire Comm.
13Simple Web ResultVirtual Emulation of Local LCD Display with ability to change setpoint
14Full HMI Setup Inductive Automation Ignition Runtime and IDE Status ModuleHMI IDE and RuntimeHistorian Database & DriversOPCKepware I/O ServerUSBAfter doing the simple web interface I wanted to add to the remote interface to make it more like a typical industrial or utility control system. The web interface lacked data storage, system metrics, security and a number of other features. To “upgrade” the system I utilized the Kepware I/O server and Inductive Automation’s HMI platform running on my PC. I used a modbus library for Arduino that responded to a Kepware Modbus master driver to create the data exchange. You might wonder why use an I/O server. The I/O server handles any complexities associated with communication such as polling, communications hardware and protocol requirements. It then translates and concentrates all of the data into a single interface to pass on to the HMI system.Arduino UnitPID LibraryModbus Library Register DataSSR Firing RoutineI2C Comm
15Kepware I/O ServerHandles communication to hardware, data concentration and status flagging
17Here is a screen from the HMI that was created for control of the unit Here is a screen from the HMI that was created for control of the unit. This HMI has a number of built in featuresFor operators of large systems it can have many screens and data points, and alarm and data logging so out of range events are brought to the operator’s attention.As you can see on the screen items can be flagged by animation including color and movement to attract attention to important areas. This must carefully be managed to avoid overloading the operator with too flashy of a system.Trending is a critical item here and requires a database to store historical data. Then operators can easily look at past and current data trends to determine when and how things have changed.Setup as a client/server systemThe system support redundancy of the serverIn this case the PID loop is not tuned and immediately overshoots, causing alarms.
18Need for Local ControlNote that processor controls the process, not the HMI.No critical process data routed through HMI.LCD Serves as Backup indicationTypically a real critical process would have a “hard” backup to the controllerOne thing I thought about as I ran between watching kids and leaving this thing run amok in the garage was the safety of the system. At this point I had not tuned it and did have it melt my plastic temperature controlled “vessel” a few times.While the computer control was nice, I did not want to have the processor require the computer to safely control the process. Especially when my computer decides to randomly reboot and install lengthy updates. So no critical data was routed through the HMI / SCADA.The LCD served as a backup indication which could be quickly checked to get a local indication of the system, whether or not the PC interface was on. Basically if the micro was powered, the display came on whether or not I had my PC connected..While I did not have time or equipment to install a fail-safe backup to the temperature controller, I did recognize the need to do so if it was to run unattended. To be safe most systems have some sort of physical barrier to the system failing in a dangerous state such as:Fire systems – have meltable links so even if dampers are not closed by the fire control system they fail closed when exposed to heatProcess tanks – often have an overflow prevention mechanism that shuts off the filling port/pump if level approaches spillFor this temperature controller, I would have installed a temperature based bimetallic switch that would cut power to the motor if the vessel drastically overheated and require a physical reset.
19Arduino Ethernet board Security Issues Based on Wiznet 5100 chipFound published errata on chipWhen I delved into trying to discover security holes with the Arduino ethernet board, I found Wiznet the ethernet board’s main chip manufacturer had published the errata shown on the right of the slide. This errata sheet basically describes how the chip will not finish send commands on UDP packets if it receives a packet during its send process. I had trouble making this happen as I found that the libraries for UDP were not well developed and it would be difficult to understand whether I was making the library or the hardware malfunction during tests.It surprised me to find encryption with the Arduino is possible and being done by a number of people interested in cryptography. I found libraries doing RSA-512, AES-256, SHA, and HMAC-SHA. In fact there are a number of papers on the internet on doing encryption on small microprocessors, even down to low power 4 bit micros.Working directly with a process through hardware made security take on a new meaning for me; If I was running unsecured Wi-fi to my PC exchanging modbus ethernet messages with the Arduino, it might not take much time watching me send my three pieces of data back and forth in Wireshark to figure out how to change my temperature setpoint from 70 degrees to 10,000 degrees and set my garage on fire.
20Bridge to PLCs In Process Control we don’t hear people talk about MicroprocessorsLibraries and common codeInstead Industrial vendors eitherDevelop everything themselvespackage chipsets and libraries in their own “wrappers”
21GE Fanuc VersaMax MicroController One of the more common GE micro PLCs
23GE Labeled, But Made By…. Someone Else? Renesas microprocessorHitachi manufactured PCBGeneral Electric’s Versamax PLC (GE’s most common Micro PLC line) dis-assembled reveals thatMain computer is a Renesas 32-bit RISC Microcomputer, Super H SH7000 seriesInformation for chip hardware and software packages on web.
24PLC Demolition Results If we can extrapolate from this one example:Although PLCs looks like custom built pieces of proprietary hardware and software…The industry reuses technology and components. Use of such third party hardware and software can open the doors of information to mal – actors
25Presentation Conclusion Learning / Research projectGained experience with Arduino, Processing, Libraries and C language, Modbus protocol, GE PLCs, One Wire protocol, Thyristors and Solid State Relays and Ignition HMI platform.Hopefully some of this was passed on in the presentation!