Phase 7

( Click on images for more detail )

 

Introduction

 

 

Data Aquisition and

Process Control

 

This page will detail the construction of  a general purpose sensing, data logging and process control system using a PC/Laptop. Before starting this project I had practically no electronics experience at all, I learnt a lot along the way and if nothing else, learned to reduce piles of dead components to a minimum! ;o)

The system will consist of three distinct elements: 1) The sensor modules 2) The sensor  interface module and 3) The PC/Laptop data acquisition/process control software module. 

The initial minimum requirement for sensors will be for RPM, temperature and pressure measurement. Standardised outputs from the sensors will be 0V-5V or at least within a 5V range to suit the interface ADC inputs. There will also be output options for use with a panel or volt meter so that the sensors can be used as stand-alone modules.

 The sensor interface module requirement is to accept a maximum of 5V input ranges and output 5V ranges with good resolution and with enough input/outputs for all the sensors needed. The protocol between the interface and PC/laptop to be relatively simple to use through the parallel port.

The initial data acquisition requirement is for clear real-time display of all sensor inputs using analogue style gauges and logging of all the sensor data to a file for later analysis. Further requirements are for a means to automatically control the various systems. Initially this will simply be monitoring of the sensors, in particular the RPM and temperature so that an automatic shutdown can be initiated if necessary.

For the future, a full blown process control system where a single button press would start the whole engine could be built. This will require the addition of various output modules involving the use of relays, etc for controlling motors/switches together with feedback control software that will monitor the input sensors and correspondingly control the outputs.

My original design for the system involved building the interface to connect to the parallel port. Although built and tested, this has now been superseded by the use of a microcontroller as described in the next panels.

 

The Microcontroller

Arduino Duemilanove

 

I have now completely redesigned the whole system. The elements described in the previous panel will still exist but altered to fit into the new scheme of things. The new system will be based on the USB Arduino microcontroller which is widely used, well supported and cheap at around £23! The interface module will be redesigned and incorporated into the Arduino format ( called a 'shield' ) and will  plug directly into the microcontroller board doing away with the original parallel cable connection to be replaced by the Arduino's USB cable. The sensor boards will also follow this 'shield' scheme, plugging directly on top of interface shield in a stacking fashion. This has the advantage that the long cable connections between the separate sensor modules and the original interface are eliminated making for a much neater, less packaging and more reliable system. The interface and all the sensor boards will be larger and of the same size ( 7cm x 9cm ). This has the advantage of being able to fit more sensors per board.

The microcontroller will act as the go-between between the interface module and the PC/laptop. The communication protocol is serial over USB, so software can easily communicate with the Arduino using standard serial drivers. The main  reason for the redesign is to allow the system to use the standard USB interface that is incorporated into the Arduino. This has the major advantage that modern laptops may be used many of which do not incorporate the old style parallel printer port. It will also be possible at a future date to do away with the USB cable altogether and allow the system to communicate with the data logging PC/Laptop through a Bluetooth add-on board.. The other advantages of using the microcontroller are the additionally available inputs/outputs of the board.

 

 

General Scheme

 

Above shows the general scheme. The interface sits on top of the Arduino and the sensors modules plug into the  interface in a stacking fashion. The original designs for the RPM, temperature and pressure modules are described in the separate sections below and are kept in for reference/historical purposes. For each description of the building of the original sensor modules there follows information relating to the designing and building of the new revised modules that will fit in with the new microcontroller based scheme.

 

 

 

Sensor Interface

 

 

Original PC/Laptop Interface

 

Once again cost and suitable specifications were the criteria for deciding to design and build my own interface. Initially the interface board will have 11x 12-bit resolution ( 1.2mV resolution over a 5V input range ) analogue-to-digital ( ADC ) inputs for the sensors, 8x 8-bit resolution ( 20mV resolution over a 5V output range) digital-to-analogue ( DAC ) outputs for driving various motors/valves, etc for control purposes. In addition, the spare I/O's of the parallel  port will be given over to 4x digital inputs for manual/pressure switches for example, and 4x digital outputs for alarms, shutdowns, etc. These IC's  use a specific interface protocol called SPI (Serial Peripheral Interface) that needs to be used to 'talk' to these IC's in order to control them. This type of interface is the easiest to program as instructions can be written to the IC directly from the software and in an asychronous manner, meaning that there are no timing issues to deal with.

 

Original Interface Schematic, Breadboard and PCB design

 

 

