csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12...

17
2.1 Introduction to Control Systems In order for the system to stabilize when an error is produced, a fast and precise response is required from the BLDC motors. This will be achieved with a closed loop system using negative feedback. A general block diagram of control system and the components in a control system can be seen in Figure 10. Figure X: General Block Diagram of Control System The squares represent the sub-systems that make up the control system. The arrows represent signals that are input/output through each sub-system. Table 2 displays a list of the components, description, and the signals associated with the components in Figure 10. Table X: Description of Components and Signals Used in a Control System Component Symbo l Description Controller C Used to process error signal using a transfer function. System ( plant ) P Represents the components that are physically controller. Sensor s Provides the signal representing the current state of the system. Signal Symbo l Description Reference r Desired value or state of system, and is

Transcript of csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12...

Page 1: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

2.1 Introduction to Control Systems

In order for the system to stabilize when an error is produced, a fast and precise response is required from the BLDC motors. This will be achieved with a closed loop system using negative feedback. A general block diagram of control system and the components in a control system can be seen in Figure 10.

Figure X: General Block Diagram of Control System

The squares represent the sub-systems that make up the control system. The arrows represent signals that are input/output through each sub-system. Table 2 displays a list of the components, description, and the signals associated with the components in Figure 10.

Table X: Description of Components and Signals Used in a Control System

Component Symbol DescriptionController C Used to process error signal using a transfer function.

System ( plant ) P Represents the components that are physically controller.Sensor s Provides the signal representing the current state of the

system.Signal Symbol Description

Reference r Desired value or state of system, and is compared to the measured output.

Measured Error e Difference between desired output, and measured output.System Input u Control signal, or controller output

System Output y Current state of plant

2.1.1 PID Controller

2.3 Math Model

3.1 Hardware

Page 2: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

3.1.1 Arduino Uno

The Arduino Uno is based on the ATmega128P microcontroller. This component will be dedicated to providing the PWM signals sent to the electronic-speed controller. This microcontroller can also be programmed using LabVIEW, making the design of the control system easier. Figure X provides the pin layout of the Arduino Uno microcontroller board.

Image Retrieved from Arduino Mega 2560 Datasheet

Figure X: Arduino Uno Pin Layout

3.1.2 USB4 Encoder Data Acquisition Board

In order to sample the data sent from the rotary encoder, the USB4 Encoder Data Acquisition USB Device by US Digital was introduced to the project. This DAQ device, PCB layout, and characteristics associated with the device can be seen in Figures 15 and 16 below.

- 4 incremental encoder channels- 4 PWM measurement channels- 8 bit digital input port- 8 bit digital output port- 4 analog input channels ( 12 bit A/D )- 4 analog output channels ( 12 bit A/D )

Image retrieved from US Digital USB4 Encoder Data Acquisition USB Device User Manual

Figure X: US Digital Encoder Data Acquisition USB Device

Page 3: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Figure X: PCB Pin Layout of USB4 DAQ

Image retrieved from US Digital USB4 Encoder Data Acquisition USB Device User Manual

3.1.3 Brushless DC Motor

A motor is a mechanical device that converts electrical energy into mechanical energy. This mechanical energy is used to turn the shaft of a motor through a process called commutation. The type of motor used in this project is known as a brushless DC (BLDC) motor. The BLDC motor used in this project can be seen in Figure 1.

Figure X: A2208-12 Brushless DC Motors by Mystery

A BLDC motor is typically constructed with a three-phase winding topology with star connection. In order to generate motion each drive phase consists of one terminal driven high, one terminal driven low, and one terminal left floating. In order to control the speed at which the motor spins, the motor’s characteristics must be obtained. Table 1 displays equations used to describe an ideal motor.

Page 4: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Table X: Equations Used in an Ideal Motor

Variable Symbol Equationrevolutions per minute RPM RPM=KV (E )

back electromotive force BEMF BEMF= RPMK v

torque τ τ=KT ( I )

Kt = motor torque constantKv = motor constant

In BLDC motors the positions of current carrying windings can be found by allowing Kt to become a periodic function of electrical angle. BLDC motors are also ideal due to the fact that they can be operated using electronic signals. These electronic signals are represented as a train pulses. The process of producing said pulses is possible using pulse-width modulation (PWM). This process is later explained in Section 3 of this paper.

3.1.4 Electronic Speed Controller ( ESC )

The 30A Brushless Speed Controller by Hobbywing is a sensorless electronic speed controller (ESC) that is typically used for high power RC systems. Figure 16 below shows a photo of the ESC when not connected to the BLDC motor.

Figure X: Hobbywing Flyfun 30A Brushless Speed Controller

Figure 17 below displays the wire diagram of ESC. Like most components the black wire is the ground wire ( - ), and the red power ( + ) wire is supplied with a DC voltage. The blue arrow points to the wires, control signals, dedicated to operating/programming the ESC. Of the three

