Sunday, June 9, 2013

Engineering 44 Combot Peach Project


Combot: Peach JAR

Goal:
The objective of the project was to build a combat robot for an Ant Weight Combot Competition.

Criteria of Success:
1. The combot is able to navigate wirelessly.
2. A transistor-microcontroller circuit controls the flamethrower.
3. It is able to function after the deadly combot competition.

Main Materials:
-LaunchPad MSP430
-Toy Chassis
-Bluetooth Module
-2xVex Motorcontrollers 29
-2xMotors
-2xWheels
-Batteries

Weapon Materials:
-Fly swatter circuit
-Transistor
-Servo
-Gas Tank

Armor Materials:
-Polycarbonate
-Carbon Fiber Sheets
-Piano Wires

How it Works:
A bluetooth module is used to control the launchpad.
The Launchpad sends out different PWM signals to control the speed controller and servo.
The servo releases butane from a container while a transistor would turn on the sparker.

Conceptual prototype designs

First build for competition
The Mechanics:
-Sloped Front at 40°
-Wheel Protection
-Flamethrower weapon
-Center of Mass shifted towards the back to prevent flips

Schematics:
One Problem encountered was that the launchpad only worked at 3-5V while the other devices operated at 6-8V. A voltage divider was used for our initial circuit, but AA batteries were used in the second design.
Every ground is connected to a common ground else it will not work

Bluetooth Module Connected to Launchpad running on Batteries
Fly Swatter circuit connected to transistor and Launchpad
Peach moving via putty

Peach shooting fire via putty

Code to control the launchpad
The code is fairly simple as it replaces the Serial Monitor with a Bluetooth Monitor.
The Servo class controls both the servo and Vex Motor Controllers.
Motors run a range servo write values from 65 - 130.
- Going Backwards = 65 - 87 (fast to slow)
- Neutral = 88-100
- Going Forward = 101 - 130 (slow to fast)


Bill of Materials without Flamethrower:
- Launchpad MSP430 = Free
- Polycarbonate = $10
- Carbon Fiber Sheets = $27
- Bluetooth Module = $20
- Servo = Free
- Toy Body Chassis = Free
Total Cost : $57

Conclusion:
Without a weight limit, it is better to use AA batteries than to voltage divide one LiPo battery to 7 different components while watching for current, and the transistor makes a better switch than a relay.

Sunday, June 2, 2013

Impedance and AC Analysis I

The purpose of this lab is to analyze and study a real inductor.

Procedure:
We start with a real inductor connected in series with an external resistance.
2 Multimeters are taking measurements.


We measured R_L = 8.3 Ω
R_ext = 67.2 Ω
We measure our V_rms = 5V at 1000 Hz.

The built circuit
V_in,rms = 4.93 V
I_in,rms = 65.0 mA 
The voltage reading differs from the FG because internal resistane drop 0.7 V
V_in/I_in = Z_L = 75.8 Ω
Z_L = sqrt((R_ext + R_L)^2 + (ωL)^2)
ω = 6280 rad/s
L = 1.16 mH

Adding a capacitor to cancel inductance impedance
1/ωC = ωL
C = 1/(ω^2*L) = 2.19 *10^-5 F


Remodified circuit

V_pp, CH1 = 1.5V
V_pp, CH2 = 20mV
deltaT = 0.4 ms
Phase difference = (deltaT) *6240* 360 ° = 184.32 °

Analysis:

Frequency (kHz)
V_in (V)
I_in (A)
|Z_in| (Ω)
5
4.6
0.073
63.0137
10
4.2
0.0719
58.41446
20
3.51
0.0691
50.79595
30
3.51
0.0653
53.75191
50
4.5
0.0558
80.64516


Questions:
1. It is not the largest at 20 kHz as we used 1 kHz for calculations. Largest current should be at 1 kHz as imaginary part cancels out.

2. V_L = Z_L/Z*V_in
V_L = 2.8574 +  1.2737i
Phasor = 24.0243 °

3. The circuit looks more inductive as imaginary part is always positive.

4. The circuit looks more inductive as imaginary part is always positive.

Conclusion:
The experiment was successful; however, the answers to the questions may not be as expected as it assumes the capacitor was calculated at 20 kHz instead of 1 kHz.

Sunday, May 19, 2013

FreeMat with Complex Numbers

The purpose of the experiment using complex numbers with FreeMat.

Procedure:
A1 = 3+2j
A2 = -1+4j
B = 2-2j

1: Solve C = (A1 * B)/A2


2.
3.1.

3.2.
4.

Conclusion:
FreeMat works well with Complex Number.

Wednesday, May 15, 2013

MOSFET Control of an Electric Motor

The objective of the experiment is to use a MOSFET to obtain a stable speed control.

