Unmanned Rig

Standard

The last project of my undergraduate life was an industrial embedded system. Wabco, a major hydraulic system manufacturer, wanted a system that would continuously monitor a testing rig. Testing rigs are those machines that they use to test the hydraulics and this involves pressure and temperature parameters. The system should be able to monitor these parameters for sustained periods of time (24X7). The operator is required to give lower and higher threshold values for each parameter at the start of a testing cycle and then the system measures the parameters to see if they are within the 2 thresholds. If not, then there is an abnormality and in the event of any abnormality, the system should report it to the operator through a SMS and stop the rig. For completeness, the board has a display that sequentially displays the parameter values. The embedded system is designed to handle 6 pressure values from 6 pressure transducers and 2 temperatures from K-type thermocouples.

A major feature of the board is an indigenous solution to a local problem we have in Tamil Nadu – power cuts. The board is designed to detect these power cuts and intimate the operator and when the power resumes, the rig is automatically restarted without manual intervention – automation.

The major components of my design were an MSP430G2553 microcontroller (for central processing), an ATMega16 microcontroller (to provide display data for the 7 segment displays through IC7447 decoders), a GSM module interface (to send the SMS), a MAX4617 multiplexer (to channel the 8 sensor values), a relay (works in tandem with the rig’s control switch to stop or start it) and on-board power regulators for the power supply. After the schematic development, PCB layout & manufacture and assembly of components – the result is:

IMG-20160327-WA0000

The embedded system’s top side (above) and the bottom side (below)

IMG-20160318-WA0007

 

For ‘industrial reasons’, I wasn’t allowed to take my phone to record the video of the board working with the rig, but here is the next best video I have – the testing of the board with 1 pressure and 1 temperature monitoring.

The curious thing about doing an industrial project is preparing and analyzing FMEA – Failure Mode and Effect Analysis to evaluate the performance of the system. This is my FMEA for the Unmanned Rig

Advertisements

Hybrid Power Supply

Standard

With the world’s  energy crisis only getting worse as days go by, the importance of renewable energy sources like solar power is becoming much more prominent. Solar power typically provides direct current (DC) while most commercial power supplies provide alternating current (AC). So, if a house were to be provided with solar power and utilized commercial power whenever the solar power wasn’t enough, then the appliances should be able to work on both AC and DC supplies. Also, typically solar power voltages are substantially lower than commercial AC supplies. So there is quite some diversity in the kind of power being supplied.

Most appliances today including computers, inverter ACs, TVs and even batteries etc., all work based on DC. Typically for these DC based appliances, batteries use an inverter to provide AC (to be compatible with commercial supply) and then the appliance rectifies it back to DC for its use – with energy wasted during these conversions.  So, the requirement would be an universal power supply that can take in any voltage from 40-240V AC or DC and provide any voltage between 40-240V DC, such that it can be used with any appliance to work with any given supply. That is what the hybrid power supply does.

Technically, it is a microcontroller based Buck-Boost network with an input stage bridge rectifier. The schematic is as seen below.

Schematic

The circuit works by converting AC or DC to DC through the rectifying bridge. Then a linear regulation provides a 5V supply so that the microcontroller can turn on. Once the microcontroller turns on, depending on the position of switch S1, the buck-boost network is controlled. The output voltage is fed back to the microcontroller as a form of closed loop control and depending on the output voltage, the microcontroller accordingly adjusts the Pulse Width Modulation (PWM) signals to the transistors Q1 and Q2. This schematic was initially developed for a mixer grinder operation, hence the use of switch S1.

To make it truly universal, I added a resistor divider network in the input stage to see what the DC input is and a potentiometer for the user to set what output voltage is required. The microcontroller sees the requirement and the supply and accordingly bucks or boosts the input voltage in an open loop way without a feedback as illustrated in the block diagram.

block diagram

Practically, problems arose in the form of huge ripples because the microcontroller’s PWM frequency was just not high enough. So I added a 1Mhz 5V triangular wave oscillator and a low pass filter to the microcontroller’s PWM output to provide a threshold voltage.  When the threshold voltage is given to a comparator along with the triangular wave, it would produce a 1Mhz PWM with the required duty cycle. So, the new schematic became something like this.

sch

Naturally the next step would be to fabricate the circuit with power electronic components – a huge inductor, a couple of high voltage capacitors, high voltage MOSFETs and diodes. The circuit is fabricated on a prototype board.

This slideshow requires JavaScript.

The results of what should happen and what actually happened are summed up in this video with a simulation and the practical output as well.

