camilo martinez advisor : dr. cris koutsougeras dept of computer science and industrial technology...
TRANSCRIPT
Camilo MartinezAdvisor : Dr. Cris Koutsougeras
Dept of Computer Science and Industrial Technology
Southeastern Louisiana University
OutlineDiagram - ControllerEncoders- ME210 & I2CMotor ControlAir FlowThe Main AlgorithmTimeline and DeliverablesQuestions
Basic Diagram
Main Encoder
Wind Direction
Encoder for Arm1 & Arm2
uController
Linear Actuator Arm1
Linear ActuatorArm2
Linear ActuatorArm3
Linear ActuatorArm4
Encoder for Arm3 & Arm4
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
The relationship between Channel A and B pulse is used to determine the direction of rotation.
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
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);}
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
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
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);
}
}
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
Air Flow
AutoCAD
ANGLES
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
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°)
Setting the positions for Arms
Arm1=Enc1()
If Arm1>=
0 and Arm1<1
80
Arm2=Arm1+180
Arm2=Arm1-180
Read Encoders
Return Values
Flip ArmsRead
Encoders
If Arm=16
0Flip Arm Down
Flip Arm Up
Start
If Arm=35
5
Questions ?