Procedure:
Part 1:
We built the circuit below.


Using the pot, we were able to control the speed of the motor by adjusting amount of voltage through the motor.


Part 2:
We replace the pot with a Function Generator.
The FG produces Square Waves, and duty cycle was on.


We see how the voltage on the motor acts with the Oscilloscope.

Displaying the speed control by increasing and decreasing duty cycles.

Questions:
The motor rotates faster with a larger duty cycle.
The graph is the on/off times of the square function.
The time required to decelerate is 0.7s.
The voltage is 0.16 V at 30%

The voltage of motor at 30% of the maximum.
The converter allows a smooth speed control.
T = 1/110 = 9.1ms

Conclusion:
The lab was a success. Both ways controlled voltage, but part 2's method allowed for better speed control than part 1 with the pot.

Sunday, May 5, 2013

Second Order Circuit Tutorial

The object of this lab is to study and practice second order circuits through an online tutorial.
Procedure:
We work on the tutorial and screenshot every answer.




















 
Conclusion:
The lab was successful. It showed how simple solving Second Order Circuits were when broken down to many pieces.

Tuesday, April 30, 2013

Oscilloscope 101

The objective of the lab is to learn, use, and anaylze an oscilloscope.

Procedure:
We connect the oscilloscope with a frequency generation.

Exercise 1: Sinusoid

f = 5 kHz, V = 5V
Once the trigger was set, we took measurements.
Period = 0.2 ms
Peak to Peak = 11.4 V
Zero to Peak = 5.8 V
Anticipated RMS = 3.53 V


Using DMM to take Voltage values
VDC = 0.026 mV
VAC = 3.35 V
The VAC is close to our anticipated RMS value.

Exercise 2: Include DC Offset
We add an offset of 2.5 V, and another one at 5V

DC Coupling at 5V
AC Coupling at 5V
The difference is that we can see the offset in DC coupling while nothing changes in AC.
2.5V offset measurements:
VDC = 2.51 V
VAC = 3.37 V
The VDC shows the offset in the output like the graph while the offset does not affect VAC.

Exercise 3: Square Wave with offset


VDC = 10 mV
VAC = 5.34 V
The measured value was close to the theoretical VAC = 5 V.

Exercise 4: Mystery Signal

Mystery Signal
DC Voltage = 448 mV
f = 70.42 Hz
Pk-Pk = 940 mV

Conclusion:
The lab was a success showing that it is more useful to use a digital oscilloscope to analyze waves than the heavy traditional ones.

Monday, April 22, 2013

Capacitor Charging/Discharging

The purpose of the experiment is to learn how to control capacitor charge and discharge times using a nonideal case.

Prelab:
We first build the Thevenin expressions for the charge and discharge circuits below to use later.


Charging: R_th = R_leak*R_charg/(R_leak + R_charg), V_th = R_leak*V_s/(R_charg + R_leak)
Discharge: R_th = R_leak*R_dischar/(R_leak + R_dischar), V_th = 0.

The setup is to use 9V to charge for 20s with 2.5 mJ, and discharge the 2.5 mJ in 2s.
Doing some math, we find:
C = 2*U/V^2 = 0.0617 mF
Charging: 5tau_c = 20s
R_c = 4/C = 64.8 kΩ
The power P_c = V^2/R_c =1.25 mW which is under the limit of 1W.

Discharging: 5tau_d = 2s
R_d = 2/(5*C) = 6.48 kΩ
The power P_d = 12.42 mW which is under the limit of 1W.

Procedure:

We build the circuit according to our values.

Capacitors combined in parallel to reach desired value
Entire circuit with resistor boxes
Analysis:
Logger pro was used to measure the change in voltage over time.

Capacitor charging
The peak voltage V_f = 8.25 V due logger pro's limit of 8Vs and the effect of the R_leak.
The time is estimated to be around 18s.
R_leak = R_charge /(V_s/V_f - 1) = 712.8 kΩ

Capacitor discharge
Starting from V_f, the discharge time is around 2s.

Questions:
Using the Thevenin equations,
1. R_cth = 59.4 kΩ, V_cth = 8.25V
 2. R_dth = 6.42 kΩ, V_dth = 0V

3. 0.6321*V_f = 5.215 V
5.215 V is around 4.6s
tau_c = RC = 4.6s
R = 4.6/C = 74.55 kΩ
Error = 15%

Practical Question:
1. U = (1/2)CV^2
C_eq = 2*U/V^2 = 2*160*10^6/(15*10^3)^2 = 1.42 F

2. 1/2C + 1/2C + 1/2C + 1/2C = 2C = C_eq
C = 1/2C_eq = 0.71 F

Conclusion:
The experiment was a success. The charge time was close to 20s, and discharge time was about 2s proving that it was possible to control the times.