Actually the buck operation didn’t perform well and so did the boost as well. On inspection, it became apparently clear that although the design was sound and the logic was correct, the execution was not perfect. The imperfect execution was also not because of the fabrication on my part, but due to the stray effects at high frequencies.

5

For boosting the input from, say, 13.4V to 30.8V which is more than 3 times the input, the ripple in the output becomes very high. So to reduce ripple a high frequency PWM is required. This is why a 1Mhz triangular wave is required to generate such a PWM. 1Mhz is almost at the cusp of radio frequencies which creates stray or non-ideal effects in the components used. This results in the waveform not being completely triangular. There are significant undershoots (below 0V) and overshoots (above 5V) which create undesired PWM generation that tampers with the output. It is because of this, I didn’t risk testing it at the voltages (40-240V) that the circuit is designed to handle. Yes, unlike other projects of mine, this one doesn’t work perfectly but it is a fair performance considering this is my first power electronics project. In any case, by design, it is an innovative solution for a valid problem of powering appliances in ‘intelligent’ houses.

 

ARM & CAN Bus based Automotive Data Monitoring System

Standard

This system uses two ARM microcontrollers, specifically the TM4C123GH6PM. One of the microcontrollers performs the function of data acquisition, while the other focusses on data rendering. This system is designed for automotive purposes, where data is collected from several sources. This data is then sent to another controller that uses it to make decisions and run an user display. This transfer of data happens through a CAN bus. CAN stands for Controller Area Network and it is essentially a 2-wire communication protocol.

In the data acquisition end 4 sensors are used – ultrasonic, temperature, pressure and a photocell (LDR). The ultrasonic sensor is to be fitted to the rear of the vehicle. It is similar to a Rear Parking Assist, except that if the distance is too less, not only does the buzzer go on but also the motor (assuming an electric vehicle) will stop.
 
Temperature sensor measures the cabin temperature and the pressure sensor measures tyre pressure. These data are not used in any particular decision making. They are simply shown on the display.
A photo cell acts as light sensor and if the external ambiance is low it automatically switches on the headlight. This is the basic purpose of the system. The decisions regarding rear distance and light are all taken by the data rendering controller. For example, depending on the brightness of the environment (sensed by the LDR and transmitted by the data acquisition controller) the data rendering controller switches ON/OFF a white LED that represents the headlights.
 
Conceptually, the data acquisition controller gets the data from the sensors and transmits it to the data rendering controller. The data rendering side then makes both decisions about the motor and the white LED. All these parameters are displayed in a 16×2 LCD display by the data rendering controller, where D- stands for distance, L- stands for light, T- stands for temperature and P- stands for pressure.
DSC04031
This is the ARM and CAN bus based system for Automotive data monitoring. Several enhancements can be made with more sophisticated sensors to monitor several other data. However, this is the fundamental setup.

Working with the 16-bit PIC24F

Standard

I started my microcontroller (uC) journey with the ‘AVR’ and then made it a point to diversify into other awesome uCs. Naturally, the next stop is the famed Microchip’s PIC – Peripheral Interface Controller. Now, when I say PIC it is almost always assumed (in India especially) to be the PIC18F series mostly the PIC18F4570 etc. It so happens that these chips are 8-bit architectures like the AVR (they are classic competitors).

A lot and I mean a lot has been done with this PIC series (18F) to the point that virtually any circuit that can be done has been done and posted on the internet. So, to spice things up a bit I chose to work with the relatively unknown PIC24F series. This series features a 16-bit architecture with superior features (PPS – Peripheral Pin Select is the most remarkable in my opinion) and performance than the 18F. Specifically, I chose the PIC24FJ64GA002 and the best thing for me was, there is not much ready reference circuits or programs available for this microcontroller.

What have I done? I repeated the exact same experiments that I did with AVR. The output is the same but to achieve it was a task, my word, far more difficult to accomplish. And since the output is the same it might be a little boring to see the videos of the hardware implementation, so instead I have posted screen recordings of the simulations (using Proteus).

Since descriptions of the experiments were already written in my AVR article, I would not like to repeat them here. So onto the experiments then.

Simple I/O:

The simulation shows an LED blinking (output) and when the switch is pressed (input) the LED is held on which is truly a simple case of input and output.

DSC03987

As a part of only output programming, here is an LED matrix display that is programmed to display ‘hp07’. The hardware part for this is too straight forward that I stopped with the simulation. 

ADC:

Curiously, Proteus is capable of simulating LCD displays too. As the potentiometer is moved from the minimum to maximum resistance position, the voltage varies from 0-5V and that is read by the microcontroller using the ADC and it is displayed.

DSC03992   DSC03991

PWM:

Proteus can also simulate oscilloscopes that show waveforms. Therefore instead of showing a variation in LED brightness and motor speed (that can barely be seen), the simulation shows it better. You can notice how when ON time (in the waveform) is longer, the motor rotates faster and slow during shorter ON times.

DSC03999

I recently got an instrument called logic analyser that can be used to practically visualize the waveform too. I have a computer interface based one and therefore the screenshot of the waveform:

Simulation

UART:

Ofcourse, I have to end with the same button presses counting game. When the count button is pressed, a counting interrupt routine is executed with the red LED glowing that counts the number of times the button has been pressed.

And when the transmit button is pressed the data is transmitted through the Universal Asynchronous Receiver Transmitter (the green led glows during this routine). The other microcontroller receives the data and displays it with the help of IC 7447 and a common anode 7 segment display.

DSC04004

The count is re-initialized to zero after every transmission.

And therefore I finished my experiments with PIC. Yea, I did the same experiments as with the AVR microcontrollers. It is easy for me to use a thermistor instead of a potentiometer and post it as a digital thermometer in the ADC experiment. But all that is technically trivial manifestations of the base which is the ADC module. What matters is the program and the base circuit to get it to work and I have done that – therefore mission accomplished!

The videos of the hardware implementation using PIC is on my youtube channel: https://www.youtube.com/user/harshaprabakaran07/videos

The AVR Microcontroller Journey

Standard

I love circuitry and programming. Therefore, microcontrollers are literally heavenly to me. Though, the long time industry standard of microcontrollers has been the 8051, I really took to Atmel’s AVR microcontrollers. Especially, the combination of Proteus (for simulation), WinAVR(for programming)   and most definitely the microcontroller itself – ATmega16 was sublime to work with. I worked out almost all of its major features from simple I/O to UART communication. In this article I will post the photos of simulation while the videos will be of the actual hardware implementation.

Simple I/O: 

This is as simple as a microcontroller circuit can get. For output, all it does is make an LED blink. To add a little input to the circuit, I added the push button switch. So the LED blinks normally but when the button is pressed (input) the LED is held ON.

Simulation

DSC03792

The LED matrix display actually contains 7×5 LED’s. Each of these 35 LED’s can be individually switched on or off. This circuit is also all about outputs but here I selected particular LED’s to be switched on in every column. Then, it is programming the microcontroller to display all columns but one column at a time rapidly creating the letters.

Simulation

ADC:

DSC03772 DSC03771

One of the best features of the AVR is its in-built analog to digital converter. This circuit converts the anolog value of voltage applied through the variable resistor (10k pot) and displays it using a 16×2 Character LCD Display. The video shows the entire range of values from 0 to 5V as the pot is turned from one end to the other.

Simulation

PWM:

DSC03952 DSC03955

AVR has some pretty neat internal counters and timers. Using them, Pulse Width Modulation of almost any duty cycle can be obtained. I used the PWM to reduce the brightness of an LED and also to control the speed of a DC motor. The motor was a 150 rpm motor and I even removed the motor shaft to see if the internal gears should appreciable change in speed. For the eyes they did, for the camera I am not sure. So the difference in speed isn’t obvious but careful observation will clearly show a change in speed if the LED’s brightness is used as a reference. When the LED is dim, the speed of the motor should be low and the opposite (bright and fast) is also true.

Simulation

 UART:

DSC03944

It is a protocol by which a microcontroller can communicate or transfer data to another device. In this case, the microcontroller transmits data to another microcontroller which displays it. This is what happens, everytime the lower button is pressed an interrupt is raised and a count value is incremented. This count value stores how many times the lower button is pressed. Each time the red light arises, a count has been registered. When the upper button is pressed, the green light is seen and the data is transmitted to the other microcontroller.

If you look closely, the only link between the two microcontrollers is the one single yellow wire. The data is received by other microcontroller and displayed. Everytime the data is sent, the count is made zero again and if the transmit button is pressed again the zero is transmitted and displayed.

Simulation

Ofcourse, I haven’t explored everything there is especially I wanted to use the I2C protocol to show a small animation movie on an OLED display. Sadly Proteus doesn’t have a simulation model for the OLED display and the display is just too costly to blindly experiment with. But other than that, working (playing) with this microcontroller is one of the best things I have done in my life.