PC interface circuit. The IC's I am using are the TLC2543 ADC and the TLC5628 DAC. The initial breadboard setup ( above pic ) proves that I can get something working with these IC's. I chose these particular IC's because they provided the best compromise in terms of packaging, specification and interface protocol (SPI) for which the PC parallel port lends itself very well. The ADC and DAC chips will be driven by a separate software module which will effectively constitute a standalone voltage reading/writing device for testing purposes. This module will then be bolted onto the main software at a later date.

Update: What follows in the next panel is a re-design of this board to fit in with the new scheme and improvements in terms of number of inputs. 

 

 

 

 
 

 

 

The New Arduino 'shield' style Interface Module

The new 'shield' style interface module has a couple of major improvements over the old design. Because of the larger 7cm x 9cm board, as well as having the DAC, instead of having just 11 input channels, the new interface will have a total of  22 input channels using 2 x TLC2543 IC's. These extra channels will come in very handy as it is all too easy to run out of sensor inputs! In addition, because this interface will plug directly into the microcontroller board, it will also make accessible the available inputs/outputs of the microcontroller itself. For the Arduino, these include among others, 14x digital input/output pins of which 6 can be used as PWM ( Pulse Width Modulation ) outputs ( very useful for controlling motors ) and 6x 10-bit analogue inputs which can be also be configured as extra digital I/O pins. This feature is handy as these analogue inputs are now virtually redundant given that I now have 22x 12-bit inputs...! ;o)  The DAC and the two ADC's will be driven by a single 8-bit serial in, parallel out (SIPO) shift register, emulating the way I originally had driven the IC's when using the parallel port. The shift register only requires 4 digital I/O pins from the microcontroller. 

 

Interface Module Schematic and PCB Design

Arduino Template

Top pic shows the Arduino laid  out as a PCB template in the same scale as the interface so that I can use it as an overlay guide to line pins and holes up, etc. Bit of a tight squeeze but managed to get all components on..! ;o) Design based on single as opposed to double-sided copper clad board as this make things simpler from a prototype making standpoint. If you are careful in designing your layout, it should only result in a few extra cross-over wires to be soldered.

 

Laying The Tracks

 

Proto Board and Layout

 

Finished!

Close-Up

The Proto Board I originally ordered to base all my modules on, perfect size, ready made and designed my boards accordingly. Originally I thought that the copper tracks were a proper matrix unlike the standard strip/vero board, meaning I could solder my components and simply cut the tracks accordingly. When the board arrived, the 'tracks' turned out to be individual copper 'spots' meaning I would have to solder in wire runs to make my tracks! :o( Why there isn't a prototyping board with a proper matrix rather than this rubbish stripboard I don't know.. pity..! 

So therefore, once again, as this is a prototype, I decided to lay the tracks using the simplest method, i.e. first drilling the holes using the Layout as a guide and then 'joining the dots' using a PCB marker pen in the same way I made the tachometer board ( see below ).Very fiddly, time consuming job if you want things as neat as possible ( took me about two days )! The tracks may look a bit rough at this point but they will turn out fine.  I used the epoxy fibre glass type board as opposed to the SRPB ( paper based ) type as they are thicker, sturdier and generally have a better quality look and feel. The etching process now begins..

 

 

Board Etching

 

Go..!

 

Almost done...       Finished!

Here is the board etching away in a warm solution of dissolved Sodium Persulphate crystals. This normally takes around 20 minutes but as the copper on this particular board is of a thicker, better quality ( 305g/m copper clad board on 1.6mm thick epoxy glass material ) it took around one hour. The solution turns blue as the copper is removed from the board and Copper Sulphate is produced from the chemical reaction.

 

Board Cleaning

 

Final cleaning off of the etch resist pen using carburettor cleaner, WD-40 or some other suitable solvent and a quick rub down with a PCB abrasive cleaner. The result is pretty good and I think worth the extra effort over using stripboard, making for a much neater package. On close inspection a tiny amount of the copper had been etched away from around the edges of some of the drilled holes as the etch resist pen ink tends not to provide coverage over sharp edges. Of course what I had neglected to do was grease the holes before starting the etching process which I had done when making the tachometer board. Not really a problem, just the perfectionist in me..! ;o)  Now, time to add some components...

 

Adding Components

Main components added, just the cross-over wires to add. Top left pic shows pins that plug into Arduino. Bottom right pic shows proto board in position where first sensor board will go.

 

 

 

RPM Measurement

 

 

Original RPM Circuit Schematic,

Breadboard, PCB design and Build

 

 

 

Cheap laser RPM meters are available on Ebay ( top pic ). I purchased one to see what you could get for your money but quickly found it to be unsuitable for my purposes. They are bulky, not as accurate as I would have liked, only read up to 99,999rpm, and require a reflective strip to be attached to the rotating body to be measured. Given that, and not finding anything else suitable on the market, I decided to design and build one myself.

