Sunday, May 19, 2013

Lab 14: Freemat with Complex numbers

The purpose of this lab is to study how to use FreeMat to compute the complex numbers.






Exercise 1:
A= 3+4, B = 3-2j, and C = 2<50

Manually find the complex variable D = (A+C)/B


Using FreeMat


Exercise 2:
Find the angle and magnitude of variable E.


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

Manually find C = (A1*B)/A2

Using FreeMat to find C and D= (A1+B)*A2


Manually find D


Using FreeMat to find the solution of the matrix






Lab 13: MOSFET

Introduction:
The purpose of this experiment is to use the MOSFET to control the voltage across the DC motor. The speed of the motor will be proportional to the voltage across its terminals. Moreover, we will learn how to control the power supplied to a motor with a MOSFET, and how to regulate the behavior of the motor with a controller.

Procedure:
Part 1: Connect the motor to the MOSFET and the potentiometer as the diagram shown below:

Obtain the parts and build the circuit:


As we observed, the motor turn-on at 3.9 V.


When we turning the pot, we changing the voltage across the motor and the MOSFET. The pot  is the part which control the voltage across the MOSFET and the motor. The MOSFET is the part which control the current flow through the source and how much voltage can be drained out based on the source.

Slowly increase VGS and try to make the motor shaft at approximately once per second; we can see that it is extremely hard  to do. Furthermore, the speed of the motor relate linearly to the VGS. The speed of the motor realate linearly to the VGS because the motor is directly connected to the drain. When the VGS increases to about 5-6V, the resistance between the source and the drain  is about 1/2 ohms. Thus, the current and the voltage delivered to the motor increase.

Part 2: PWM Chopper MOSFET motor control.

In this part, we are controlling the motor using a technique called Pulse- Width Modulation (PWM).

Replace the pot in the previous part with square-wave generator set at 10KHz. Use the oscilloscope to displace the wareform of the moter voltage. 

Reduce the  square-wave frequency gradually to a few Hert, the motor turns on and off oscillating depend on the amplitude of the square-wave.















Friday, May 10, 2013

Practice RLC circuit

This practice helps students have a deeper understanding how to solve the RLC circuits.
























Wednesday, May 1, 2013

Lab 12: Oscilloscope 101

Introduction:
An Oscilloscope is an electronic device that is used to display time-varying signals and make appropriate measurements. In this experiment, we are going to explore the oscilloscope by varying the signal input with different amplitudes, frequencies, and shapes.

Procedure:

Exercise 1: Displaying and measuring a sinusoid
- Set the Function Generator to produce a sinusoid
- Set the sinusoid frequency to 5kHz
- Set the peak amplitude to 5V
- Verify on the scope

Period: T = 4.1 x 50ms = 205ms
Peak to peak Amplitude: 10V
Zero to peak Amplitude: 5V
RMS Value: 5/sqrt root (2) = 3.53 V

Verify with the DMM:
VDC = 0 V
VAC = 3.33 V

VAC is equivalent to the RMS value.

Exercise 2: Including a DC offset
- Add a +2.5V DC offset to the FG.
- Measure the DC and AC

     VDC = 2.5 V
     VAC = 1.17 V
The VDC is equal to the DC offset, the VAC is the same as RMS.

Exercise 3: Displaying and Measuring a Square Wave with offset
- Switch the FG setting to square wave
- Measure the DC and AC voltage
    VDC = 0 V
    VAC = 2.6 V
- Calculate: VAC = Sqrt root(2.52 x 4x50ms/4x50ms)  = 2.5V

Exercise 4: Measuring a Mystery signal:

DCV = 0.03 V
T = 1.5x5ms = 7.5ms
f = 1/T = 0.13 MHz
peak to peak Amplitude: 6.5x20mV = 0.13V




Tuesday, April 30, 2013

Lab 11: Capacitor

Introduction:
In this experiment, we are going to study the capacitors. Capacitors are component that can store energy via the electric field, and we can rapidly extract the energy from capacitors. The purpose of this experiment is to learn about charging and discharging a capacitor. The picture shown below illustrates how we will use simple circuit to analysis charging and discharging a capacitor.


Procedure:

Task 1: Calculate expressions for the Thevenin voltage and resistance for the charging and discharging circuits:


Charging                                              Discharging
Rth =(RcRleak)/(R­c + Rleak)                 Rth =(RdisRleak)/(R­dis + Rleak)
Vth = VsRleak / (Rc + Rleak)                 Vth = Vc




Step1:  Design a charge and discharge system that utilizes a 9V DC power supply, is charging about 20s with a resulting stored energy of 2.5mJ, and then discharges that 2.5mJ in 2s.

E=V2C/2 = 2.5mJ
C= 2(2.5mJ)/92 =62µF.

Step2:  Estimate the value of charging resistance:
Charging time is 5s. 

Rc = 64.5kΩ.

Calculate the peak charge current and the peak power:
Ipeak  =V/R = (9V)/(64.5kΩ) = 0.14mA
P= I2R = (0.14mA)2(64.5kΩ) = 1.26 mW 



Step 3:  Discharging time is 10 times less than charging times, so the Rdis =Rc/10 = 6.45kΩ.

Caculate the peak discharge current and the peak power: 

