Thursday, 2 June 2011

Day 22 (31 May 2011)

Worked  on serial communication using processing language . values 13 and 10 were always sent. Finally it was found that it was because of using println command instead of print.  13 is the ASCII value of carriage return and 10 is the ASCII value of' '\n'. Worked on the graphics part of making the oscilloscope. The sampling rate was restricted to once every 5 ms. 

Monday, 30 May 2011

Day 21(30th May 2011)

Added data sheets and worked more on the report. Started working on processing language. 

Day 20 (27th May 2011)

The code was included in the report. Circuit diagrams for LCD, tactile keypad and the main circuit were completed. 

Day 19 (26th May 2011)

Worked on serial communication with Matlab. Was using fscanf() to read the data. There was excessive delay in the code. This was because a terminator was expected which was not transmitted . Hence the execution stops for one timeout(which was 10 s). fread() was used instead. The problem was fixed.

Wednesday, 25 May 2011

Day 18(25th May 2011)

Elaborated more on the microcontroller, filter and feedback unit. Made flowchart for the main function, setvalue function, ramp function and calibrate function.

Day 17(24th May 2011)

Started report. Wrote the problem statement, Design Approach and started implention. Explained each unit briefly.


Tuesday, 24 May 2011

Day 16 (23rd May 2011)

A summing amplifier was used with +5V as one input and -30V as another input with weights in approximately 1:6 ratio. Thus a 30V output of the power supply gave 0.45V and 0V output of the power supply gave 4.33 V. These values were given to the analog input pins and a value between 81 and 892 was obtained. Appropriate mapping was used. In The calibrate function the duty cycles corresponding for one third, two third and the max value were stored in EEPROM. For inputs in different ranges, appropriate mapping was used to achieve multi-point calibration.

Monday, 23 May 2011

Day 15 (20th May 2011)

The output of the system was tabulated against reference voltage and it was found there was some attenuation but linearity was preserved. It was found that the voltage of the 5V regulated power supply was dropping due to the current drawn by the LCD. This error would be corrected by the auto calibration function. The positive terminal of the power supply is at the same potential as of the arduino ground. Hence the output of the system had to be attenuated and inverted for the analog read pin. An inverting amplifier was used. But it was drawing current and so the voltage divider network was not giving correct output.

Thursday, 19 May 2011

Day 14 (19th May 2011)

Worked on LCD display.The display had not worked earlier as the unused terminals were not grounded and the contrast was not set.
Created the main menu and the step ramp and caliberate sub menus that are displayed on the screen.Also all entered values were displayed.
However the LCD display drew a lot of power from the usb power supply and the open loop system became non linear.

Wednesday, 18 May 2011

Day 13(18th May 2011)

To establish a common ground the positive terminal of the power supply was shorted with the ground of the micro controller. A voltage divider circuit with a potentiometer along with an op-amp working in the inverting configuration was used to bring the output voltage to one sixth of its value. This is given to the analog input of the arduino. Hence a 30 V output voltage will result in a value of 1023 after ADC. The duty cycle is slowly increased until the given maximum voltage is obtained. The duty cycle at this point is the maximum duty cycle for the given power supply. This is value is written to EEPROM so that it is held even when power is switched off. 

Day 12(17th May 2011)

Started on LCD display. Faced many problem. Spent whole of the morning on debugging but couldn't fix it.
Put it off for later and took auto calibration function. The maximum voltage is accepted from the user and th reference voltage is stepped up slowly till the given output voltage is reached. While setting up the circuit it was found that the negative terminal of hte reference voltage is at same potential as of the positive terminal of the power supply. Hence we could not establish a common ground. 

Day 11(16th May 2011)

Finished the ramp feature. Tested and working properly. Used the micros() function to accurately measure the time interval and thus set the correct slope for ramping. Combined, ramp function and setvalue function into a single program to make a menu driven code. Faced a few problems with reset. 

Monday, 16 May 2011

Day 10 (13th May 2011)

Calibrated the system so that output had an error between 0.01 to 0.05V
worked an the basics of ramp input.Took inputs of start value stop value and time of ramping as output.The output was a ramp but the time taken was incorrect.
Another problem was that the powersupply output was rising fast but was falling slowly.

