Theory of Operations - University of Portland

advertisement

University of Portland

School of Engineering

5000 N. Willamette Blvd.

Portland, OR 97203-5798

Phone 503 943 7314

Fax 503 943 7316

Theory of Operations

Project Helix: Holonomic Drive Control

Contributors:

Grant Hay

Dan Hoffman

Jeff Hayes

Approvals

Name Date Name

Dr. Advisor Dr. Lillevik

Insert checkmark (

) next to name when approved.

Date

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD .

.

.

.

Rev.

0.1

Date

.

.

01/21/06

.

.

.

REV. 0.1

Author

S. Lillevik

Reason for Changes

Initial draft

PAGE II

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD

Chapter

4

.

.

.

.

.

.

.

.

REV. 0.1

Architecture

PAGE 3

The Helix OS uses a call-and-return architecture. There is only one class, the HelixOS class, and all functions are methods that the main method calls. This architecture is used to simplify the algorithms and save memory space.

Figure 1. Software architecture of Helix OS.

Helix OS: The primary class that contains all methods.

Main: The basic main method that calls other methods.

Keypad: User interface method that provides input to Main method to say which Motion Control

Program is to be used.

Motion Control Program (MCP): A set of directions and rotations that are sent to the motors that control the wheel speeds.

Compare: Used with every movement to inform the Helix OS if slippage occurs.

Update: If slippage is detected, correct the motor speeds to overcome the problem.

Software Architecture

The software comprises a single class, the HelixOS class. The HelixOS class operates primarily from the main method, which calls the other methods as needed. The only method that the main method does not call is the feedback method, which is called by the motion control programs.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD

Chapter

4

.

.

.

.

.

.

.

.

REV. 0.1

Design Overview

PAGE 4

Figure 2. Helix OS system block diagram.

Helix OS: The primary class that contains all methods.

Main: The basic main method that calls other methods.

Keypad: User interface method that provides input to Main method to say which Motion Control

Program is to be used.

Motion Control Program (MCP): A set of directions and rotations that are sent to the motors that control the wheel speeds.

Compare: Used with every movement to inform the Helix OS if slippage occurs.

Update: If slippage is detected, correct the motor speeds to overcome the problem.

Software Design

Main: This is the primary method that operates the software and calls the other methods as needed. The entire method is a do-while loop that reiterates so long as the power remains on and a Boolean variable that is set to “true”. The purpose of this loop is to allow the robot to execute another set of instructions from the user after completing its current task. This method has no parameters.

Keypad: This component waits for the user to enter a number on the keypad by means of an interrupt and translates the data into an integer. This integer is used in a case switch in the main method that selects and calls the appropriate motion control program. Entering another number on the keypad while the robot is executing its last instruction from the user does not interrupt or otherwise affect the robot’s operation. Instructions from the user can only be entered after the robot has completed its last task.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD

Parameters:

.

.

.

.

REV. 0.1 PAGE 5

.

.

.

.

There are several of these methods as specified by individual instructions to the specific motors, providing necessary acceleration, velocity, and . values for the instructions will be predetermined by the team and hard-coded into the

MCP; the MCP does not calculate the vectors used by the instructions. This component has no parameters.

Compare: This method is called by the MCPs and interrupts the subroutine if the hardware detects that the motor is not operating properly due to slippage. This interrupt calls the update method.

Parameters: The compare method has one parameter, which is the signal from the hardware.

Update: This method takes the parameters from the update method and slows the motor(s) down to counteract the slippage.

Parameters: The update method has two parameters, which are the measured velocity and the velocity from the MCP.

Test Cases

Keypad: Testing for this component is twofold: the first test will be to see if using the keypad will trigger an interrupt. The second test will involve checking to see if pressing a button will produce the corresponding integer.

Motion Control Program: These methods will be some of the more tedious ones to test.

Testing to see if an instruction will produce the desired movement is essential, but beyond that the majority of the testing will be a matter of fine-tuning the values until the desired motion is achieved.

Compare: Testing of this component involves seeing if the monitoring hardware triggers an interrupt as directed.

Update: To test this component, once the slippage is detected, the method must reduce the velocity of the entire robot accordingly.

Pseudo-code

HelixOS class { main() { int key; // used to call selected mcp as determined by user via keypad boolean flag = true; // keeps the program running so long as the

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD

.

.

.

.

.

.

REV. 0.1

.

. // flag stays true and the robot is activated

// so long as flag stays true and the robot is activated, the program

// will continue to run do {

. detect incoming signal from keypad; key = keypad(signal); switch key:

{

}

} while (true);

1: mcp1();

2: mcp2();

// and so on as needed default: default_mcp(); break;

PAGE 6

}

} int keypad(signal) { translate signal into a number corresponding to the input on the keypad; int key = translated signal; return key; private compare(signal) {

Processor sends a read real velocity command to Motion Controller Chip.

Motion Controller chip checks velocity of motor.

Motion Controller chip sends real time velocity of motor to Host Processor.

Compares returned velocity of motor to velocity that was required.

If compared velocity is less than or greater than five percent of required velocity, then update method is called, sending the measured velocity and the velocity from the MCP.

Host Processor sends zero to !CS, !PS, and !RD, to see if Motion Controller is busy with Read Status Byte, if bit 0 equals 0 then not busy.

If not busy then send read command Read Real Velocity to Motion

Controller, Write real velocity to host processor.

Compare with Boolean real velocity to desired velocity of main program. If real velocity is +- 5% difference from desired velocity then Boolean equals true.

} private update(measured_velocity, mpc_velocity) {

Calls on Main Program for current velocity for motor.

Resends required velocity to Motion Controller Chip.

Motion Controller Chip speeds up motor or slows down as is required.

If motor was slipping, the velocity will be slowed which will increase traction to remove slippage.

Calls main program to resend last used velocity to motor that compare () == true.

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

THEORY OF OPERATIONS

PROJECT BLUEBIRD

}

.

.

.

. mcp1() {

.

. instructions to motor;

}

REV. 0.1

If main program writes from I/O with new velocity, then call method

.

.

. compare(). mcp2() { instructions to motor;

}

If main program writes from I/O with new velocity, then call method compare().

// additional motion control program methods as needed

}

PAGE 7

UNIVERSITY OF PORTLAND SCHOOL OF ENGINEERING CONTACT: A. NAME

Download