Sunteți pe pagina 1din 7

ME-EE 106 Fundamentals of Mechatronics

Name: PHAT NGUYEN Date: 2/7/2018

SID: 010975354

HOMEWORK 2: Signal sources, RC Filter, Intro to the Arduino

Summary

I review the RC filter concept in order to this homework. I also need to

review the Matlab in order to generate graph and see how the voltage behave.

Moreover, I understand more about Lowpass and Highpass filter to for the circuit.

At the end, it is a quick review about Arduino by explain simple code.

What was learned in the assignment:

I know how to calculate the magnitude and phase angle of the RC filter circuit.

By doing so, I can decrease the noise of the high frequency which I have never

know before. Moreover, I understand about the concept of cutoff frequency. I

review a lot with Matlab and know it is a powerful tool to help me do a BODE

plot with few lines of code. Arduino is a quick review.

PHAT NGUYEN HW2 2/8/2108 Page 1 of 7


ME-EE 106 Fundamentals of Mechatronics

1. Find out

a. What is maximum operating voltage applied to ATmega328

b. Maximum current that any one pin can sink

 Answer:

a) Maximum operating voltage is 6.0 V

b) Maximum current any pin can sink is 40mA

2.

a. Derive transfer function for a low-pass RC circuit (exchange the R and C

position compare to the figure in class)

b. Let R = 1 k Ω; C = 4.7 x 10-6 F, calculate the corner frequency

c. Create the graph

 Answer: a) HIGH PASS FILTER

1
𝑍𝑅 = 𝑅 ; 𝑍𝐶 =
𝑗𝜔𝐶

𝑉𝑜 𝑅 1
= =
𝑉𝑖 𝑍𝐶 + 𝑅 𝑗𝜔𝐶 + 𝑅

𝑉𝑜 𝑗𝜔𝐶𝑅
=
𝑉𝑖 1 + 𝑗𝑅𝐶𝜔

𝑉𝑜 𝜔𝑅𝐶
𝑀𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒 𝑜𝑓 𝑡𝑟𝑎𝑛𝑠𝑓𝑒𝑟 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛: | | =
𝑉𝑖 √1 + (𝑅𝐶𝜔)2

𝑉𝑜
𝑃ℎ𝑎𝑠𝑒 𝑎𝑛𝑔𝑙𝑒: ∠ = − arctan(𝑅𝐶𝜔)
𝑉𝑖

PHAT NGUYEN HW2 2/8/2108 Page 2 of 7


ME-EE 106 Fundamentals of Mechatronics

b)

1 1 𝑟𝑎𝑑
𝜔𝐶 = = = 212.76
𝑅𝐶 (1000 × 4.7 × 10−6 ) 𝑠
𝜔𝐶
𝑓𝐶 = = 33.86 𝐻𝑧
2𝜋

c)

code in Matlab:

“s = tf('s');

HPtf = (s*0.0000047*1000) / (1+s*0.0047);

bode (HPtf)

title ( {'Mangnitude of the transfer function and Phase Angle vs

frequency'})“

PHAT NGUYEN HW2 2/8/2108 Page 3 of 7


ME-EE 106 Fundamentals of Mechatronics

3. Design an RC filter
a) Graph the sine wave : 1V amplitude; 0.01 s for period

b) Graph the sine wave : 2V amplitude; 0.5 ms for period

c) Graph the sum of a+b

d) Design rc filter remove high frequency

e) Calculate corner frequency

f) Magnitude and phase angle

PHAT NGUYEN HW2 2/8/2108 Page 4 of 7


ME-EE 106 Fundamentals of Mechatronics

 Answer

a.

b.

PHAT NGUYEN HW2 2/8/2108 Page 5 of 7


ME-EE 106 Fundamentals of Mechatronics

c.

-> the sum of 2 sine function has the highest frequency.

d. The function: 1.5 sin(wt) ; T = 0.01s

F = 1/T = 100 Hz

W= 2*pi*f=628 rad/s

We create another sine function where f2 = 10f1 = 1000Hz

Remove 90% then only 10% of f1 is allowed => f2 * 10% = 100Hz is my

frequency cutoff.

Since the load is 20 kOhm; I want to choose my resistor smaller compare

to it => R= 1kOhm

W = 1 / RC => C = 1 / WR => C = 1 / ( 1*10^3 * 628 )

PHAT NGUYEN HW2 2/8/2108 Page 6 of 7


ME-EE 106 Fundamentals of Mechatronics

C= 1.59 * 10 ^ -6 F

 Pick the Capacitor close to it 1.5 uF.

e. Corner frequency = cutoff frequency = 100Hz

f. Follow equation of low pass frequency

Vin / Vout = 1/ (1 +jwC)

Vout = Vin / (1/ (1 +jwC) )

Vout = 3.6 V

Phase angle <=> -arctan(RCw) = -45 degree

4. Explain the code of Arduino

a. Assigning the LED pins from 0 to number of LEDs as an out put

Assigning input of this is Pin_button0

Kick-off the Pin_button on

b. The value is zero

c. The state of that is 1

5. Explaining defining and use symbolic name than constant value

+ Easy to change the value

+ Easy to read and limit the error

PHAT NGUYEN HW2 2/8/2108 Page 7 of 7

S-ar putea să vă placă și