Page 5: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

wires the black wire is the ground, and the white wire is used to receive the PWM signal sent from the Arduino Mega. Using PWM also allows one to omit the red wire.

Image Retrieved from Sensorless Brushless Speed Controller Manuel

Figure X: Hobbywing Flyfun 30A Brushless Speed Controller Wire Diagram

According to National Instruments, PWM is a technique used to generate an analog signal using a digital source. The signal consists of a train of HIGH & LOW or ON & OFF pulses. Two components that define a PWM signal are the duty cycle, and frequency. The duty cycle is a ratio of the time a signal is active in one period. This process is best shown using Figure 18, and the example below.

Retrieved from: http://www.bristolwatch.com/picaxe/adc_pwm_demo.htm

Figure X: PWM Signal with 25% Duty Cycle

By referencing Figure 18, and Table 3 below, the following steps can be used to calculate the variables of a signal with a period of 2ms, and a duty cycle of 25%.

Table X: Variables Used to Calculate Duty Cycle

Variable DescriptionTon Time signal is active or ONToff Time signal is not active or OFF

Ton + Toff Period or complete cycle

Page 6: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

DC=T onT on+T off

=25%

Period=T=Ton+T off=1msT on=DC× (T on+T off )=0 . 25×2ms=0 .5msT off=T−T on=2ms−0 .5ms=1.5ms

DC=T onT on+T off

=0 .5ms0 .5ms+1 .5ms

=0 .52

=0 .25×100=25 %

3.1.5 Incremental Rotary Encoder

There are two mechanical configurations for “shaft” encoders that have been researched, linear and rotary. Linear encoders are used to measure linear motion or speed. The second configuration, rotary encoders, is used for angular measurements.

The type of encoder that best suites this project will be an incremental rotary encoder. An incremental encoder outputs digital pulses with respect to light and dark regions insider the encoder’s optical code wheel. An encoder also outputs a specific value called an index, which is considered the absolute position of the code wheel. Figure 9 is an example of an incremental encoder.

Figure X: Incremental Shaft/Rotary Encoder

Incremental Rotary EncoderThe YUMO E6B2 Incremental Rotary Encoder, seen in Figure 20, was chosen due to its high resolution of 1024 pulses per revolution, and ability to handle loads of up to 30N. The encoder is fixed using a small bracket, and the shaft is kept stable using a pillow block.

Page 7: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Figure 20: YUMO E6B2 Rotary Encoder Setup

3.2 Software

The following sections describe the steps taken to program the Arduino Uno, and the USB4 Encoder Data Acquisition Board

2.3.1 Programming Arduino Uno

2.3.2 Programming USB4 Encoder Data Acquisition Device

There were several benefits to using this device. The US Digital website provides an adequate amount of documentation, and provides all the drivers/software needed to operate the device. A demo program can be also be downloaded in order to explore the features of the DAQ device. An image of this demo program can be seen in Figure 17.

Page 8: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Image retrieved from US Digital USB4 Encoder Data Acquisition USB Device User Manual

Figure X: Image of Demo Program Used During Encoder Testing

Advanced users can also develop their own applications in C/C++/Visual Basic by using libraries and sample code provided by US Digital. A register based interface is also provided in the demo program for users who prefer lower level control.

The USB4 device permits users to really push the limits regarding the data acquisition of a sensor. However, as advantageous as the device may be, the device requires a great deal of research to operate. A user needs to have a decent background in electronics, digital logic, computer architecture, and a solid understanding in programming hardware in order to really benefit from the device.

Laboratory Virtual Instrument Engineering Workbench (LabVIEW)LabVIEW is a powerful system-design platform and development environment that incorporates a graphical programming environment. LabVIEW can be used for numerous applications such as:

- Data Acquisition- Instrument Control- Test Automation- Analysis and Signal Processing- Industrial Control- Embedded Design

Programs in LabVIEW are called Virtual Instruments (VIs), and each VI contains two parts; a front panel and back panel. The front panel displays data using indicators, and controls. It also incorporates the use of tables, buttons, sliders, and graphs. An example of a front panel can be seen in Figure 21.

Figure X: Example of Front Panel in LabVIEW

Page 9: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

The back panel consists of a block diagram that contains that graphical source code to develop a VI. An example of a back panel can be seen in Figure X.

Figure X: Example of Back Panel in LabVIEW

Using a graphical programming approach makes the process of developing and testing the control system in this project easier. LabVIEW also has a large amount of resources available online.

For this project LabVIEW is going to be used to program the Arduino Uno microcontroller, and the multifunction DAQ device.

4. Testing

In order to understand the characteristics of the motor, two tests were performed. One test incorporated a micro load cell, and the second test incorporated an additional rotary encoder. The following sections provide information on the procedure for each test, and the values that were acquired.

4.1 BLDC Motor Test: Micro Load Cell