Above are the original schematic diagrams of the circuit, breadboard setup for testing purposes  and the resulting PCB layout. The breadboard is just a piece of plywood drilled and tapped with cups and screws. Bell wire was used for making the connections which is great because there is no need to 'tin' the ends and it stays in place when you bend it! ;o) I designed the schematic and PCB layout using freely downloadable software from an electronics circuit board manufacturer ( see Software section on main page ) of which there are many examples. When the PCB layout is printed it is printed at exactly the same size as the board will be.

The design criteria for the RPM circuits were: 1) that it should be able to read to 150,000rpm with an accuracy of +/-500 rpm, 2) Primary output option to allow use of any digital volt/panel meter for display in units of RPM as opposed to frequency, 3) Outputs to allow optional use of automotive digital tachometers and input into analogue to digital convertors for input into a microprocessing device 4)  Work off a 12V power supply and finally from a physical point of view, 5) Small ( 2" x 2" ), cheap and stackable as I will be needing at least four for my purposes, one for each of the two turbo's one for the freepower turbine and one for the aero engine.

 

 

Preparing and Drilling

the Circuit Board

  As the first board is a prototype, I decided to try and make the circuit board with minimal facilities and low cost. Materials included the single-sided copper clad fibreglass board, a Dremmel milling tool bit of 0.7mm for making the holes, an etch resist marker pen ( any permanent marker will do the job ), some copper etch powder and finally a special abrasive 'eraser' designed for cleaning and de-greasing the copper in one go. I began by printing out the circuit on an ordinary ink jet printer. I then tacked the diagram in place with some Araldite. I oiled the paper to make it transparent so that I could clearly see the where to drill the holes. The holes were drilled using the 0.7mm Dremmel bit mounted in an ordinary electric drill. 0.7mm is just the right size for the component wires and even the 'legs' of the DIP sockets. The only holes that I needed to widen slightly were the ones that took the 5V voltage regulator.  

 

Laying The Tracks

 

Once the holes were drilled, I removed the paper, cleaned the board of residual Araldite, used the abrasive eraser to clean and de-grease the copper and then proceeded to 'join the dots'!. This was very painstaking and took a while to complete to my satisfaction. The technique to applying the marker pen is to apply it in 'blobs' or 'dots', letting this dry and then re-applying the marker pen. This ensures that the the ink is solid and there are no holes in the tracks. I deliberately designed the tracks to be as wide as practically possible to allow me the maximum area for soldering.

 

Etching the Board

 

 Once the tracks were laid  it was ready to immerse into the etching solution. Before immersion, and as an extra precaution, I applied a little grease to each of the holes in the board to block them off. This was to ensure that the etching solution didn't undercut the holes. Immersion in the solution normally takes about 20 minutes to fully complete depending on the temperature. The above pictures show the results with a few of the components already mounted on the board.

 

The Finished Board

This is the finished board. I had to make an adjustment with a couple of the tracks as they weren't correct. This involved cutting the tracks and soldering a couple of cross-over wires. This done, the board worked perfectly just like the bread-boarded setup.

 

The Display

Panel meter display. 5V-15V supply, and selectable two modes of operation 0V-2V and 0V-20V, cost around £10. Connected directly to the board for power and signal input. I could have used an ordinary digital voltmeter but purchased this with a view to making a standalone tach unit.

 

The Sensor

 

Laser diode and photodiode sensor pair. Note that I use a photodiode as opposed to a phototransistor. Although a phototransistor could be used, in the particular situation where the laser is reflected off the nut, the phototransistor can not switch fast enough and in practice limits the tachometer to about 16,000rpm. A phototransistor has a response time of around 10 micro seconds, a photodiode has a response time on the order of 1000 times faster! The laser diode mounted in 10mm brass compression fitting, photodiode temporarily mounted in brass 10mm to 8mm reducer. Both will be eventually mounted in brass compression fittings for ease of installation in a variety of situations.

 

 

Testing

I needed a simple rotating body for initially testing the tachometer against. This is a 12V computer fan with blades removed, a nut epoxied to the hub and a small metal disk epoxied to the nut. The nut had two of the faces polished and the others blackened with a permanent marker. The metal disk was similarly marked.

Here the fan is rotating at around 10,000 rpm. The laser is aimed at the nut which produces two reflections per revolution. The tachometer has been jumpered to a divide by two setting. There are options for 1:1, 2:1, 6:1 and 8:1 depending on the type of rotating body that the tachometer is to be used with. The panel meter is currently displaying 99mV which indicates that the fan is rotating at 9900 rpm, +/- 100 rpm. Full scale reading is 1.500V which indicates an rpm of 150,000.

