29
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Embed Size (px)

Citation preview

Page 1: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023 – Motor Control

Lecture 4 – DAQ and Motor Controller

Page 2: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 2

Closed Loop Control

Motor Driver

desired position current

Computer and DAQ

Motor

analog speed signal

digital direction signal

Encoder

sensed actual position

Page 3: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 3

Let’s answer 3 questions.

1. How is the motor held in place and how is it connected to the shaft that it is to rotate?

2. How does the encoder work and how is it physically connected to the motor?

3. How do the DAQ and motor driver work?

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

Page 4: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 5

Interface to Computer

• We will use a National Instruments USB-6009 data acquisition (DAQ) device

• specs– USB interface to PC– 8 channels of analog input, 0-5V– 2 channels of analog output 0-5V

5 mA each– 12 channels of digital input/outputs

0 or 5V, (8.5 mA for outputs)– 1 counter

Page 5: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 6

NI USB-6009

Page 6: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 7

Interface to Computer

Page 7: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 8

cost: $41.67

Honeywell / Clarostat 600128CN1Allied Electronics part # 753-0059

Page 8: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 9

Computer Interface

• Let’s start with digital inputs to interface to the optical encoder.

notice that there are four wires

Page 9: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller
Page 10: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

+5V power

ground

channel A

channel B

channels A & B will be either 0V or 5V depending on whether that light detector detects light through a slit or not

Page 11: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

+5V power

ground

channel A

channel B

Page 12: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 13

Computer Interface to Motor

• To control the motor:– we have to control the current going to the motor (via the voltage)– however, the typical analog voltage signal that a computer generates

from the DAQ does not have sufficient current to power the motor– an amplifier is used*

• a power supply provides 24V (7.5 amp max for our case) to the amp• the computer DAQ generates an analog voltage in the range of

-0 to +5V; 0V means the motor is to stop ; +5V means the motor is to turn at a maximum speed

• a digital signal will give the desired direction (0 V, CCW, 5 V CW)

* also called a ‘motor driver’ or ‘speed controller’

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

Page 13: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

Page 14: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 15

from power s

upply

to motor

Page 15: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller
Page 16: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 17

Change motor direction

To go CW, set this digital output pin to TRUE (+5V).

To go CCW, set this digital output pin to FALSE (0V).

Page 17: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Homing Switch

to input pin on USB DAQ

+5V

0V

Page 18: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 19

Interface to Computer

0V from USB-6009

+5V from USB-6009

Page 19: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

USB

Page 20: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

USB

Page 21: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

USBdigital direction signal

analog speed signal

ground

Page 22: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

USB

24

vo

lt su

pp

ly

PWM

sign

al to

mot

or

Page 23: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

USB

5 volt, ground, channel A, channel B

Page 24: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering 25

Let’s answer 3 questions.

1. How is the motor held in place and how is it connected to the shaft that it is to rotate?

2. How does the encoder work and how is it physically connected to the motor?

3. How do the DAQ and motor driver work?

Motor Driver

desired position

currentComputer and

DAQMotor

analog speed signal

digital direction signal

Encoder

sensed actual position

Page 25: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering

Design Project

• For each motor in your design:– include an optical encoder for motor position feedback– include a homing switch to initialize your position– include limit switches as needed– mount the motor driver

• For the project:– mount the DAQ

Page 26: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering

Page 27: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering

Page 28: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering

Page 29: EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller

EML 2023Department of Mechanical and Aerospace Engineering