The goal of this project is to design a system that even when applied a downward force the system is still be able to achieve stabilization. In order for this to be accomplished, the system must incorporate a sensor that is capable of interpreting the force being applied. The 3133 Micro Load Cell (0 – 5kg) is a force sensing module capable of measuring, depending on the application, a weight or force being applied. Figure 18(a) shows a photo of the micro load cell, and Figure 18(b) shows a photo of how weight was applied during calibration.

a. Micro Load Cell b. Image of Micro Load Cell During Calibration

Page 10: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Image Retrieved from 3133 Micro Load Cell CZL635 datasheet

Figure X: Micro Load Cell

With one side of the cell fixed to the board, and the other side hanging freely one can apply a weight that results in a deformation of the micro load cell. Using a small element called a strain gauge, one can measure a variable resistance output by the gauges. This variable resistance is proportional to the deformation exhibited by the metal structure in which the gauge is placed on. Figure 19 shows a diagram of a strain gauge, and how tension is used to output a value.

- Gauges are bonded onto the load cell in precise locations

- As the strain gauge is deformed, an electrical signal is produced in proportion to the load

Image Retrieved from: http://ueidaq.wordpress.com/2013/08/02/the-twists-of-strain-gauge-measurements-part-1/

Figure X: Strain Gauge Diagram

Since the load cell only requires a voltage supply of 5Vdc, the signal output by the strain gauge is very small. Similar to the issue that was encountered with the rotary encoder, the signal produced is not strong enough to be read by the Arduino Mega. This problem was solved by incorporating a device called a Phidget Bridge.

Phidget 4-Input Wheat Stone Bridge DeviceThe 1046 PhidgetBridge consists of 4 wheat stone bridges that are used to amplify the signal output by the micro load cell. This wheastone bridge can also be used to test various wheatstone bridge bases sensors, and provides several demo applications. Users can also develop their own applications using a great deal of programming languages such as:

- VB6 - VB.NET - C# - C++- Flash 9 - Java - LabVIEW - Python

Using the bridges USB port a user can connect directly to a computer. Figure 20 shows how the bridge and load cell are connected.

Page 11: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Image Retrieved from 1046 PhidgetBridge 4-Input Product Manual

Figure X: Phidget Bridge and Micro Load Cell Interface

One of the applications provided by the Phidget website was used during the calibration of the micro load cell. Figure 21 displays the application, and the steps used during calibration.

a. Description of Application b. Image of Application

1. Box that lets user know that the Phidget Bridge is attached

2. Box that gives a user the option to choose which bridge/port the microload cell is attached too

3. Establishes connection with Phidget Bridge to begin calibration

4. Box used to begin calibration of sensor

5. Converted value from load cell.

6. Provides a user the option to adjust the datarate in which the bridge collects values sent from load cell.

7. Drop down menu that allows a user to manipulate the gain

Retrieved from 1046 PhidgetBridge 4-Input Product Manual

Figure X: Phidget Bridge Application

Several trials were conducted in order to determine best gain/data rate combination. An example of the type of data collected can be seen in Table 3.

5.1 Electrical Setup

Page 12: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

5.1.1 Plant System

5.1.2 Controller

A PID controller is a control loop feedback technique that is widely used in control systems. A block diagram of a PID controller can be seen in Figure 23.

Figure 23: Block Diagram of PID Controller

This three term controller uses three constant parameters that are labeled as:

- proportional gain (KP)- integral time (Ki)- derivative time (Kd) The transfer function of the PID controller looks like:

K p+K is

+K ps=K p s

2+K p s+K is

Table 4 displays the characteristics of P, I, and D controllers.

Table 4: Characteristics of P, I, and D Controllers on Closed-Loop SystemResponse Rise Time Overshoot Settling Time S-S Error

Kp Decrease Increase Small Change DecreaseKi Decrease Increase Increase EliminateKd Small Change Decrease Decrease Small Change

In a closed loop system the error ( e ) produced by the system is sent to the PID controller. The signal output by the controller ( u ) is represented by the following equation:

u=K pe+K i∫edt+Kd dedt

Page 13: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2014/... · Web viewA2208-12 Brushless DC Motors by Mystery A BLDC motor is typically constructed with a three-phase

Once the signal (u) is established it is sent to the plant, and a new measured output ( Y ) is obtained.

There are other forms of PID controllers in which only two of the three terms are incorporated into a system. A PID controller will be introduced into the design of the control system, and depending on how the system reacts it may be reduced to only a two term controller.

5.1.3 Sensor

6. Implementation of Controller

6.1 PID Controller with One BLDC Motor

6.2 PID Controller with Two BLDC Motors

7.1 Troubleshooting Problems ( Electrical )

BLDC

Encoder

LabVIEW

7.2 System Improvements ( Electrical )

Resources

[]

[]

[]

[]

[]

[]

[]

[]