Day 9 (12th May 2011)

Converted the system to an open loop system.The power supply required a refrence voltage of 0-2.67V to give an output of 0-30V. Used a Voltage divider network that gave 2.67V for a 5 V input and fed its output to a voltage buffer (om-amp).{on giving directly the volatge goes to zero because of very high source resistance}.The open loop system seemed to be working well with a small error.Adjusted the values of the resistance in the voltage divider network to reduce error.

Day 8 (11th May 2011)

Used an array to store the entered values.
Worked on the Enter and Reset functions.Here used a flag to check when the key is pressed and then broke the loop or restarted the main programme respectively.
For the backspace function , kept a count of the number of  digits entered and substracted one when the key was pressed.
Also created different functions for assembly,outputdisplay and read.

Day 7 (10th May 2011)

Akash was absent till Friday.
Converted the keypad to the more conventional format of 3,3,3,1. Also worked on the decimal point and assembly of the entered numbers.
Started working on the enter,backspace and reset functions but the algorithm later didnt work so had to restart.

Monday, 9 May 2011

Day 6 (9th May 2011)

Worked on the tactile keypad and made a library.The library contains a function that returns the number of the switch that was pressed. Using this the user can give an input. We still had problems with PID values. With the same constants and circuit we used the previous day, it took an unusually long settling time. We the changed the resistance values and adjusted the constants to get a better response.
Later we found that the input was getting attenuated, and there was a significant drop across the resistance of the RC filter even when we gave a DC input. We changed the location of the filter on the breadboard and the problem was fixed.

Friday, 6 May 2011

Day 5 (6th May 2011)

Corrected the problem with the pid controller algorithm.Had mistakenly initialized the ki and kd values as int when they were fractions. So the processor took them as 0 and it acted as a simple P controller. Hence there was a constant steady state error..Because of this we had wasted a whole afternoon trying different ki,kp and kd values to get the correct output.
Then experimented with different values of the constants and observed the step response of the system.Using the data collected we were able to choose appropriate values for kp , ki and kd of optimum response with minimum overshoot, rise time and settling time.
Experimented with a tactile switch array giving different switch inputs and observing the output.Then worked on the algorithm to accecpt user input from keyboard using the switch array.

Thursday, 5 May 2011

Day 4 (5th May 2011)

We started working on the PID algorithm and experimented with different Ki,Kd,Kp values. We had made a small mistake. Mr. Sundararajan corrected us and exxplained the P,I and D controllers and their combined effect in a P.I.D. controller. We then looked at the P.I.D. control library function and made changes to the code. We finally started working on the blog which we were supposed to do 2 days ago. 

Day 3 (4th May 2011)

We found of the decimal point and ignored it when transmitted. Thus we multiplied every value by 100. We mapped this input value between a range of 0-1023, as the arduino has a 10bit ADC. This enabled us to use a simple subtraction to compare the setpoint and the actual output when we work on the closed loop system.

We then used a potentiometer to provide the required analog input and generated a PWM signal of varying duty cycle. We then accepted control inputs from the keyboard. By adding an RC filter we generated an analog D.C. voltage between 0-5V from the PWM output. This D.C. value was proportional to the Keyboard input with a small error. Hence we made a simple open loop system. 
After this we started working on a simple closed loop system. Here we took the D.C. output and supplied it to the analog input pin. We found the error between the D.C. output of the filter and the setpoint to recalculate the duty cycle.

Day 2 (3rd May 2011)

We started testing a few sample programs like PWM, led blinking, Analog input etc. After getting a hang of the software we worked on accepting voltage inputs through the serial monitor. We faced a few problems in handling double digit inputs and decimal values. We had to extract each digit count and then repack them.


Day 1 (2nd May 2011)

Summer project May-June 2011
We, Preejit Prakash And Akash R., had apllied for a summer project at Bahn automation for our second year summer vacations.

On The 2nd of May we met Mr. Sundararajan and Mr. Nagaraja in the morning, and were introduced to the task at hand. We decided to work on a programmable power supply. He advised us to go about the project using an arduino platform. We went to S.P. Road Bangalore to buy it. After a long search we bought an Arduino Uno for Rs.1400.