Difference between revisions of "ME 333 Lab 4"

From Mech
Jump to navigationJump to search
(New page: In this lab, we are going to use the PIC32 microcontroller to control the motor's position with a proportional feedback controller. A block diagram of the overview of this lab is shown bel...)
 
Line 3: Line 3:


<br>
<br>
The PIC32 is going to generate a square wave reference signal that will cause the motor to alternate between two positions. This reference signal could be changed to any arbitrary signal such as a sinusoid or a triangle wave.
The PIC32 is going to generate a square wave reference signal (ref) that will cause the motor to alternate between two positions. This reference signal could be changed to any arbitrary signal such as a sinusoid or a triangle wave, but for this lab we are going to stick with a square wave.

The quadrature encoder creates two signals similar to those shown below. These signals will be sent to a encoder/decoder chip that converts the signals into up and down counts to be sent to the PIC32. The up and down counts will be read by the PIC32 and converted into a position for the motor (output).

The error is the difference between the reference signal and the output. The error will be sent to a controller, in this case a proportional controller and converted into an input signal (u). This is shown in the equation below:

The input signal is then converted into a PWM to cause the motor to move and produce a new output.

So how do we do this?


First, we are going to write the code in which we will learn about the following topics:
First, we are going to write the code in which we will learn about the following topics:
Line 15: Line 23:
*Encoder/Decoder Chip
*Encoder/Decoder Chip


After the circuit has been created, we will test the feedback control with different proportional gains.
After the circuit has been created, we will test the feedback control with different proportional gains (Kp).


<br>
<br>

Revision as of 16:35, 21 January 2010

In this lab, we are going to use the PIC32 microcontroller to control the motor's position with a proportional feedback controller. A block diagram of the overview of this lab is shown below.



The PIC32 is going to generate a square wave reference signal (ref) that will cause the motor to alternate between two positions. This reference signal could be changed to any arbitrary signal such as a sinusoid or a triangle wave, but for this lab we are going to stick with a square wave.

The quadrature encoder creates two signals similar to those shown below. These signals will be sent to a encoder/decoder chip that converts the signals into up and down counts to be sent to the PIC32. The up and down counts will be read by the PIC32 and converted into a position for the motor (output).

The error is the difference between the reference signal and the output. The error will be sent to a controller, in this case a proportional controller and converted into an input signal (u). This is shown in the equation below:

The input signal is then converted into a PWM to cause the motor to move and produce a new output.

So how do we do this?

First, we are going to write the code in which we will learn about the following topics:

  • Timers
  • Interrupts
  • PWM

After programming the PIC32, you will construct the circuit for this motor controller. This circuit will include the following information:

  • H-bridge
  • Motor with Encoder
  • Encoder/Decoder Chip

After the circuit has been created, we will test the feedback control with different proportional gains (Kp).