The bottom pictures show an improved tach testing device. Made from the turbine and shaft section of a small Nissan turbo. Shaft mounted on small ball races, oiled simply using Diesel for low friction. Operation involves attaching an 1100 Watt vacuum cleaner to the welded tube on the turbine outlet which spins things up very nicely..!  Managed to get +80,000rpm which should be more than enough to test the sensor part of the tach. The noise at these speeds is excruciating, definately need earplugs..!!

 

 

Packaging

 

The tachometer circuit will be fitted into the metal box shown above for which the size of the circuit board was designed. I've decided that the whole package will be designed primarily for use with the PC interface with only two input/output cables. One will carry the 12V power supply and signal output wires and will connect to the  interface board via 3-way jack plugs. The other cable will be for the sensor, carrying laser power and photodiode signal wires and which will split into separate laser and photodiode 'heads'. The tach unit could easily be converted into a standalone device by splitting the tach/interface cable into seperate power and display cables to feed a panel meter such as the one used for testing. You could even make a handheld device, but this would required repackaging in a larger box with a suitably small 12V battery supply.

 

Final Thoughts....

This method of producing circuit boards is fine if you are making small one off boards like this but it is not to be recommended for larger or multiple boards! There are many other more convenient ways for transferring a circuit design onto circuit board and I recommend you try these! Alternatively there are a number of companies out there that will make up a few small boards for minimal cost. Once the prototype has been proven to work I intend to use a manufacturer for creating duplicate boards.

Update: What follows in the next panel is a re-design of this board to fit in with the new scheme and a few improvements for increased reliability and accuracy...

 

The New Arduino 'shield' style

RPM Module

The new shield style RPM module is directly based on the original RPM board but will have a few extra bells and whistles to allow for greater ease of calibration using the microcontroller as well as a few updates to some of the components for greater accuracy and a design change that will allow for greater reliability. The board now relies on only one pulse per revolution, eliminating the possibility of missed pulses from multiple reflections and the divider options are now 1:1, 2:1, 3:1, 4:1 and 5:1. I am currently in the process of building the board and will post further as work progresses...

 

RPM Module Schematic

and PCB design

 
 

 

 

Temperature Measurement

 

 

Temperature Sensors

Probe Type

Pipe Plug Type

All temperature measurement, e.g. exhaust gas, oil, fuel, etc, will be performed using thermocouple devices. This is to keep things as simple and consistent as possible so that less work is required. A thermocouple is a special type of wire that generates a very small voltage in proportion to the amount of heat applied. It is possible to take a direct reading using a digital voltmeter but this will not result in a very accurate readings. Instead there is an IC that will accept the small voltage signal from a K-type thermocouple and amplify it into a corresponding voltage which can be read by a voltmeter or fed as input into an ADC as I will be doing. There are many different styles of thermocouple, each conveniently designed to measure temperatures of a particular medium. Examples shown above that I will be using are a gas temperature probe and a pipe plug probe that can be screwed into the oil tank for measuring oil temperature. 

 

 

Signal Conditioning

AD595

K-Type Volts vs Temp

K-Type 0-1372

AD595 Error

NIST Correction Formulae

A K-type TC produces a voltage in proportion to the temperature applied to it ( see K-Type Volts vs Temp and  K-Type 0-1372 which shows uV/DegreeC in a more convenient format ). The AD595 is used to amplify and condition this very small microvolt signal  of around 40uV/DegreeC into a more easily readable 10mV/DegreeC. Unfortunately the voltage/temperature relationship of a thermocouple is non-linear and the AD595 simply amplifies this signal without providing any correction ( see AD595 Error). If we want to measure over relatively small temperature ranges to an accuracy of a few degrees, e.g. 0-300 Degree C, then we can get away without any further processing. Or, if we want to measure from 400-700 Degrees C then we can invent our own simple linear correction factor. But if we want to measure over a wide range, e.g. 0 - +1200 Degrees C and to an accuracy of +/- 1 Degree C then we must apply a more complicated form of correction, otherwise we can expect errors of +25 Degrees C at temperatures of around 800 Degrees C. Any correction procedure is a mathematical process performed in software after the voltage has been input into a microprocessing device. For a 0 - +1200 degrees C range this is where the NIST correction formulae can be applied ( see above ) and which I will be using in my DAQ sofware.

 

Original Temperature Circuit Schematic and PCB design

 

