HotSpot: Thermal Seeking

HotSpot
Procedure
The following outlines the mechanism's procedure:
​
iOS app initializes
iPhone establishes Bluetooth connection with RedBear board
FLIROne connects to iPhone to establish image stream
iPhone captures image from FLIROne and saves Kelvin temperature of hottest pixel
iPhone initiates scan sequence with command to RedBear to proceed to next sector
RedBear sends motor commands to appropriate motors to reach the next sector in the S-shaped path
Repeat steps 4-6 until all sectors have been scanned
iPhone compares hottest temperature from each image and saves the maximum temperature and its sector number
iPhone sends command to RedBear board with coordinates of hottest object
RedBear commands appropriate motors to return to hottest object's location

Compendium
Planar Motion
Combining the bridge and hat assemblies with the integrated software solution yields a complete planar translational mechanism that consistently delivers the payload to the identified position.

Software
RedBear Blend Micro Arduino
The Arduino’s functionality is threefold: connect to the iPhone app via Bluetooth, output voltage sequences to move the stepper motors, and generate the path traversal to move the payload to a specified location. Since Arduino compiles using C++, classes are easily implemented. This is useful when integrating all three functionalities.
​
Bluetooth: Fortunately, Redbear supplies a Bluetooth class that enables capability of connecting and receiving bytes from the iPhone. After connecting to Bluetooth, the next step is defining a method for moving the motors.
Voltage Sequence: In order to rotate the stepper motors, the voltage sequence outlined in the motor’s specification sheet was programmed into the Arduino board. These sequences are implemented in a method that takes the X-Y direction and number of steps (voltage outputs) as parameters and outputs voltages via the built-in Arduino function digitalWrite(). Each time a call is made to this function, these sequences rotate the motors a certain number of steps.
Path Traversal: To convert path traversal to voltage sequence, a method was made relating steps to distance. The circumference of the gears is used to estimate the distance traveled by the payload/ bridge after 4096 steps (one rotation). In order to determine the number of steps and in which direction the components will travel, an absolute X- and Y-coordinate of the current payload location is stored in an array. Based upon the desired location and current location of the device, a method finds the distance from the X- and Y-coordinates. This distance is then converted into steps and fed into the output voltage sequence method in order to move the device to the desired location. The current location of the device is then updated and awaits a new byte input from the iPhone.
​
Byte clarification: A byte can transmit 16 unique values. For this project, these values correspond to a X- and Y-coordinate in the scan area. The payload is then moved to the coordinate using the methods defined above.

Software
iPhone App
Integrating two SDKs (software development kits), the app is capable of both thermal imaging and Bluetooth commands. Each of the SDKs (RedBear and FLIROne) are written in Objective-C. The first functionality of the app is to connect to the RedBear. The RedBear SDK contains the views and controllers for this action. After establishing Bluetooth connection, the app connects to the FLIROne thermal camera which is plugged in to the iPhone’s lightning port. The FLIROne camera is then initialized and a real-time thermal image is displayed to the operator on the iPhone screen. Initializing the camera begins a scanning sequence on the iPhone. This sequence sends a command via Bluetooth to the RedBear in the form of a byte which specifies the exact location on the grid where the payload will move.
The scanning sequence will stop at 16 locations on the grid to ensure that every region of the stage is imaged. At every location the on the grid, the iPhone receives a matrix composed of Kelvin temperatures from the FLIROne. The app then parses through this matrix and finds the matrix’s hottest temperature which is stored in an array on the iPhone. After the entire grid has been scanned, the app finds the hottest temperature in the aforementioned array. The index that corresponds with that temperature is then sent as a location (byte) to the RedBear. After the payload moves to the hottest index, the iPhone app is ready to run again.

Hardware
Hat
In maintaining the modularity of our design, we implemented a mechanism that would operate independently from the other primary components. Once we verified that the stage and bridge assemblies operated correctly, we began the conceptualization of the Y-direction motion which would mount to the top of the bridge. Making use of readily available materials and a flexible mechanical design, the hat assembly took shape. We moved through the design phase quickly so that we could build and test the mechanism as immediately as possible; this allowed us ample time to troubleshoot any potential setbacks.
​
To enable a quick build cycle, we utilized many common materials such as hot glue, PVC pipe, plywood, and adhesive strips in unconventional ways. The belt component underwent a number of material iterations from rubber bands to string to our eventual solution: custom-length plasticized strips. To realize the current design, we stretched two loops of our belt material over the PVC drums and fastened the midpoint of the lower belt to the traveller. To control the belt-drum interface friction, we adjusted the belt tension which needed to be large enough to maintain a smooth and continuous motion of the traveller without being so tight as to stall the motors. Additionally, we sought to minimize the friction between the traveller and the track. To accomplish this, we glued plastic LEDs through holes in the bottom of the traveller and created slots in the base of the hat in which the LEDs can slide. These plastic "skis" slid smoothly over the wood's surface and effectively supported the traveller with the payload onboard.

Hardware
Bridge
Beginning with the overall constraints of spanning 24", providing flexural rigidity and housing a drive train, we implemented a box-beam design with transverse axle and internal support bulkheads. From simple beam theory, we determined the appropriate relationships between critical dimensions to minimize deflection. Strategically placed cutouts reduce weight, while the bulkheads provide structural support to compensate for decreased material. In addition, these bulkheads provide a platform on which to mount the motors and electronics, and define the bearing surfaces to maintain smooth axle rotation.
Three stepper motors provide sufficient torque to drive the axle at a desired rotational speed. In turn, the axle transmits this motion to a travel gear mounted at each end. Each of these gears is flanged to constrain the motion linearly along the rack. A free wheel on each side rolls in conjunction with the gears and distributes the weight.
​
​

Hardware
Stage
The stage assembly had well-constrained functionality early in the design process and the only system-level interaction was the integrated rack. To create the stage, we simply defined outer dimensions and designed the wooden framework knowing that each individual component would be cut from a flat piece of plywood and assembled to achieve the three dimensional structure. We studied designs of rack-and-pinion mechanisms and ultimately implemented an appropriate gear tooth pitch such that we would get the required translational resolution without risk of the teeth breaking off. We integrated the rack into the primary structure to ensure structural rigidity.

THE WORKFLOW
This project was designed, built and tested during the Fall 2017 semester at the University of California Berkeley as the capstone project of EE106a.