2017年3月2日星期四

Y2 Project Week 4

Week 4

The aim of this week's group project

In this week, we need to solve the problem of the circuit in last week and then connect the circuit to the ARM microcontroller in order to finish the whole design and test for the project.

The design of the circuit

The first part of this stage is to solver the problem in last week.  Last week, we found that the voltages in cascade circuit have a problem, which is that the value of voltage of a resistor is 0 and the other resistor's voltage is the voltage of the whole cascade circuit.  In this week, we checked the circuit and simulate the circuit by using the PSPICE.  After the checking and testing, we found that the reason for the problem is the wrong connection of the circuit. The wire form two channels of the oscilloscope should be connected together when two wires are required to realize the function of connecting to the earth ground.  
The next step is to test the whole circuit without the ARM microcontroller. When we using oscilloscope to test the circuit, we found that the error of the phase may be higher than our expectation.  In order to solve this problem, our group member raised a solution to replace the inductance by the capacitor.  We decided to try this solution in next week.
Without the problem of the error of the phase, our circuit was successful because we can find the phase difference on the oscilloscope.  The figure for the circuit and the wave to indicate the phase difference are displayed in figure 1, figure 2 and figure 3.

Figure 1


Figure 2


Figure 3

The code for the ARM

Unfortunately, we still cannot solve the problem in last week, which is the computer cannot display the time of testing on the screen because of the problem of the port from the ARM microcontroller.  It sometimes displays the result and it sometimes does not display the result.  That is really confused us.  
Beside this problem, we complete the logic and the code of the ARM.  The whole logic for ARM to realize the function has 5 steps.  Firstly, it collect the voltage on the power and the resistor.  Secondly, it transfer these voltage into the square wave.  If the voltage is higher than the value of average value, it will be considered as the value 1.  If the voltage is lower than the value of average value, it will be considered as the value 0.  Thirdly, using these voltages in square wave to calculate the phase difference.  Fourthly, using the phase difference to calculate the power factor.  Fifthly, change to another capacitor and then repeating the steps to calculate the power factor.
The square wave of the voltage by using the ARM to realize this function and the code for the ARM are displayed in the figure 4 and figure 5.

Figure 4

Figure 5


没有评论:

发表评论