Gulotta_Wright_Parisi_FinalProjectOverview1

16
Smart Mount Joseph Gulotta, Nicholas Parisi, Ryan Wright

Transcript of Gulotta_Wright_Parisi_FinalProjectOverview1

Page 1: Gulotta_Wright_Parisi_FinalProjectOverview1

Smart Mount

Joseph Gulotta, Nicholas Parisi, Ryan Wright

Page 2: Gulotta_Wright_Parisi_FinalProjectOverview1

Description Design consists of two servo motors

1. Controls up/down tilt movement2. Controls left/right tilt movement

Page 3: Gulotta_Wright_Parisi_FinalProjectOverview1

Requirements Must be able to change vertical angle Must be able to change horizontal angle Must be able to calculate the vertical angle via

the accelerometer Must be able to move to any position easily

Page 4: Gulotta_Wright_Parisi_FinalProjectOverview1

Functions Tilt the mount up and down Tilt the mount right and left Calculate the vertical angle Be able to set any position easily

Page 5: Gulotta_Wright_Parisi_FinalProjectOverview1

Resources 1 MSP430 LaunchPad Microprocessor 2 Servo Motors 1 Accelerometer Voltage Divider Circuits 2 Potentiometers Breadboard Wires linking the MSP430 to the breadboard 1 Board to represent a wall 1 board to represent the mount & monitor Power Supply in Lab – May eventually be

changed to an external supply

Page 6: Gulotta_Wright_Parisi_FinalProjectOverview1

State DiagramSet Vert. Pos.

Initial

Set Horz. Pos.

Calc. Angle

Final Pos.

Page 7: Gulotta_Wright_Parisi_FinalProjectOverview1

Inputs & Outputs Input

Power Supply in Lab Potentiometers

Effects duty cycle and PWM NOTE: PWM does not go through the pot, that would

just decrease the amplitude. Team made the initial mistake of putting the PWM into the

pot. Output

Servo Arm Positions Angle of the vertical tilt

Accelerometer

Page 8: Gulotta_Wright_Parisi_FinalProjectOverview1

Algorithms & Error Handling Algorithms

Turn each servo in their respective direction. Done by turning the potentiometer.

Setting duty cycles Calculating angle via the accelerometer

Error Handling Unsure what to put here, more to come soon.

Page 9: Gulotta_Wright_Parisi_FinalProjectOverview1

Communication The MSP430 will communicate to the servo

motors and provide power The voltage divider circuit with the

potentiometer will communicate position to the servo arm

The accelerometer will communicate the vertical angle to the user

Page 10: Gulotta_Wright_Parisi_FinalProjectOverview1

Coding Practices Neat, commented code

Modular Able to be re-used easily No hard coding.

Error Handling Informing and specific More to be added soon.

Interfaces COBS

ADC

Page 11: Gulotta_Wright_Parisi_FinalProjectOverview1

Software Architecture Code Modules – Builds on the servo ADC lab

Main Calls ADCInit() and ServoInit() Calls ServoSetDuty, passing in StartADC() and adding 1100 to it. This

is done because the servo may not turn due to the duty cycle not being in the proper range. The transfer function here simply is StartADC()+1100.

Servo.c ServoInit(void)

ServoInit initializes the servo. This sets the timer, output mode, output pin, and which peripheral will be used. In addition, the period that it will operate at is 20ms. An initial duty cycle for the PWM is set.

ServoSetDuty(uint16_t regVal) ServoSetDuty looks at the values stored in regVal and compares it to the

upper and lower duty bounds set by Servo.h, making sure that the duty cycle does not go above or below the bounds set.

ServoStop Stop the servo from performing its current task.

Page 12: Gulotta_Wright_Parisi_FinalProjectOverview1

Software Architecture Code Modules Continued.

Servo.h Contains macros for upper and lower bounds for the timer, thus

defining the duty cycle’s lower and upper bounds. Also declares the functions ServoInit(void), ServoSetDuty(uint16_t regVal), and ServoStop(void).

Adc.c ADCInit()

Declares registers to enable and control the ADC. StartADC(void)

Starts the analog to digital conversion. While certain registers are active, whatever is stored in the 10 bit ADC memory register will be returned.

Adc.h Declares the functions ADCInit() and StartADC(void).

MSP430_launchpad.h Defines Pins & Buttons for the MSP430 launchpad.

Page 13: Gulotta_Wright_Parisi_FinalProjectOverview1

Software Architecture Code Modules Continued.

Accelerometer Module Accelerometer Read

Reads the x, y, and z values acceleration data gathered by the accelerometer.

Accelerometer Get Data I^2C read operation to fetch the data gathered by

“Accelerometer Read”. User will use “Accelerometer Get Data” to get the x, y,

and z acceleration data, and return it. Use a structure -- pass it in, place data in, pass it back. Uint16 inside structure.

Page 14: Gulotta_Wright_Parisi_FinalProjectOverview1

Power and Grounding Management Power

Powered from the computer Need to get a different supply.

Grounding 1 common ground Power ground

Page 15: Gulotta_Wright_Parisi_FinalProjectOverview1

Safety Assessment Don’t overload the servos by putting too much

weight on the end. Structure must be stable and not break

Breaking would cause damage to whatever is being held up.

Proper grounding

Page 16: Gulotta_Wright_Parisi_FinalProjectOverview1

Documentation Lab report complete with pictures and

references MSP 430 datasheet Accelerometer datasheet

PowerPoint outlining the project Gantt Chart outlining our progress