Ipeak  =V/R = (9V)/(6.45kΩ) = 1.4mA
P= I2R = (1.4mA)2(6.45kΩ) = 12.6 mW 



Build the circuit:


Because the Voltage meter can measure maximum voltage of 7, we set the power supply to be 6V.
Measured Vf­inal  = 5.707 V

Solve for Rleak :
Vfinal  = Vs (Rleak)/(Rc + Rleak) ->    Rleak = Vfinal Vc /(Vs – Vfinal) = 1.256 MΩ



The graph of charging capacitor:

The charging process takes more than 20s to reach to 5.707V.


Discharging process:

The capacitor fully discharges about 2s.

Questions:

1 - Calculate the Thevenin equivalence voltage and resistance values seen by the capacitor during charging:

Rth = 61.4 kΩ
Vth  = 5.707 V

2 - Calculate the Thevenin equivalence voltage and resistance values seen by the capacitor during discharging:
Rth = 6.42 kΩ
Vth­ = 5.707 V




3 - When t equal one time constant, e-t/T­ = e-1 =0.3679. The charging voltage equal  Vf(1-0.3679) = 0.6321*Vfinal = 0.6321*5.707V = 3.607V
Look at the graph, time for charging voltage to reach 3.607V is about 4s:
T= t = 4s =RC -> R= 4/C = 4/62µF = 64.5 kΩ

Practice Questions:
We want to scale our result to the rail gun problem we worked in previous exercise. The rail gun requires a stored energy of 16MJ, and the capacitor charging is 15kV.

1- Find the required equivalence capacitance:

E=V2C/2 = 160MJ
C= 2(160 MJ)/(15 kV)2 =1.4F


2- If the capacitance will be achieved in the manner shown below, the required value of individual capacitance C= 0.7 F


Wednesday, April 17, 2013

Lab 10: Op Amps 2

Introduction:
This experiment will continuously study the operational amplifier from the previous experiment by changing the the circuit with a separate voltage source and the impact of changing the input and feedback resistors. The picture shown below illustrates how the circuit is changed.


Procedure:

1. We fix R1 = 10 KΩ, and we want to achieve a gain of -10. Then, Rf = 100 KΩ



Resistor
Nominal Value
Measured Value
R1
10 kΩ
9.79 +/- 0.01 kΩ
Rf
100 kΩ
95.2 +/- 0.1 kΩ


2.  If Vsen = 1V, the prediction of the value of current leaving the op-amp is  Iop = 1V/10kΩ = 0.1 mA

3.Build the circuit.


4. Measurement:
Calculation for IOP = VRf/ Rf = (2.50 V)/(95.2 kΩ) = 0.0263 mA



Vin Desired
Vin actual
Vout Measured
VRf Measured
IOP Calculated
0.25 V
0.251 +/- 0.001 V
-2.49   +/- 0.01 V
2.50   +/- 0.01 V
0.0263 mA
0.5 V
0.432 +/- 0.001 V
-4.25   +/- 0.01 V
4.26   +/- 0.01 V
0.0447 mA
1.0 V
1.195 +/- 0.001 V
-10.76 +/- 0.01 V
10.79 +/- 0.01 V
0.113 mA


5. Measure the current ICC and IEE :
 ICC  = 1.00mA and IEE = -0.91 mA.


6. Confirm the KCL for the op-amp at this operating point:
Irail = IEE + ICC = 1.01 + (-0.91) = 0.100 mA

I­op = 0.113 mA .

 From above, we can see that the Values of Iop and IEE+CC are about the same. We can conclude the KCL hold true at this operating point




7. The power of each power supply:
PIcc = (12V)*(1.00mA) = 12 mW
PIee = (12V)*(-0.91mA) = -10.92 mW



8.Add a 1 kΩ resistor across the op-amp output:


9. Set Vsen  = 1V, and take measurement:


Vin desired
Vout Mesured
VRf Measured
Iop Calculated
ICC Measured
I­EE Meaured
0.93 V
-9.39 +/- 0.01V
8.99 +/- 0.01V
0.094 mA
0.93+/-0.01mA
-1.04+/-0.01mA


Sum of the Iee and Icc = 0.93 - 1.04= 0.11mA
We can see the values Iee+cc and Iop are very close. Therefore, the KCL still holds for the op-amp.

PIcc = (12V)*(0.93mA) = 11.16 mW
PIee = (12V)*(-1.04mA) = -12.48 mW

Bonus:
Replace Rf with a new resistor so we can have the gain of -5.
Rf = 50K ohms.



Vin Desired
Vout Measured
VRf Measured
IOP Calculated
ICC Measured
IEE Measured
1.08 V
-5.44 +/-0.01V
5.47 +/-0.01V
0.109 mA
0.90 +/-0.01mA
-1.01+/-0.01mA


Sum of Iee and Icc = -1.01 + 0.90 = 0.11 mA
Iop = 0.109 mA
Therefore, the KCL still holds true.

Conclusion:
The gain of an inverting Op Amp is always equal to -Rf/Rin. If the gain is -5, the ratio of Rf/Rin has to be 5. As the same time, the current at the operating point is equal to the sum of the two rails coming into the op amp, and the KCL always holds correct.