Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Motor Controller - Embedded System Design - Lab Notes, Study notes of Computer Science

These are the Lecture Notes of Embedded System Design which includes Exceeded, Limit, Drive Slower, Larger Ticket, System Functions, Similar Principles, Basic Types Of Control Systems, Signals, Closed Loop etc. Key important points are: Motor Controller, Open Loop Control, Simple Feedback Loop Contorl, Proportional Feedback Control, Feedback Controller, Microprocessor, Output, Motor Spins, Disk or Paddle, Connected

Typology: Study notes

2012/2013

Uploaded on 03/22/2013

dhritiman
dhritiman 🇮🇳

4.7

(6)

107 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PID Motor Controller
Lab 6Open Loop Control
Lab 7 Simple Feedback Loop Contorl
Lab 8 – Proportional Feedback Control
In most engineering applications, electric motors are controlled with some kind of
feedback controller. In this lab, you will demonstrate why a feedback controller is better
than an open loop controller. You will also build two kinds of feedback controllers to
demonstrate why the PID variety is superior.
Pre-Lab Assignments
1. Review an article PID without a PhD available in course website
2. Complete the Pre-Lab Questions at the end of the lab instructions.
Lab 6: Open Loop Controller
As you learned in lab 5, there are two kinds of control systems: open loop and closed
loop. Your task in part 1 of this lab is to build an open loop DC motor controller.
The ‘plant’ to be controlled in this lab is a DC motor. The speed of the motor is
controlled by a power FET. The signal to the gate of the FET is the PWM output of the
microprocessor (μP). The greater the duty cycle of the PWM output, the faster the motor
turns. The circuit is shown in figure 1 below.
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Motor Controller - Embedded System Design - Lab Notes and more Study notes Computer Science in PDF only on Docsity!

PID Motor Controller

Lab 6 – Open Loop Control

Lab 7 – Simple Feedback Loop Contorl

Lab 8 – Proportional Feedback Control

In most engineering applications, electric motors are controlled with some kind of feedback controller. In this lab, you will demonstrate why a feedback controller is better than an open loop controller. You will also build two kinds of feedback controllers to demonstrate why the PID variety is superior.

Pre-Lab Assignments

  1. Review an article PID without a PhD available in course website
  2. Complete the Pre-Lab Questions at the end of the lab instructions.

Lab 6: Open Loop Controller

As you learned in lab 5, there are two kinds of control systems: open loop and closed loop. Your task in part 1 of this lab is to build an open loop DC motor controller.

The ‘plant’ to be controlled in this lab is a DC motor. The speed of the motor is controlled by a power FET. The signal to the gate of the FET is the PWM output of the microprocessor (μP). The greater the duty cycle of the PWM output, the faster the motor turns. The circuit is shown in figure 1 below.

A

VCC

5V

Q

PWM_Output

Figure 1 - DC Motor Speed Control with Power FET

The RPM of the DC motor is sensed with the NTE3100 optical sensor that was used in lab 3. The DC motor spins a disk or paddle that interrupts the IR beam between the LED and the sensor in the NTE3100. The NTE3100 is then connected as the clock source of a counter in the μP. Each rotation of the DC motor thus registers as a count. By reading the count periodically, the RPM of the motor is determined. The circuit for the RPM sensor is shown in figure 2. Note that the circuit uses the CD4050 buffer as discussed in lab 3.

ATMEGA

PA VTG 2.2K

NTE3100 20K

3 2 T (PB1)

CD

RXD To Computer Serial Port TXD

2

14 15

PA PA PA PA PA PA PA

40 39 38 37 36 35 34 33

SW SW SW SW SW SW SW SW

PC PC PC PC PC PC PC PC

22 23 24 25 26 27 28 29

LED LED LED LED LED LED LED LED OCR (PD7)

VTG

IRF

MotorDC

Figure 2 - DC Motor RPM Sensor

  • Use Excel’s charting functions to graph commanded RPM and actual RPM versus time for several step changes. Your graph should look something like figure 3.
  • If actual RPM data is noisy, apply a single pole filter to the data. This can be done using code like the following: displayRPM = 0.1 * measuredRPM + 0.9 * displayRPM; where displayRPM is the data sent out in the printf statement and measuredRPM is the RPM measured in the last control cycle.

RPM Response - Open Loop Controller

0

2000

4000

6000

8000

10000

12000

14000

16000

18000

0 10 20 30 40 50 60 70 Time (s)

RPM

Commanded RPM Actual RPM

Figure 3 - Example Graph of Commanded RPM versus Actual RPM for an Open Loop Controller

Lab 7: Simple Feedback Controller

With a feedback controller, plant output is sampled and used to correct control signals to the plant so that plant output adjusts to the desired output value. In this case, the plant output is DC motor RPM, the output is sampled by measuring RPM with the NTE optical sensor and the control signal is the duty cycle of the PWM signal to the FET.

In the second part of this lab, you will build a simple feedback controller that samples RPM and adjusts the PWM so that the motor turns at the commanded RPM. This controller is a simple feedback controller because it does not do any math to figure out the fastest way to achieve the commanded RPM. The simple controller just senses if actual RPM is too high or too low and then nudges the PWM by one increment in the correct direction.

Lab 7: In-lab Task (Part 2)

  1. Modify the software from part 1 so that the actual RPM is used to nudge the PWM output in the necessary direction. - If measured RPM is too low, increment the PWM OCR value by one. - If the measured RPM is too high, decrease the PWM OCR value by one.
  2. An important consideration is how often to sample the RPM and correct the PWM OCR. This is the control frequency. A control frequency of 10 Hz will work well for this lab.
  3. Using HyperTerminal, collect commanded RPM versus actual RPM data for several step changes in commanded RPM. Plot the data as in part 1. When compared to the open loop controller in part 1, the actual RPM should be closer to the commanded value.

Pre-Lab Questions Name: ______________________________

10 points total, 4 points for question 1 and 6 points for question 2.

  1. According to the author of “PID without a PhD,” one of the three kinds of control is the most problematic. Which one is it and what makes it difficult to implement?
  2. For Timer2, calculate two combinations of clock prescaler values (called Clock Value in CodeWizardAVR) and Timer2 values that will result in a Timer interrupt every 10 ms.