camilo martinez advisor : dr. cris koutsougeras dept of computer science and industrial technology...

22
Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Upload: coral-hall

Post on 12-Jan-2016

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Camilo MartinezAdvisor : Dr. Cris Koutsougeras

Dept of Computer Science and Industrial Technology

Southeastern Louisiana University

Page 2: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

OutlineDiagram - ControllerEncoders- ME210 & I2CMotor ControlAir FlowThe Main AlgorithmTimeline and DeliverablesQuestions

Page 3: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Basic Diagram

Main Encoder

Wind Direction

Encoder for Arm1 & Arm2

uController

Linear Actuator Arm1

Linear ActuatorArm2

Linear ActuatorArm3

Linear ActuatorArm4

Encoder for Arm3 & Arm4

Page 4: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Mbed uController

NXP LPC1768 MCU High performance ARM® Cortex™-M3 Core

96MHz, 32KB RAM, 512KB FLASHEthernet, USB Host/Device, 2xSPI, 2xI2C, 3xUART,

CAN, 6xPWM, 6xADC, GPIO

Page 5: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University
Page 6: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

The relationship between Channel A and B pulse is used to determine the direction of rotation.

Page 7: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

ME-210 & I2C communicationThe ME-210 Unicoder

encoder provides one physical interface for transmission of commands and status information: I2C.

The ME-201 also providesSpeedWheel velocityTotal distance travelledDirection

Page 8: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Some codesend[0]='.'; //Sync i2c.write(addr, send, 1); // Send command stringsend[0]=‘E';//Echoi2c.write(addr, send, 1); // Send command stringint degrees=0;send[0]=‘W';//Get Angle return 10 bit resolution angle while(1){

i2c.write(addr, send, 1); // Send command string i2c.read(addr, deg, 3); // read the two-byte echo result int range = (deg[2] << 8)+deg[1]; degrees=((360*range)/1023); pc.printf("degrees = %d\n",degrees);}

Page 9: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University
Page 10: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University
Page 11: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

H-bridge & The Sabertooth

2 x25 SabertoothInput voltage: 6-24V

nominal, 30V absolute max.

Output Current: Up to 25A continuous per channel. Peak loads may be up to 50A per channel for a few seconds

Page 12: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Standard Simplified Serial ModeSending a value of 1-127 will command motor 1

Sending a value of 128-255 will command motor 2. Sending a value of 0 will shut down both motors.

Motor1 Motor2 1 0x01 Forward 128 0x01 Forward

127 0x7F Backward 255 0x7F Backward65 0x40 Stop 128 0x40 Stop

Full Stop 0 0x00

Page 13: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

MOTOR CODEint main() { com1.baud(9600); while(1) {

wait(1);com1.putc(0x01);//motor Acom1.putc(0xFF);//motor B

wait(3);com1.putc(0x79);//motor A

com1.putc(0x80);//motor B wait(3);

com1.putc(0x0); wait(3);

}

}

Page 14: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

AIR FLOWStudy of air flow on a pole.NASA FoilSim is interactive simulation

software that determines the airflow around various shapes of airfoils.

 The software displays plots of pressure or airspeed above and below the airfoil surface.

http://www.grc.nasa.gov/WWW/k-12/airplane/foil3.html

Page 15: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Air Flow

Page 16: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

AutoCAD

Page 17: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

ANGLES

Page 18: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

The Main Algorithm Maximum flow is from 20 ° to 160 ° Degrees between division of right and left

flow 15 °Flip up on 355 ° - Flip down on 160 °

Arm1 and Arm2 oppositeSo Arm2 position is Arm1+180

Page 19: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Read the position of the encoder to determine wind direction

Flip front panel to 45° left to 90° back and right to 0° degrees.

Calculate maximum gap of wind (between 150° ~160°)

Page 20: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Setting the positions for Arms

Arm1=Enc1()

If Arm1>=

0 and Arm1<1

80

Arm2=Arm1+180

Arm2=Arm1-180

Read Encoders

Return Values

Page 21: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Flip ArmsRead

Encoders

If Arm=16

0Flip Arm Down

Flip Arm Up

Start

If Arm=35

5

Page 22: Camilo Martinez Advisor : Dr. Cris Koutsougeras Dept of Computer Science and Industrial Technology Southeastern Louisiana University

Questions ?