Temperature module. Using K-Type thermocouple for measuring 0 to +1250 degrees centigrade.

Update: This design is being changed to fit in with the new scheme to be described in the following panels..

 

 

The New Arduino 'shield' style Temperature Module

The new temperature module has been re-designed with a number of benefits. The size of the 'shield' boards for all sensors has been increased to 7cm x 9cm which means more space to play with. For the temperature module this means that I can have up to 4 AD595 IC's on one board and also incorporate a couple of extra facilities for amplification so that each of the 4 temperature sensors can be individually adjusted for range and sensitivity. I am currently in the process of building the board and will post further as work progresses...

 

 

 

 

Temperature Module Schematic and PCB design

 
 

 

 

Pressure Measurement

 

 

Pressure Sensors

ASIC

Pressure measurement can be performed by dedicated PCB mounted IC's, a few examples of which are shown above from a number of manufacturers. These are designed to take pressure readings and convert these into temperature compensated  proportional voltages. Voltage ranges from 0V-5V full scale can be produced which are ideal for reading by a voltmeter or ADC. The ones I decided to use are the ASIC ( Application Specific Integrated Circuit ) industrial pressure tranducers ( bottom pic ) which were bought cheaply off Ebay. They are 1-6V output, 0-870psi, not quite the ranges I would have liked but still very much usable..! ;o) Given the 5V upper limit on the input to the ADC, and no amplification, a 0-725psi ( 1V-5V ) usable range is possible at a resolution of 1/5 psi. With their 1/4 BSP mounting thread, this also makes them ideal for fitting into hydraulic circuits.

 

 

Arduino 'shield' style Pressure Module Schematic and PCB design

To be completed...

The pressure module will be designed to fit in with the Arduino 'shield' format just like the other sensor boards. Once again, because of the larger size of the board it will be possible to incorporate 4 maybe up to 6 pressure sensors per board. Each of the pressure sensor outputs will be fed into circuitry that will act as 'instrument amplifiers' that will allow zeroisation of the output as well as providing the facility for amplification. This will allow for each individual sensor to be adjusted for different pressure ranges and sensitivity.

 

 

 

 

 

 

Testing

 
For testing and calibrating the pressure transducers I made the above test rig. The white pressure vessel is made from a cut down MIG welding CO2 bottle. The input is via a schreider valve from a car tyre and the rig is pressurised using a bicycle shock pump capable of 300psi.

 

 

The Data Logging Software

 

 

PC/Laptop Data Capture and

Logging Software.

Above shows the laptop to be used, which I got given free. It's an old Toshiba Portege 300CT,  Intel Pentium 133Mhz, 32Mb onboard memory expandable to 64Mb, 1.5Gb hard disk and a 10.4" screen with a maximum resolution of 1024x600. Below is a universal in-car laptop charger bought new and cheap through Ebay. It works off a 12V car battery, and has selectable output voltages, a perfect and simple solution to onboard power supply! ;o) The software is to be implemented using Visual Basic 6 and the graphics implemented using the simple Windows GDI interface. There are a few requirements for the software. One is to be able to read the voltages from the various sensors via the Arduino microcontroller and display them for easy readability. The software is to implement a simple read/write interface across all the input/output devices regardless of type. Another requirement is to allow for the logging of that information for later analysis. A third requirement is to provide some form of control interface that will allow the user to set parameters for the controlling of motors/actuators based on sensor inputs. This last requirement is a large task to implement in itself as it requires the control interface to be designed so that it makes it easy for the user to choose any permutations of input and to control any permutations of output. I need to have a good think about this one..! ;o)

 

First Draft Instrument Panel

I started to write the software from scratch primarily because I wanted a dedicated interface. There are software modules that you can purchase for the displaying of data using classic analogue 'needle' or 'dial' type gauges but these are relatively expensive and from what I've seen not fully customisable. I wanted at least a fully customisable needle gauge and also a 'bar' style percentage gauge for temperature readings for example.  Some examples of the implemented gauges are shown above. The current implementation allows for any style of needle to be designed based on simple drawing primitives and whether that needle is of the ordinary type or 'flood' type. The face of the dials can be any background graphic. The examples above are ones I pulled from the net and tweaked in Photoshop. Shown is the software running on a 1.8Ghz PC. I've transferred the software over to the laptop and despite it's relatively low spec it runs surprisingly well although a little slow on the 'Flood' type gauges at full scale deflection but certainly still usable. A memory upgrade to 64Mb may help a little, or possibly a faster laptop at a later date..

 ..To be completed..

 

 

 

 

 

 

Last updated

Tuesday, 18 May 2010

 

// Google Analytics