0% found this document useful (0 votes)
95 views13 pages

CS EE380 Lec01 Demo

The document describes the experimental setup for a control systems demonstration. It includes the following components: a function generator, power supply, motor with encoder, H-bridge motor driver, PICkit 2 programmer, and motor control board. It explains how these components are interconnected and describes how to use the MPLAB IDE to open the project file, insert controller code, build and program the dsPIC30F4012 microcontroller. It also provides instructions for reading and storing data received from the motor control board using a terminal program.

Uploaded by

Rajneesh Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views13 pages

CS EE380 Lec01 Demo

The document describes the experimental setup for a control systems demonstration. It includes the following components: a function generator, power supply, motor with encoder, H-bridge motor driver, PICkit 2 programmer, and motor control board. It explains how these components are interconnected and describes how to use the MPLAB IDE to open the project file, insert controller code, build and program the dsPIC30F4012 microcontroller. It also provides instructions for reading and storing data received from the motor control board using a terminal program.

Uploaded by

Rajneesh Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

1/13

Demonstration of the experimental setup


EE380 (Control Systems)

Manavaalan Arun Kant Ramprasad


Gunasekaran Singh Potluri
PhD student PhD student Associate Professor
[email protected] [email protected] [email protected]
JJ
Department of Electrical Engineering II
Indian Institute of Technology Kanpur J
I
Back
Forward
August 1, 2011
Close
2/13

Contents
1 Components of the work bench 3

2 How the components are interconnected 4

3 Use MPLAB IDE: Open project file 5

4 Use MPLAB IDE: Open program in project 6

5 Use MPLAB IDE: Insert controller code 7

6 Use MPLAB IDE: Build project 8

7 Use MPLAB IDE: Select programmer 9

8 Use MPLAB IDE: Program dsPIC30F4012 10

9 How to read data 11 JJ


II
10 How to store data 12 J
11 How to plot data 13 I
Back
Forward
Close
3/13

Components of the work bench

JJ
II
J
FG: Function Generator, PS: Power Supply, M: Motor with encoder, HB: H-bridge, PK2: I
PICkit 2, MCB: Motor Control Board. The PC is also part of the work bench. Back
Forward
Close
4/13

How the components are interconnected


FG +12V −12V
+-

1 L298 + GND -
1 CN1-PS PC

UART-A
RS232

CN4-I/P
Is

DB9-
C
Rs = 4.7Ω 10 USB
M1 M3
M
H-bridge board

PICKIT2

PICKIT2
M2

CN5-O/P
M4

CN2-
µC board
I1 I2 E1−2 +Vcc +5V GND I3 I4 E3−4
Encoder

+12V 1

DB9-CAN
CN3-Motor
3

5
5-9

Note: The setup allows to connect another motor to H-bridge board between pins M3
JJ
II
and M4 . Connector CN5-O/P can then be used to connect to I3 , I4 , E3−4 . But, as we
J
have only one QEI module on dsPIC30F4012, we cannot use encoder signal from that
I
motor. However, we can perform speed control by using armature current sensed at pin Back
15 of L298 similar to how it is being sensed at pin 1. Forward
Close
5/13

Use MPLAB IDE: Open project file

JJ
II
J
I
Back
Forward
Close
6/13

Use MPLAB IDE: Open program in project

JJ
II
J
I
Back
Forward
Close
7/13

Use MPLAB IDE: Insert controller code

JJ
II
J
I
Back
Forward
Close
8/13

Use MPLAB IDE: Build project

JJ
II
J
I
Back
Forward
Close
9/13

Use MPLAB IDE: Select programmer

JJ
II
J
I
Back
Forward
Close
10/13

Use MPLAB IDE: Program dsPIC30F4012

JJ
II
J
I
Back
Forward
Close
11/13

How to read data


Start terminal.exe. Configure the GUI as shown.

JJ
II
J
I
Back
Forward
Close
12/13

How to store data


• Click on Start Log button; provide a file name and location to store this file.

JJ
II
J
• Hold down reset button on MCB; click on Connect button on terminal.exe. I
• Release reset button; read in data for a little longer than ts of your control sytem. Back
• When done, click on Stop Log button on terminal.exe. Forward
Close
13/13

How to plot data


• Let log file created by terminal.exe be testdata.txt.
• Remove the parts of the text from the beginning and end of the
file that is not the data about variables of interest from the µC.
• Place m-file readplot.m in folder that contains testdata.txt.
• Start up GNU Octave in this folder.
• Execute readplot.m in GNU Octave.
• If plots have problems appearing, apply correction given in
readplot.m.
JJ
II
J
I
Back
Forward
Close

You might also like