Wednesday, November 11, 2009

Lab 6: Day 3

The third day we came in we decided to completely revamp our controller to LabVIEW. We first connected analog in and analog out pins to the same low pass filter we set-up the day before. Next, we created a .vi that simulated a signal of random white noise voltage out to the circuit. We also programmed the .vi to accept and write input voltages from the capacitor in the circuit. Then, we wrote each input and output voltage into a measurement .txt file. Finally, we were able to pass this data into Matlab where we ran the tfestimate command and were able to obtain somewhat reasonable results. The low pass filter results of can be seen in the figure below.

Note that the data does not fit well with the expected response. The cut off frequency and the dc gain agree well, but the roll off rate is significantly higher than expected. Hours were spent trying to track down the bug. Sampling rate, number of samples, resistors, capacitors were all varied and this was the best response we were able to generate. After exhausting all of our resources and spending several hours changing random parameters our team decided to table this aspect of the project and seek assistance from our instructors.



Lab 6: Day 2

The second day we came into the lab we had a better sense of some solutions to our problem. After obtaining the serial port error we were told to completely close Matlab and then reopen it. Surprisingly this solved our problems. From this point forth we could repeatably communicate between the Arduino and Matlab.

Once this communication was established we continued to rig up a low pass filter in a RC circuit. A circuit diagram of our set-up can be seen below. For the given values we determined a cut-off frequency around 169 Hz. Using these values and a sampling time of 1msec we ran a Matlab simulation of what theoretically should happen with the empirical model when we send in random white noise. The following figure shows the expected theoretical results obtained solely in Matlab.

As you can see in the above low-pass bode plot the response tends to taper off near higher frequencies which is what we expect when we send this circuit random noise.

Our next step was to repeat this process using Matlab and the actual RC circuit we built. However, we again began having troubles communicating between the two systems. Serial ports were closed and recognition was of the Arduino was not happening so again we decided that it be best to sleep on it.

Lab 6: Day 1

The first day in the lab was to say the least, difficult. We started out by running the provided Matlab code and testing out different transfer functions, record lengths, sampling frequencies, and nffts. We noted that for second order systems decreasing the sampling time below 0.1 msec or above 32msec tends to produces undesired results if none of the other parameters change. Also, if you return to default conditions and decrease the nfft value skewed data results. However, it was found that increasing nfft really high did not play as significant of a role. Of course, increasing or decreasing the record lengths changed the length of sampling time in addition to providing a more or less continuous curve.
After these effects were acknowledged we continued onto establishing a communication with the Arduino and Matlab. Here is where the difficulties begin. After we uploaded the SerialCallResponse.pde into the Arduino and then closed it, we ran SerialCallResponseSim.m to run the echo function. The problem was that after running the first time correctly, it would say from then on that the serial port was closed. After much debugging and errors we decided to continue at another time.

Lab 6 : Team Members

Scott Bartkowiak
Mike Luginbill
Eric Sihite