Wednesday, June 14, 2017

Self Balancing Robot Project

ENGR44 Project Log
 This blog post is to just document some of the process of the final "lab". My partner and I had a bit of a rough start with our project. Although it impeded our progress forward, we persevered and met our goals adequately.

The project began with conceptual sketches of what we wanted.



From there, we decided on how it was to function.


This was the basic flowchart for how it would be powered. Essentially a triangle wave would be fed into a comparator and would over saturate the op amp once it hit the ref voltage, and output the negative saturation point. This creates a PWM for the motor to run on!

The problem was that the speed control voltage was to be manipulated by a system that could effectively tell the bot it was tipping and to compensate with motor movement. Our first idea was to create a PID loop from op amps for precise control. 

With our parameters kept in mind, we conceptually created an EveryCircuit model for reference purposes:


The bottom portion is our "PID Loop" and the orange portion is the motor.

A PERT chart for organization was created and then we set to researching how much the whole thing would cost.



IndexQuantityPart NumberDescriptionQuantityUnit Price USDExtended Price USDReal Quantity for projectExtended Price
14RNF14FTD10K0CT-NDRES 10K OHM 1/4W 1% AXIAL40.10.420.2
23S2.2KCACT-NDRES 2.2K OHM 1/4W 1% AXIAL30.10.310.1
34RNF14FTD1K00CT-NDRES 1K OHM 1/4W 1% AXIAL40.10.420.2
43RNF14FTD15K0CT-NDRES 15K OHM 1/4W 1% AXIAL30.10.310.1
53BC1.00ZCT-NDRES 1 OHM 0.6W 1% AXIAL30.330.9910.33
63RNF14FTD100KCT-NDRES 100K OHM 1/4W 1% AXIAL30.10.310.1
76BC2665CT-NDCAP CER 0.1UF 50V X7R RADIAL60.181.0840.72
83490-14507-NDCAP CER 22UF 25V X7S RADIAL31.243.7211.24
93493-13399-NDCAP ALUM 1000UF 10% 25V RADIAL31.143.4211.14
104PDV-P9001-NDPHOTOCELL 4K-11K OHM 4.20MM41.877.4823.74
112900-00008-NDGEARMOTOR 6VDC SERVO213.9927.98227.98
1242N3904FS-NDTRANS NPN 40V 0.2A TO-9240.190.7620.38
133CT6EP103-NDTRIMMER 10K OHM 0.5W TH30.782.3410.78
Total49.47Total for project37.01
Notes: Ordered two extra of every part except motors


An extremely important side note to mention is that we got lucky on our part collection phase. Professor Mason was gracious enough to allow us use of his Servo motors for use in this project. This greatly decreased the cost of this venture! We happily ordered the rest of our parts and moved on to the next phase, construction/testing!

To make good time and get a head start we created what was essentially the heartbeat of our device, the Triangle Wave oscillator.


and then cleaned it up for testing purposes once we got it working...


here's an output for it


Then we hit a snag...we could not figure out to implement a system robust enough for our purposes of error correction. After much testing, and failed attempts, we settled on a bit of an easier solution. We would use two photo resistors to set the control voltage for the PWM. Although crude, we could not allow ourselves to fall behind our PERT chart.

From that came our new circuit creation:


This design took advantage of what we wanted and used a clever tactic to get what we wanted. The potentiometer was the key to finding the "sweet spot" for how sensitive the photoresistors were to the bot tipping over.


Then we tested it with the motors and it worked! Somewhat! (With a bit of tuning...)

Before we knew it it was time to commit to a final design, so a chassis was found and the circuit was downsized for a nice fit!


We taped the motor and wheel to the bottom of the bot and we were set for our presentation! (Kind of!)


In the end, we couldnt get it to precisely balance, but it was definitely an impressive effort from my team member and I on how much we got accomplished in the amount of time we had! It was a very enlightening learning experience that I will surely build from!



(6/8/17) Day 27:Filters and Passive RL Filter

Day 27: Filters




Lab:

Passive RL Filter

A passive RL filter is one that makes use of the traits of the inductive component to filter out voltages at lower and higher frequencies (depending on the set up). This lab will experimentally show the behavior of such a circuit and hopefully verify the textbook's explanation of it.

Prelab:

Our first task was to figure out the cutoff frequency for this specific circuit.


with values of R = 100 ohms and L = 1mH



with the cut off being calculated as 1E5.
If theory proves correct, this circuit should limit voltages at frequencies below this value.

Procedure:

Once the circuit was built, we set up the oscilloscope to read the output.


The input was a range of sinusoid voltages that we tabulated the reaction for. The V (output) section is the voltage being read on the inductor.


 Summary:

Taking the voltage from the inductor to be output of the circuit, we can deduce that at frequencies begin to drop! This is indicative of a high pass filter!


Tuesday, June 13, 2017

(5/30/17) Day 25: Frequency Dependence and Signals with Multiple Frequency Components

Day 25: Frequency Dependence







Lab

Signals with Multiple Frequency Components

In this lab, my team and I ran tests on a circuit containing components that were frequency dependent. In particular, these tests were to be under the special circumstance that the signal we were to generate comprised of multiple sinusoidal waves of different frequencies. This also allowed us to test out a feature of the analog discovery that sends out a "Sweep". A Sinusoidal signal that changes over time.

From these tests, we hope to gain a deeper understanding of  impedance, sinusoidal inputs, capacitor behavior, and simple frequency filtering.


Prelab:

We were first asked to determine the magnitude response (ratio of output/input voltage) at frequencies of 500Hz, 1000Hz, and 10kHz.

The parameters we had for theoretical planning were for both resistors to be 680 ohms and the capacitor to be 100nF (.1 microF).



Procedure:

After we had some theoretical values for the ratios, we set out to building the circuit. It's not very complex in its form, but it is definitely interesting behavior wise.


To test the circuit according to the manual, we had to create a custom wave form for optimal data collection.


After setting it up, we input it to the circuit and measure the output at 500Hz
Ratio calculated = 0.451


At 1kHz
Ratio Calculated = 0.412


And at 10kHz
Ratio Calculated = 0.159


 This behavior is actually spot on for our calculated behavior!
As the frequency goes up, the ratio between the two voltages decreases!

 For the next portion of the lab, we tested the same circuit but we used the Sweep function to create a sinusoidal wave that linearly changes frequency with time. The signal is supposed to start at 100Hz and increase up to 10kHz in 20ms.


Then we tested it as an input:



Just as was expected, the frequency cause the voltage to decrease at the output and can be seen as a "squashing" effect of the output waveform.




Tuesday, May 30, 2017

(5/2/2017) Day 18: 2nd Order Circuits and Series RLC Circuits Step Response

Day 18: 2nd Order Circuits











Lab: Series RLC Circuit Step Response

This lab introduced the modelling and testing of a series RLC circuit.

Prelab:

We were asked to write a second order equation for the RLC circuit in question.



Doing this gave us a damping ratio equation we can use that gives us a value of 0.005
This is less than 1, showing us that the circuit acts as an underdamped case!

With this in mind we continued on to the exercise.

Procedure:

After building the circuit, we hooked up an oscilloscope probe to read the output for comparison.






Here is the analog discovery input to the circuit


and the output voltage for the capacitor.





This is actually close to the behavior we expected to see from an underdamped squarewave input, albeit not as exaggerated.



(5/9/2017) Day 19: 2nd Order Circuits (Pt2) and RLC Circuit Response






Lab: RLC Circuit Response

Prelab: