Sunteți pe pagina 1din 61

University of Colorado Boulder

Camera Inspection Device


CU Boulder - SGRE

User Manual and Breakdown of Components

Authors
Aaron Stirk| Jenny Roohr | Hadeel Al Gallaf
Daniel Straub | Mathew Coaty | Enrique Barraza

March 22, 2019


Contents
1 Summary 3

2 Enclosure 3
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Dimensioning the Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 80/20.net Enclosure Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.1 Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.2 Frame & Paneling Fastening Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.3 Window Paneling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.4 Wall Paneling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.5 Paneling Gasket - For all internally attached paneling. . . . . . . . . . . . . . . . . 11
2.4 Out-sourced Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1 Fastening Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.2 Weather Strip - For all externally attached paneling . . . . . . . . . . . . . . . . . 14
2.5 Internal Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.1 Heater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5.2 Filter Fan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5.3 Insulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5.4 Moisture Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5.5 Electronics Enclosures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6 Assembling the Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6.1 Frame and Paneling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6.2 WidowX and Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3 Software 23
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Arduino and Arbotix-M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Python and Raspberry Pi (RPi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.4 Data Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5 Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.6 Add-on Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.7 Wiring and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.7.1 Arbotix-M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.7.2 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.8 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.9 Installation: Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.9.1 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.9.2 Arbotix-M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.9.3 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.10 Initiating Inspection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4 Useful Resources: Software 29


4.1 Setting up RPi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 gphoto2 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.3 Arbotix-M and Dynamixel Servos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 Serial Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.5 Data Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6 PiJuice Hat Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5 Appendices 31

Page 1 of 60
A Local Providers 31
A.1 80/20 Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
A.2 Hardware Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

B Hardware Selection Analysis 31


B.1 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
B.2 Pan & Tilt Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
B.3 Window Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
B.4 Heater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
B.5 Fan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

C CAD Drawings for 80/20 34

D Pricing Quotes, Drawings, and BOM from 80/20 39


D.1 Hardware & Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
D.2 Paneling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

E AR Polycarbonate Spec Sheets 50

F Tutco-Farnam Quote for Heater & Attachments 52

G Arduino Code 52

H Python Code 58

Page 2 of 60
1 Summary
This document contains a description and user manual regarding the Fall 2018-Spring 2019 Senior Design
project in collaboration with Siemens Gamesa Renewable Energy to develop a camera inspection device
that can remotely "scan" the blades of a wind turbine. The device will sit at the base of the tower, and
when called upon remotely, the device will start to snap sequential photos of the blades that will then be
transmitted and processed by Siemens’ software algorithm. The internals of the device include a DSLR
camera, two servo motors, a Raspberry Pi, and microcontroller. This document goes into detail of what
type of hardware is used, how it interfaces together, and the software and code that controls the devices.
Additionally, it will cover the breakdown, setup, and details of the protective enclosure which contains
the electronics.
First, the breakdown of the 80/20 Extruded Aluminum hardware will be covered from how to purchase
the material, assemble, and maintain the enclosure. The Software portion of the project will then be
explained along with documentation of each of the components covering where to get them, sample code,
and other information.

2 Enclosure
2.1 Overview
The enclosure for the automated wind turbine inspection device is fabricated to appease the following
design requirements:
1. Cost-Effective - Be competitive with third-party inspection techniques
2. Durable - Be able to survive impacts from golf-ball sized hail and ice, achieving a 25-year lifetime
comparable to the wind turbines themselves
3. Maintain Picture Quality - Despite rain and debris, allow for the camera to continue taking quality
pictures of the blades
4. Weatherproof - Be applicable on both onshore and offshore wind turbines, keeping the electronics
inside dry and within their operating temperatures
5. Ability for Serial Production - Have the enclosure be as "off-the-shelf" as possible, minimizing
manufacturing time and effort needed by Siemens Gamesa
The enclosure is to be mounted approximately 2-3 meters from the ground on the base of the wind
turbine, with the blades in reverse rabbit-ear position above it and the enclosure directly beneath the
hub. The enclosure is mounted to the wind turbine base via magnets.

Figure 1: CAD-generated exploded view of enclosure and internal components

Page 3 of 60
2.2 Dimensioning the Enclosure
The current enclosure is dimensioned to be as universally applicable as possible while operating within
the restrictions of the camera, the Sony Cybershot DSC-RX10 III. The camera can take pictures that
adhere to the metadata requirement of 1 pixel per mm up to 80 meters away. Due to this, the enclosure
is applicable on all wind turbines 85m or shorter, regardless of blade length or tower base diameter.

(a) Front of Enclosure Dimensions


(b) Side of Enclosure Dimensions

Figure 2: Dimensions of Current Enclosure Prototype

To modify the case to work with taller towers, a spread sheet has been created to allow for quick and
easy generation of enclosure dimensions. Simply input tower height, blade length, base diameter, and
the normal distance from the center of the tower to the tip of the blade. The spreadsheet will give you
the necessary dimensions to order the enclosure for taller wind turbines.

2.3 80/20.net Enclosure Materials


All materials necessary to build the enclosure can be ordered directly off of 80/20.net or from a local
provider, such as Fiero Fluid Power (Appendix A) in Arvada, CO. The materials can be bought, ma-
chined, and shipped by 80/20. Assembly and some minor manufacturing is done by Siemens Gamesa to
save costs.

2.3.1 Frame
1.00" X 1.00" T-Slotted Profile - Four Open T-Slots. P.N: 1010

https://8020.net/1010.html

Description: 1010 is a 1.00” x 1.00” fractional 10 series square T-slot profile with four open T-slots,
one on each 1.00” face. The profile has align-a-grooves to assist in aligning connecting profiles. The
1010 profile is compatible with all 10 series fasteners. This profile lends itself to machine guards, sound
enclosures, work benches, panel mount racks and displays. The four open T-slots enable access from any
direction and are useful for mounting accessories.

To order the frame from 80/20, simply send them or Fiero Fluid (Appendix A) the CAD assembly of
the frame. All CAD files for any length of frame can be downloaded off of 8020.net. Make sure to let

Page 4 of 60
them know about the counterbore holes in the peak of the frame, the BOM for which can be found in
Appendix D.

(a) Picture from CAD Exploded

(b) The T-slot frame on the prototype enclosure

Figure 3: Location & Visual of T-Slotted Frame in Enclosure.

(a) Isometric View of T-Slotted Frame (b) Drawing of 10 series T-Slotted Frame

Figure 4: Helpful CAD visuals of the 80/20 T-Slotted Frame.

Table 1: 80/20 Aluminum T-Slot Profile Specifications


Series 10 Series
Material Aluminum
Grade 6105-T5
Finish Anodize
Color Clear
Drop Lock 2°
Moment of Inertia - IX 0.0442 in.4
Moment of Intertia - IY 0.0442 in.4
Surface Area 0.436 Sq. in.
Yield Strength 35,000 psi
Modulus of Elasticity 10,200,000 lbs / Sq. in.
Weight 0.0424 lbs

Page 5 of 60
Table 2: 80/20 T-Slot Profile Price Breakdown
Price p/ inch $0.23
Price p/ cut $1.95
Price p/ miter cut $2.80
Price p/ rib counterbore $2.25
Price p/ peak counterbore $7.15

Reference Appendix D for Pricing Quote & BOM from 80/20.

2.3.2 Frame & Paneling Fastening Hardware

Table 3: 10-Series Fastening Hardware from 80/20


P.N. Name Price Quantity Total Price
3395 10-32 Standard Anchor Fastener Assembly $2.90 4 $11.60
3691 1/4-20 x .750" Socket Head Cap Screw $0.34 2 $0.68
3656 1/4-20 Hex Nut $0.10 2 $0.20
3658 .286" ID Washer $0.07 2 $0.14
4081 5 Hole "L" Flat Plate $6.55 16 $104.80
4143 4 Hole 30°Angled Flat Plate $4.90 4 $19.60
3321 Bolt Assembly: 1/4-20 x .500" $0.50 108 $54.00
2414 1" Economy Floor Mount Base Plate $8.15 4 $32.60
3342 1/4-20 x .500" FBHSCS Screw* $0.30 4 $1.20

*FBHSCS: Flanged Button Head Socket Cap Screw

Table 4: Associated URLS for Purchasing 80/20 Fastening Hardware and Assembly Use
P.N. Use url
3395 Internal ribs to frame https://8020.net/3395.html
3691 Counterbore hole at peak https://8020.net/3691.html
3656 Counterbore hole at peak https://8020.net/3656.html
3658 Counterbore hole at peak https://8020.net/3658.html
4081 90°frame attachment https://8020.net/4081.html
4143 30°frame attachment https://8020.net/4143.html
3321* Panel & frame attachment https://8020.net/3321.html
2414* Magnet Attachment https://8020.net/2414.html
3342* Magnet Attachment https://8020.net/3342.html

Reference Appendix D for Pricing Quote & BOM from 80/20.


*These items are not reflected in the BOM in Appendix D

2.3.3 Window Paneling


AR Polycarbonate Windows - .177" thick, clear. P.N. 2642

https://8020.net/2642.html

Description: AR polycarbonate panels are a durable option that provides high optical clarity and impact
resistance. It is more abrasion and UV resistant than polycarbonate panels and stable up to 240 degrees
Fahrenheit, making it ideal for both indoor and outdoor applications. AR polycarbonate is commonly
used in enclosures and safety applications in high-traffic areas. All CAD drawings and 80/20 quotes can
be found in Appendices C and D.

Page 6 of 60
(a) Picture from CAD Exploded View (b) Picture from of AR Polycarbonate window on enclo-
sure prototype

Figure 5: Location & Visual of AR Polycarbonate panels in Enclosure.

Table 5: 80/20 AR Polycarbonate Specifications


Series Fractional
Material AR Polycarbonate
Color Clear
Thickness 0.220 - 0.236 in. (6.5 mm)
Stock Sheet Size 48 in. x 96 in. (1219.2 mm x 2438.4 mm)
Weight 1.500 lbs

Reference Appendix E for specification sheets regarding AR Polycarbonate.

Table 6: 80/20 AR Polycarbonate Price Breakdown


Price p/ SQFT $18
Price p/ cut $10.50
Price p/ miter cut $90

Reference Appendix D for Pricing Quotes & BOM from 80/20.

Manufacturing Needed - Bonding the Polycarbonate:


Dicholoromethane is used to bond the two AR Polycarbonate into one peaked window to maintain
weatherproof and picture integrity. It is applied to the miter-cut edges of the polycarbonate where the
two panels meet. It is then allowed to dry for one hour. The two panels will then have become one. The
steps with associated visuals are below.

Page 7 of 60
Figure 6: The chemical component applied to the miter-cut edges of the polycarbonate panels to bond
them into one window.

Figure 7: The first step is to attach the panels to the frame as they will be in actuality. Tape them
tightly together.

Page 8 of 60
Figure 8: The panels will be held together by the frame and the applied tape

Figure 9: The Dicholoromethane is applied with a syringe inbetween the panels. Be sure that the
chemical gets inbetween the panels. Excess chemical can be wiped away. It is then left to dry for a
minimum of one hour. This completes the bonding process

Page 9 of 60
2.3.4 Wall Paneling
PVC Paneling - .187" Thick, Smooth, Black. P.N. 2660-S

https://8020.net/2660-s.html

Description: Polyvinyl Chloride (PVC) Acrylic panels are impact and chemical resistant with an option
for either a smooth finish or a texture on one side which hides scratches and marks. It is stable up to
160 degrees Fahrenheit and is available in black or yellow. PVC Acrylic is commonly used in exhibits,
displays, signs, and fixtures. All CAD drawings to be sent to 80/20 can be found in Appendix C.

(a) Picture from CAD Exploded View (b) PVC paneling on enclosure prototype

Figure 10: Location & Visual of PVC panels in Enclosure.

Table 7: 80/20 PVC Paneling Specifications


Series Fractional
Material Polyvinyl Chloride (PVC) Acrylic
Color Black
Thickness 0.187 in. (4.70 mm)
Stock Sheet Size 48 in. x 96 in. (1219.2 mm x 2438.4 mm)
Weight 1.2390 lbs

Table 8: 80/20 PVC Price Breakdown


Price p/ SQFT $9.45
Price p/ cut $10.50

Reference Appendix D for Pricing Quotes & BOM from 80/20.

Manufacturing Needed- Painting:

• Purchase any white latex-based paint from local providers (Appendix A).
• Use a roller to apply paint

• Paint only exterior side of each panel


• Paint 3 coats allowing each coat to dry for 1.5 hours

Page 10 of 60
2.3.5 Paneling Gasket - For all internally attached paneling.
10 Series Economy Panel Gasket. P.N. 2177

https://8020.net/2177.html

To be used on all panels that are inserted into the t-slot frame.

Description: Economy panel gasket is available in either a black thermoplastic elastomer or gray silicone
rubber. It recesses in a T-slot to secure plastic panels, plates, and mesh and is easily inserted after a
panel has been placed in the T-slot. The economy panel gasket can be ordered by the foot (meter) or in
150 foot (45.7 meter) rolls. Tip: Cut ends at a 45 degree angle for corner connections to avoid overlap
or crashing.

(a) 80/20 Economy Panel Gasket (b) Utilization of gasket in enclosure

Figure 11: Visual of gasket and location in enclosure.

Figure 12: Size Specifications for 80/20 Panel Gasket:


A = .208 in.
B = .362 in.

Table 9: 80/20 Economy Gasket Specifications

Page 11 of 60
Series 10 Series
Material Silicone Rubber
Process Extruded
Finish Gloss
Color Gray
Length per foot
Weight 0.0160 lbs

36 feet of gasket is enough to seal the outside edge of all panels that are attached inside the t-slotted
frame. Only one cut is necessary for this.

Table 10: 80/20 Panel Gasket Price Breakdown


Price p/ SQFT $1.25
Price p/ cut $10.50

Reference Appendix D for Pricing Quote & BOM from 80/20.

Table 11: Gasket lengths needed to be cut


Quantity Length (in.) Use
8 14 vertical cube segments
4 16 horizontal cube side segments
6 22 horizontal cube front/back segments
4 11 diagonal edges at the peak

Manufacturing Needed & Application:

1. Cut the gasket into the lengths described in Table 11.


(Approximately 2 inches longer than the required length is cut)

2. Insert the gasket into the specified location, externally inbetween the panel and the t-slot. Wedge
it in tightly.
(Reference Figure 11b)
3. Cut off excess gasket at a 45°angle with the corner.

2.4 Out-sourced Hardware


2.4.1 Fastening Hardware
Access Door Attachment: All necessary hardware for access door attachment can be purchased
from a local provider as described in Appendix A.

Table 12: Fastening Hardware for Access Door Attachment


Name Specs Use Price Quantity
Internal Thread Steel: 1/4-20 Inserted into front panel $0.89 4
Screws Steel: 1/4-20 x 1.75 in. Attach access door to front panel $0.23 4

WidowX Attachment: The WidowX is attached to the mounting plate via the four holes on the top
deck as seen in Figure 13. The bottom deck can be put aside. It will not be used for our applications.

Page 12 of 60
Figure 13: The arrow points to the holes that will be used to attach the WidowX to the mounting plate.
The holes are sized for #6-32 screws.

All necessary hardware for WidowX attachment can be purchased from a local provider as described
in Appendix A.

Table 13: Fastening Hardware for WidowX Attachment


Name Specs Use Price Quantity
Threaded inserts Steel: #6-32 x 3/4 in. Inserted into mounting plate $0.26 4
Screws Steel: #6-32 x 1 in. Attach WidowX to mounting plate $1.18 4
Washers Steel: #6-32 Screw Attachment $0.073 4
Rubber Washers 1/4" I.D. Level WidowX $0.28 8

*Rubber Washers should be purchased in bulk

Rubber Washers: Silicone Rubber Washers will be used for all external panel attachment as well as
WidowX attachment.

Table 14: Rubber Washer Purchasing Information


P.N. Description Quantity Price
99604A115 Weather-Resistant, 1/4" Screw Size, 0.23" ID, 0.625" OD 1 pack of 50 $13.97

https://www.mcmaster.com/99604a115

Silicone:

• Close all gaps to maintain weatherproof integrity after assembly is complete.


• Heater attachment
• Threaded insert / internal thread attachment

Silicone can be purchased from a local provider as described in Appendix A or via the provided link.

Table 15: Silicone Purchasing Information


Name Description Quantity Price
All Purpose Silicone 10.1 oz. Clear Window and Door Caulk 1 $5.37

https://www.homedepot.com/p/GE-All-Purpose-Silicone-1-10-1-oz-Clear-Window-and-Door-Cau
100091111

Page 13 of 60
Figure 14: Silicone is used to maintain weatherproof integrity by being applied to all gaps after assembly
is completed.

2.4.2 Weather Strip - For all externally attached paneling


dsi Dortite® Sponge Rubber Weather Strip

https://dsi-dortite.com/dortite-sponges/

Description: Original Dortite® Sponges, made in the United States, are constructed of natural open-cell
sponge rubber, combined with a non-stretch backing and a very aggressive rubber-based adhesive. It
can be purchased from a local provider as described in Appendix A or via the link provided.

• Meets ASTM 1056-68 RO12


• Non-stretch
• Easy-to-use versatility
• Excellent memory to retain shape
• Long product life

Figure 15: The Dortite® weather strip being used between the interface of the frame and the polycar-
bonate window

Table 16: Specifications for dsi Dortite® Sponge Rubber Gasketing


Thickness 3/16 in.
Width 1/4 in.
Length of Rolls 25 ft. and 50 ft.
Color Black

Page 14 of 60
Table 17: Weather Strip Purchasing Information
Name Description Quantity Price
Dortite® Sponge 50 ft. roll 1 $12.50

Table 18: Weather Strip lengths needed to be cut


Quantity Length (in.) Use
2 16 horizontal side segments where AR Polycarbonate meets the frame
4 10 diagonal segments where AR Polycarboante meets the frame
2 22 long sides of base PVC panel
2 16 short sides of base PVC panel
2 12 vertical edges of access door panel
2 19 horizontal edges of access door panel

Manufacturing Needed & Application:


1. Cut the weather strip into the lengths described in Table 18
(Cut lengths are slightly longer than length required)
2. Remove the white paper to reveal the sticky side of the weather strip
3. Attach the sticky side of the weather strip to the desired location on either frame or panel
4. Cut off any excess weather strip

2.5 Internal Hardware


2.5.1 Heater
Tutco Farnam’s Silicone Rubber Heater. P.N. SFH-300-120-0100
https://farnam-custom.com/standard-products/enclosure-heaters/
silicone-rubber-enclosure-heaters

Description: When outdoor cabinets and enclosures are exposed to cold temperatures the electronics and
mechanical systems inside will take on moisture resulting in degredation and failure. Tutco-Farnam’s
silicone rubber enclosure heaters solve these problems with rapid heat-up and excellent heat transfer.
These durable products are thin, small and a breeze to install. They come with lead wires and thermal
control options.
The heater is equipped by Tutco-Farnam with an inline STAT1525 thermostat that allows the heater
to only operate when the enclosure temperature is between 32°F - 50°F.

Page 15 of 60
(a) Picture from Exploded CAD View (b) Heater placement in enclosure prototype

Figure 16: Location &Visual of Heater in enclosure.

Table 19: Tutco-Farnam Silicon Rubber Enclosure Heater Specifications


Watts 300 W
Volts 120 V
Length 10.5 in.
Height 3.72 in.
Mounting bracket included Yes

Each heater (SFH-300-120-0100) should be ordered to include the following:


• A 2 prong connector installed
(Includes a 12 in. lead cord)
• A STAT1525 thermostat implemented
(The thermostat will turn on a 32°F and turn off at 50°F)

Table 20: Tutco-Farnam Silicon Rubber Enclosure Heater Price Breakdown


Price p/ heater $85
STAT1525 thermostat, 2 prong connector $10
Total (including thermostat, prong implentation $95

Reference Appendix F for quote and order details.

Application: The heater is attached to the inside of the side panel facing opposite the side panel with
the fan cut-outs. It is attach to the inside of the upper t-slot frame via metal silicone. Reference Figure
16b for placement.

1. Apply metal silicone to the inside edge of the heater


2. Press inside edge of bracket down against t-slot firmly, so heater hangs down vertically into the
enclosure.
3. Let the metal silicone dry overnight.

The heater just needs to be plugged in and it will operate as needed.

Page 16 of 60
2.5.2 Filter Fan
Automation Direct’s Stego Filer Fan. P.N. 018210-02

https://www.automationdirect.com/adc/shopping/catalog/enclosures_-z-_
subpanels_-z-_thermal_management_-z-_lighting/enclosure_thermal_management/
filter_fans/018210-02

Description: Filter fans and grilles work together to displace hot air inside the enclosure with cooler air
from the outside. The incoming air is filtered to protect components inside the enclosure. Filter fans
are available in various DC and AC voltage ratings, in a range of airflow options. Matching grilles are
available for fans, as well as various filter grades for fans and grilles.

(a) Picture from Exploded CAD View (b) Fan mounted in enclosure prototype

Figure 17: Location & Visual of Fan in enclosure.

Table 21: Stego Filter Fan Specifications


Airflow Direction Intake
Air Flaps No
Filter Yes
NEMA Rating 12
IP Rating IP55
Operating Voltage 120 VAC
Frequency 60 Hz
Power Consumption 15 W
Current Draw 180 mA
Free Airflow 14 CFM
Airflow w/ Grill & Filter 7.1 CFM
Max. Static Pressure 54 Pa
Operating Temp. Min/Max 14°F/158°F
Avg. Noise Level 40 dB
Housing Material UL 94V-0
Color Light gray
Mounting Double-sided industrial adhesive
Mounting Depth 2.4 in.
Applcation Outdoor use
Includes Weather-proof, UV-resistance hood, optional mounting screws

All Stego Filter Fans should be ordered with a Dual Adjustable Thermostat for temperature control:

Page 17 of 60
Automation Direct’s Stego Dual Adjustable Thermostat. P.N. 011720-01

https://www.automationdirect.com/adc/shopping/catalog/enclosures_-z-_
subpanels_-z-_thermal_management_-z-_lighting/enclosure_thermal_management/
thermostats_-a-_hygrostats/011720-01

Description: Thermostats are used to regulate temperature and humidity inside an enclosure. Electronic
and mechanical models are available, with this model having adjustable setpoints to fit a wide range of
applications.

(a) Stego Dual Adjustable Thermostat


(b) Location of fan and thermostat in enclosure proto-
type

Figure 18: Location & Visual of Thermostat in enclosure.

Table 22: Stego Dual Adjustable Thermostat Specifications


IP Rating IP20
Setpoint Type Dual Adjustable
Contact 1 N.C. 32 to 140 °F
Contact 2 N.O. 32 to 140 °F
Switching Differential 12.6 °F
Switching Tolerance +/- 7 °F
Mounting 35 mm DIN rail
Application For electrical enclosure climate control

Table 23: Stego Filter Fan and Dual Adjustable Thermostat Price Breakdown*
Enclosure Fan Assembly $125
Dual Adjustable Thermostat $30.50

*When ordering the fan and thermostat from Automation Direct, be sure to order it with a 3 prong
plug from manufacturer.

Application: Assembly and application instructions are provided from the manufacturer.

2.5.3 Insulation
The insulation is R-3 square edge rigid foam board insulation sheathing and can be purchased from a
local provider as described in Appendix A or via the provided link.

Table 24: Insulation Purchasing Information

Page 18 of 60
Name Description Quantity Price
Owens Corning Foamular 1/2 in. x 4 ft. x 8 ft. 1 $14.90

https://www.homedepot.com/p/Owens-Corning-FOAMULAR-1-2-in-x-4-ft-x-8-ft-R-3-Square-Edge
100320356

Insulation will be cut to size and applied to the interior of the front and back panels.

2.5.4 Moisture Control


Dry & Dry Premium Quality Silica Gel Packets

https://dryndry.com/collections/silica-gel-desiccant/products/
copy-of-20-gram-aiwa-orange-indicating-packets-choose-size-quantity

Description: Premium quality, pure and safe silica gel without cobalt chloride. Each packet contains a
mixture of white silica gel beads and some orange indicating beads. Orange beads indicates the packet
is dry, dark green indicates the packet is saturated. Each packet is rechargable: after saturation the
packet can be dried and re-used. Packets are of special thickness and stored in resealable self-standing
high quality bags for easy storage and use. Each bad is sealed and sturdy for moisture control.

(a) Dry & Dry Silica Gel Packets with Indictors (b) Silica utilized in enclosure prototype. Can be placed
or hung anywhere.

Figure 19: Location & Visual of Silica Gel Packets in enclosure.

Table 25: Dry & Dry Silica Gel Packets Price Breakdown*
Bulk Quantity Price
6 $9.99
15 $14.99
30 $24.99
130 $89.99
400 $179.99

*Free Shipping

Page 19 of 60
2.5.5 Electronics Enclosures
The following electronics enclosures are used to store the 1. Raspberry Pi, PiJuiceHat, battery, and 2.
Arbotix-m microcontroller. They can both be purchased off of amazon. Holes will need to be drilled to
allow wiring into the enclosures, which will be specified in Assembly. Both enclosures are made of ABS
plastic.

Table 26: Electronics enclosures for inside the enclosure


Use Size Price
1. Raspberry Pi, PiJuiceHat, battery 5.9" x 3.2" x 4.45" $8.99
2. Arbotix-m Microcontroller 3.94" x 2.68" x 1.97" $9.99

They can be purchased at the following urls:


1. https://www.amazon.com/Plastic-Electronic-Junction-Enclosure-Waterproof/
dp/B01N8SLCUM?ref_=fsclp_pl_dp_7
2. https://www.amazon.com/Waterproof-Plastic-Electronic-Junction-Enclosure/
dp/B07M5SZNR9/ref=sr_1_2_sspa?keywords=electronics+enclosures&qid=1553135007&
s=gateway&sr=8-2-spons&psc=1

Figure 20: Internal components inside the enclosure prototype: Filter fan and keys, thermostat, silicone
rubber enclosure heater, WidowX, Arbotix-m microcontroller and it’s enclosure, raspberry pi and it’s
enclosures, power strip.

Page 20 of 60
2.6 Assembling the Enclosure
2.6.1 Frame and Paneling
1. Sort frame pieces into categories of length. See cut list for appropriate size. Tape measure needed
at this point since many pieces are similar sizes.
2. The most important thing to think about before assembling is sliding the appropriate amount of
t-nuts into the frame before locking them in with the L-bracket. See CAD model to determine
appropriate number of t-nuts for each 8020 aluminium extrusion.
3. Slide appropriate numbers of t-nuts, and begin by assembling the bottom part of the frame. To
lock in the L-brackets, slide 5 t-nuts into each L-bracket and then partially tighten each bolt into
the t-nuts. Lock in each bolt with a medium torque setting on a drill when the position is adequate.

4. When assembling the peak roof, use the screws attached to lock together the 120 degree angle
brackets. Tighten these as much as possible. Ensure that the aluminium lines up.
5. Slide the paneling into the frame before attaching the very top pieces of the ’cube’. The gaskets
can be put in later so do not worry about that at this point.

6. Once the cube of the frame is assembled, the 60 degree angle brackets should be attached. This
is where it was appropriate to ensure that the perfect number of t-nuts were already placed in the
t-slot frame track. Attach the 120 degree peak roof to the cube frame, and tighten all 4 bolts on
the bracket.
7. The polycarbonate should be bonded already. Before attaching the polycarbonate, add the Dor-
tite® weather gasketing to the top of the frame. The polycarbonate will push this down when
bolted and create a weatherproof seal. Attach the polycarbonate to the top of the peak roof. Make
sure to add the weatherproofing washers before bolting the polycarbonate. The easiest way to do
this part is putting the t-nuts horizontal to the ground so that gravity does not slide them around.
8. Next, attach the ribs to the mounting plate. The t-nuts will attach to the round anchor points that
pull the ribs to the outside frame. After, attach the mounting plate to the ribs. Place the t-nuts
in the appropriate position and then place the mounting plate on top of the ribs. Screw the bolts
into the t-nuts and tighten them down with a medium torque setting on the drill.
9. Attach the magnet attachments to the four corners that will be on the turbine side. These are easy
to attach, simply bolt the bracket to the t-nuts through the L-bracket. The smaller Allen screw
will be used for the bolt closest to the turbine so that it can be tightened. The brackets should be
flush with the edge of the case.
10. All edges of the access door panel shall be lined with Dortite® sponge to create the seal when the
door is screwed onto the front panel.
11. The bottom panel is the last part of the assembly. The Dortite® sponge shall be added to the
bottom of the frame and then the bottom panel presses it down to create a weatherproof seal.

2.6.2 WidowX and Camera


For WidowX Assembly:

Follow the instructions below as well as the assembly guide provided by Trossen Robotics via the url
below:
Before fastening the FR07-H101K Hinge Frame to the upper (pan) servo, and the pan servo to the
lower (yaw) servo, the motors need to be set to the correct location. From the Arduino IDE, set the yaw
motor to 420 (SetPosition(yawID,420)) and the pan servo to 1500 (SetPosition(panID,1500))

Page 21 of 60
to ensure the motor can pan both clockwise and counter clockwise. If the motor is not set correctly, the
hinge frame on the pan servo may swing into the base of the motor. Setting this "home" position in the
middle of the 180 degree turn allows the motor to move both clockwise and counterclockwise.

https://learn.trossenrobotics.com/projects/175-widowx-robot-turret-assembly-guide.
html*
*Remember, There is no need to use the bottom deck nor the mounting plate.

Attaching the camera to the WidowX:

1. The Sony Cybershot DSC-RX10 III has a mounting hole that is utilized here
2. If you are looking straight at the WidowX, the lense of the camera should be facing left
3. Using a 1/4-20 x 0.500" hex head screw, mount the camera to the FR07-H101K Hinge Frame of
the WidowX

Figure 21: The camera should be mounted onto the WidowX so it’s initial position is as shown.

Page 22 of 60
3 Software

(a) This shows a front view of the turbine with the la-
beled dimensions needed for the software. (b) This shows a side view of the turbine with the labeled
dimensions needed for the software.

Figure 22: A figure with two subfigures

Table 27: This table shows example tower parameters of the SWT-2.3-108T80.0 configuration (Boulder
turbine) that are inputted at the start of the code
Parameter Dimension
Tower Height 80 m
Blade Length 53 m
Tower Base Diameter 4.5 m
Prebend Distance 2m
Distance from Tip to Center 16.7 m

3.1 Overview
The project uses a Sony Cybershot DSC-RX10 III camera, the Trossen Robotics WidowX Robo Turret
kit with two Dynamixel MX28T servo motors, and a Raspberry Pi 3 B+. The software architecture relies
on two main hardware components: the Raspberry Pi (RPi) and the Arbotix-M microcontroller. The
RPi is the brains of the architecture, and is used to initiate the inspection process as well as interface
with the camera. The Arbotix is used to innterface with the servo motors and is Arduino compatible.
The add-on hardware components that require some minimal software that offer robustness to the system
will also be covered.
The high-level breakdown of the software is as such: inspection is remotely activated through the
RPi and prompts the user for inputs, RPi sends an initiation signal and tower parameters to the Arbotix
which runs the calculations and actuates the servo, RPi takes photo and saves to its SD card; photos are
then sent to the server via SFTP. Refer to Figure 23 for a flow diagram of the software architecture.

Page 23 of 60
Figure 23: Software overview flowchart

3.2 Arduino and Arbotix-M

Figure 24: Picture of Arbotix-M microcontroller

Page 24 of 60
The Arbotix is programmed through the Arduino IDE. It is responsible for running the calculations
needed to set up an array of step values to send to the servo motors. The two servo motors offer the two
degrees of freedom: pan and yaw. The pan motion allows the camera to "scan" the blade and the yaw
motion "tilts" the camera away from the tower in the normal direction.
The goal of the Arbotix is to set up two arrays for the pan and yaw positions. The code requires
five inputs: tower height, blade length, tower diameter, prebend distance, and distance from the vertical
centerline of the tower to the tip of the blade in the normal direction. With these parameters, all
calculations are ran, and the arrays are set up and can be sent to the servo motors. After each change in
position, the RPi will take a photo, and will continue back and forth until the entire length of the blade
has been photographed (defined mathetmatically).

3.3 Python and Raspberry Pi (RPi)

Figure 25: Picture of RPi

The RPi is essentially an inexpensive computer that has an ethernet port, several USB ports, and WiFi
capabilities. It can support Python programming, which is used to run the "master" script for this
project.
The Python script will ask the user for the five inputs, and listen for feedback from the Arbotix as
to when to take the photo.

3.4 Data Transmission


The RPi will be connected to the Herschmann switch of the Turbine via ethernet. This will allow the
Siemens technicians to remotely access the RPi via ssh. Once the ssh connection has been made with
the RPi, the script can be called, and the photos can be pulled off of the RPi via some protocol such as
SFTP, SCP, etc. The technician could also remote desktop to the RPi, and gain full visual of the RPi,
giving them access to the OS Raspbian GUI, as opposed to navigating through its terminal.

3.5 Power Management


The device requires five 120VAC 60Hz outlets for the RPi, Arbotix (servos), heater, fan, and camera.
The device will be tapped into the UPS of the turbine via an inverter to step the 230V down to the
required 120V.

3.6 Add-on Hardware


The PiJuice Hat is an add-on to the RPi which provides many different features including a RTC. Most
importantly, it offers a way to monitor the power to the RPi. In the worst case scenario, the UPS of the
turbine goes down, the RPi will lose power, which puts the SD card at risk of corruption. If the SD card
is corrupted, a technician will need to go onsite to replace it and restart the RPi. In addition, the RPi

Page 25 of 60
does not have a power switch, so if it shuts off, it will need to be physically unplugged and plugged back
in (this could possibly be remedied by a power switch circuit).
The PiJuice Hat can put the RPi to "sleep" and idle the RPi’s power consumption. In addition, it
has the ability to hook a LiPo battery (12000 mAh) to the RPi incase the turbine power goes offline,
keeping the RPi powered. The PiJuice Hat can also be hooked into a 40W solar panel which in turn can
power the LiPo battery, or power the RPi.

3.7 Wiring and Connections


3.7.1 Arbotix-M

Figure 26: Arbotix-M Ports and Regulators

The Arbotix-M has three connections that need to be made: 5V FTDI Cable, 12V SMPS power supply,
and the 3-pin Dynamixel Port. The FTDI is used for data communication between the RPi and Arbotix-
M. It is important to have the FTDI in the correct orientation (Refer to Figure 27).

Figure 27: FTDI orientation for connection

The 12V SMPS power supply plugs into the DC Black Barrel Jack. The 3-pin servo connection gives
power and signals the servo motors. There are three identical 3-pin terminals on the Arbotix board.
Plug the one cable from the servo into one of these ports.

Page 26 of 60
3.7.2 Raspberry Pi

Figure 28: Labeled Diagram of RPi

Four cables are connected to the RPi: the 5V power cable, the USB from the camera, the USB from
the FTDI cable, and the Ethernet cable. The power cable plugs into the "PWR IN" port in the bottom
left corner of Figure 28. The two USB cables plug into two of the four available USB ports (upper right
corner of Figure 28). The Ethernet cable plugs into the Ethernet switch on the bottom right corner of
Figure 28.

3.8 Camera
Two connections need to be made on the camera: the battery power adapter and the microUSB for
remote capture. The microUSB (connects camera to RPi) plugs into the appropriate port on the left
hand side of camera. The power cable plugs in like a normal battery. Make sure that the battery is
situated correctly as it can be put in the wrong way. There is a blue clip that must be flush with the
battery (you will hear a click). Refer to Figures 29 and 30 for help.

Figure 29: Location where to plug battery adapter cable into camera

Page 27 of 60
Figure 30: Location where to plug the USB into camera

3.9 Installation: Software


3.9.1 Camera
1. First setting that needs to be changed on the camera from factory settings is the power save mode.
From the factory, the power save setting will be at one minute. This would cause some problems
because you might not be able to initiate the sequence before the first picture. Therefore the power
save setting shall be set to 30 minutes. This can be done in settings->general settings->power save
settings.
2. Another thing that needs to be done on the camera before installation is setting the focus before
attaching it to the Widow-X. This can be done by setting the camera focus to the ’S’ mode on
the bottom left level of the camera. Then, point the camera at the middle of the blade and half
press the shutter button. Ensure that the focal length is set to 530 mm. This actuation should
automatically set the best focus for that distance.
3. The last setting on the camera that should be changed is the focus setting. The focus shall be set
to DF mode, which is a perfect combination of manual and auto focus. If the focus ever needs to
be changed, it can be done with the focus scroll on the lens.

3.9.2 Arbotix-M
1. To program the Arbotix-M from the Arduino IDE, the correct version of the IDE needs to be
downloaded from the Arduino website. The packages and FTDI drivers also need to be downloaded.
Follow the guide listed on Trossen Robotics website
2. The Arduino code needs to be uploaded from the Arduino IDE on the computer to the board using
the FTDI cable.
3. Once the Arduino IDE confirms "Upload Complete", the Arbotix is ready.

3.9.3 Raspberry Pi
1. Raspbian needs to be installed on the RPi which can be done through installing NOOBS. This will
require an HDMI cable, monitor, keyboard (mouse can be helpful, but not necessary)
2. SSH needs to be enabled on the RPi through the raspi-config settings to enable the data transmis-
sion
3. There are also some other packages and libraries that will be nice to have. Refer to Useful Resources:
Software>Setting up RPi

Page 28 of 60
4. The gphoto2 package needs to be installed. Refer to the Useful Resources: Software>gphoto2
Library links to install the appropriate packages.

3.10 Initiating Inspection


Assuming the blades are yawed directly over the enclosure and the turbine is in reverse rabbit ear
position.

1. Remote access the RPi terminal via SSH


2. Change directory to the Desktop (cd /Desktop) where the file is stored and call the Python
script using the bash command python3 masterPy_Rev5_SysTest.py. Right now the script
is called "masterPy_Rev5_SysTest.py", but can be changed.
3. Enter the tower parameters and hit enter.
4. Enter any character, number, keystroke, etc. and hit enter to initiate the inspection.
5. Once the process has finished (a message in the terminal will prompt the user to re-enter the
initiation character.
6. The photos will save on the SD card of the RPi and will need to be SCP or SFTP to the server.
Currently, the photos are saved to a file on the Desktop called "Inspection-" with the current date.
This can also be changed.

4 Useful Resources: Software


4.1 Setting up RPi
These video series give a great breakdown of setting up an RPi from scratch. Another option is to copy
the image of the OS on the current SD card and image the new SD card with this OS copy. That will
most likely be easiest, and the following setup process can be avoided.

• https://pythonprogramming.net/introduction-raspberry-pi-tutorials/

4.2 gphoto2 Library


This library is installed on the RPi, and gives control over the camera. It includes various useful
commands.

• Overview Video (How to Set Up): https://www.youtube.com/watch?v=1eAYxnSU2aw


• gphoto2 Main Page: http://www.gphoto.org
• gphoto2 List of Commands and Explanations: http://www.gphoto.org/doc/manual/ref-gphoto2-cli.
html

4.3 Arbotix-M and Dynamixel Servos


Some pages and resources for various sample code, how to set up Dynamixel servos, and Arbotix-M
information.

• Arbotix-M Webpage (includes spec sheet):


https://www.trossenrobotics.com/p/arbotix-robot-controller.aspx
• Dynamixel MX28T Servo Webpage (includes spec sheet):
https://www.trossenrobotics.com/dynamixel-mx-28-robot-actuator.aspx

Page 29 of 60
• Setting up the Arduino IDE for Arbotix-M Programming:
https://learn.trossenrobotics.com/projects/182-arbotix-getting-started-guide-arduin
html
• Servo Commands and How To with Arbotix:
http://biorobots.case.edu/wp-content/uploads/2014/12/IntroductiontoDynamixelMotorCon
pdf

• Dynamixel Property Address Table:


http://biorobots.case.edu/wp-content/uploads/2014/12/IntroductiontoDynamixelMotorCon
pdf

4.4 Serial Communication


Using the FTDI to USB cable, Serial communication between the Arbotix and RPi is used. The pyserial
library in Python is needed on the RPi.

• pyserial Library Information:


https://pythonhosted.org/pyserial/

4.5 Data Transmission


Some information about data transmission and getting the photos to the server.

• Setting up Static IP Address:


https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wi
74428#74428

4.6 PiJuice Hat Setup


The GitHub page is a great resource for walkthroughs on how to set up and install the Python packages
on the RPi.

• General Information:
https://learn.pi-supply.com/make/pijuice-quick-start-guide-faq/#software-installati
• PiJuice Software Walkthroughs:
https://github.com/PiSupply/PiJuice/blob/master/Software/README.md

Page 30 of 60
5 Appendices
A Local Providers
A.1 80/20 Provider
Fiero Fluid Power, inc.
5280 Ward Rd, Arvada, CO 80002
(303) 431-3600

A.2 Hardware Providers


McGuckin Hardware
2525 Arapahoe Ave, Boulder, CO 80302
(303) 443-1822

The Home Depot Company


Customer Service: 1 (800) 466-3337

B Hardware Selection Analysis


B.1 Camera

Figure 1A: Camera Analysis

Page 31 of 60
B.2 Pan & Tilt Device

Figure 2A: Pan & Tilt Device Analysis

B.3 Window Material

Figure 3A: Window Material Analysis

Page 32 of 60
B.4 Heater

Figure 4A: Heater Analysis

B.5 Fan

Figure 5A: Fan Analysis

Page 33 of 60
C CAD Drawings for 80/20

Figure 6A: AR Polycarbonate Window Drawing. Quantity: 2.

Figure 7A: PVC Panel Access Door Drawing. Quantity: 1.

Page 34 of 60
Figure 8A: PVC Front Panel Drawing. Quantity: 1.

Figure 9A: PVC Back Panel Drawing. Quantity: 1.

Page 35 of 60
Figure 10A: PVC Mounting Panel Drawing. Quantity: 1.

Figure 11A: PVC Side Panel Drawing. Quantity: 1.

Page 36 of 60
Figure 12A: PVC Side Panel for Fan Installation Drawing. Quantity: 1.

Figure 13A: PVC Base Panel Drawing. Quantity: 1.

Page 37 of 60
Figure 14A: PVC Peak Panel Drawing. Quantity: 2.

Page 38 of 60
D Pricing Quotes, Drawings, and BOM from 80/20
D.1 Hardware & Frame

Figure 15A: BOM & Pricing for all 80/20 Framing, Fastening Hardware, and Gaskets.

Page 39 of 60
D.2 Paneling
Lead time on all paneling is 9-13 days without shipping.

*Pricing on quote reflects discount

Figure 16A: Quote for Paneling and Manufacturing from 80/20.

Page 40 of 60
Figure 17A: AR Polycarbonate Panel Quote. Quantity: 2.

Page 41 of 60
Figure 18A: Panel Access Door Quote. Quantity: 1.

Page 42 of 60
Figure 19A: PVC Front Panel Quote. Quantity: 1.

Page 43 of 60
Figure 20A: PVC Back Panel Quote. Quantity: 1.

Page 44 of 60
Figure 21A: PVC Mounting Panel Quote. Quantity: 1.

Page 45 of 60
Figure 22A: PVC Side Panel Quote. Quantity: 1.

Page 46 of 60
Figure 23A: PVC Side Panel for Fan Installation Quote. Quantity: 1.

Page 47 of 60
Figure 24A: PVC Base Panel Quote. Quantity: 1.

Page 48 of 60
Figure 25A: PVC Peak Panel Quote. Quantity: 2.

Page 49 of 60
E AR Polycarbonate Spec Sheets

Figure 26A: Page 1 of AR Poylcarbonate Spec Sheet.


Spec Sheet is from local plastic provider. AR Polycarbonate specs are the same for 80/20 AR Polycar-
bonate

Page 50 of 60
Figure 27A: Page 2 of AR Poylcarbonate Spec Sheet.
Spec Sheet is from local plastic provider. AR Polycarbonate specs are the same for 80/20 AR Polycar-
bonate

Page 51 of 60
F Tutco-Farnam Quote for Heater & Attachments

Figure 28A: Pricing quote from Tutco-Farnam for silicone rubber enclosure heater.

G Arduino Code

1 #include <ax12.h>
2 #include <BioloidController.h>
3 #include <stdlib.h>
4 #include <math.h>
5
6 // Dynamixel servo stuff
7 BioloidController bioloid = BioloidController(1000000);
8
9
10 // ...
-------------------------------------------------------------------------------
11 // For pan, if number increases, turns counter-clockwise, if decreases, CW
12 // pan "home" position is 600
13 // For yaw, if number increases turn counter-clockwise, if decreases CW ...
(looking from top)
14 // yaw "home" is 420
15

Page 52 of 60
16 // For YAW, mapping is as follows (numbers are which way lens is ...
pointing, from top view):
17
18 // TURBINE
19 // 4096 (0) 3072
20
21 // 420(home) center
22
23 // 1023 2048
24 // ACCESS DOOR
25
26 // For PAN, mapping is as follows (numbers are which way lens is ...
pointing, viewing from access door):
27
28 // 1500 (up)
29 // 2500 (home,left)
30 // ...
-------------------------------------------------------------------------------
31
32
33
34 // Initial Variables for setup()
35 int pan = 2; // Pan servo ID
36 int yaw = 1; // Yaw servo ID
37 int yawHomePos = 600;
38 int panHomePos = 2500;
39 float towerHeight;
40 float BL;
41 float towerDiam ; // Tower Diameter
42 float prebendDist; // distance out in normal direction from blade ...
centerline
43 float distCTO;
44 boolean checkInput[5] = {0,0,0,0,0}; // If Arbotix has received ...
parameter from RPi
45 float inputs[5];
46 boolean checkRcvData = 0;
47 int jj = 0;
48
49 void setup(){
50 Serial.begin(9600);
51 delay(50);
52 SetPosition(pan,panHomePos); // Points camera straight up towards hub
53 SetPosition(yaw,yawHomePos); // Turns camera to center position
54 delay(100);
55
56 Serial.println("Input turbine parameters: ");
57 while((jj < 5) && checkRcvData == 0){ // If values have not been ...
inputted, get them now
58 while(int(inputs[jj]) == 0){ // While the value is still empty, keep ...
reading
59 inputs[jj] = Serial.parseFloat();
60 delay(50);

Page 53 of 60
61 }
62 Serial.print("Arbotix received a value of: \t");
63 Serial.println(inputs[jj]);
64 jj++;
65 }
66
67 Serial.println("Received all the values");
68 towerHeight = inputs[0];
69 BL = inputs[1];
70 towerDiam = inputs[2];
71 prebendDist = inputs[3];
72 distCTO = inputs[4];
73
74 checkRcvData = 1; // Start inspection
75 }
76
77 // Counters and Conditionals
78 int count = 1; // Count how many times goes through panAngle loop, ...
this is number of photos needed
79 boolean checkInsp = 0; // Don't want test to keep running over and ...
over, stop after scanning left and right
80 boolean ranCalc = 0; // Check if calculations have been ran for ...
panAngle and yawStep
81 int initRcvd = 0; // For reading data from Pi
82 boolean checkReady = 0; // Check if arbotix is ready for inspection
83
84 // ...
-------------------------------------------------------------------------------------
85 // ...
-------------------------------------------------------------------------------------
86 void loop(){
87 // ...
=================================================================================
88 // Const Variables
89 float pi = 3.14159;
90 float overlap = 0.25;
91 float rootBladeAngle = pi/3;
92 float sensorSize = 0.00889; // Sensor Size of camera
93 float FL = 0.206; // Focal length of camera
94 float mountHeight = 2; // Mounting height of device
95
96 // Calculate initial constants
97 float totHorizDist = BL * sin(rootBladeAngle); // Total horiz dist ...
from tower to tip
98 float totHeight = BL * cos(rootBladeAngle); // Height from tip to hub
99 float maxAngle = atan(totHorizDist / (towerHeight - totHeight)); // ...
Max pan angled
100 float distCamRoot = towerHeight - mountHeight; // Distance from ...
device to Root (H2C)
101 float distCenterTip = totHorizDist - towerDiam/2; // Distance from ...
tower wall to tip [m] =

Page 54 of 60
102 float WD1 = (sqrt( pow(totHorizDist,2) + pow(totHeight,2) )); // ...
Working distance f(SS)
103 float WD [] = {WD1};
104 float maxYaw = atan( (distCTO - (towerDiam/2) + prebendDist) / ...
totHorizDist) * float(180/pi); // Max yaw angle
105
106 // Initialize Variables
107 float FOV = 0; // Field of View
108 float sumFOV = 0; // Sum of Field of Views
109 float panAngle[30]; // pan angle array, initialize with max angle
110 float tempPan[30];
111 int yawAngleParam[30]; // map degree to [0,4096]
112 int panAngleParam[30]; // map degree to [0,2048]
113 float newHorizDist = totHorizDist; // new horiz dist after scanning ...
blade (similar to totHorizDist)
114 float newHeight; // new height from tip to hub after scanning blade ...
(similar to totHeight)
115 float numPhoto; // count how many photos
116 float yawStep; // yaw angle step size
117 float yawAngle; // current yaw angle
118
119 // This is read by RPi, and is exactly 54 char long, if change, ...
change the 54 on python side
120 if(checkRcvData == 1){ // If Arbotix has received all the input data ...
from Pi
121 if(checkReady == 0){
122 Serial.println("Arbotix is waiting on input to initialize ...
inspection");
123 checkReady = 1;
124 }
125 delay(500);
126 // ...
================================================================================
127
128
129 // Get value from RPi to initialize inspection
130 while(Serial.available() > 0){ // Check if inspection has been ...
called by getting a value from RPi
131 initRcvd = Serial.read();
132 //Serial.print(initRcvd);
133 delay(50);
134 }
135 delay(500);
136
137 // Start inspection
138 // ...
===============================================================================
139 if(initRcvd != 0){ // If the initiation input has been received
140 Serial.println("Inspection has been initialized.");
141 while(ranCalc == 0){// if panAngle and yawStep calculations have ...
not been ran
142

Page 55 of 60
143 // Build Pan Angle Array (values change as FOV and FL change)
144 Serial.println("Running calculations...");
145 while(BL-FOV*overlap - sumFOV*(1-overlap) > 0){ // The value ...
in parentheses is how much of the blade has been scanned
146 newHorizDist = (BL-sumFOV*(1-overlap))*sin(rootBladeAngle);
147 newHeight = sqrt( pow( (BL-sumFOV*(1-overlap)),2) - ...
pow(newHorizDist,2) );
148 WD[count] = sqrt( pow(newHorizDist,2) + pow( (distCamRoot - ...
newHeight),2) );
149 FOV = (sensorSize*WD[count]) / FL;
150 sumFOV = sumFOV + FOV;
151 panAngle[count-1] = ...
atan(float(newHorizDist)/float((distCamRoot - ...
newHeight))) * float(180/pi);
152 tempPan[count-1] = panAngle[count-1];
153 count++;
154 }
155
156 numPhoto = count-1; // count number of photos, -1 to account for ...
last count++
157
158 // THIS WILL NEED TO BE CHANGED IF YAW STEP IS TOO BIG
159 yawStep = float( maxYaw / numPhoto ); // Calculate Yaw angle ...
[param]
160
161 ranCalc = 1; // don't need to run calculations again
162 Serial.println("Calculations finished.\n");
163 Serial.println("Arbotix needs an input to start inspection ...
process");
164 delay(50);
165 }
166
167 // Actuate Servos
168 // ...
---------------------------------------------------------------------------------
169 Serial.println("The camera is starting the pan and scan process\n");
170 // Scan LEFT BLADE (facing turbine)
171 // ...
_________________________________________________________________________
172 Serial.println("Scanning the left blade...");
173 Serial.println("-----------------------");
174 yawAngle = maxYaw; // Starting point for camera
175
176
177
178 for(int ii=0; ii<numPhoto; ii++){
179 Serial.print("Photo number: ");
180 Serial.println(ii+1);
181
182 // Actuate PAN servo
183 panAngleParam[ii] = int( panHomePos - ((2048/180) * (90 - ...
tempPan[ii]) ));

Page 56 of 60
184 Serial.print("The pan angle is: ");
185 Serial.print(panAngleParam[ii]); // Print to screen the current ...
pan angle [deg]
186 Serial.print('\t');
187 SetPosition(pan,panAngleParam[ii]); // change position of pan ...
servo
188
189 // Actuate YAW servo
190 yawAngleParam[ii] = int(yawAngle * 4096/360) + yawHomePos;
191 SetPosition(yaw,yawAngleParam[ii]); // change position of yaw ...
servo
192 yawAngle = yawAngle - yawStep;
193 Serial.print("The yaw angle is: ");
194 Serial.println(yawAngleParam[ii]); // print to screen the ...
current yaw angle [deg]
195 delay(4000); // Waits for camera to stop oscillating
196 Serial.println(1); // Let RPi know that servos have moved so it ...
can take photo
197 delay(2000); // Wait for Pi to download photo
198 }
199
200
201 // Scan the RIGHT BLADE (when facting turbine)
202 // ...
_________________________________________________________________________
203 Serial.println("\nScanning right blade...");
204 Serial.println("--------------------");
205 yawAngle = maxYaw; // Starting point for camera
206 for(int ii=0; ii<numPhoto; ii++){
207 Serial.print("Photo number: ");
208 Serial.println(ii+1);
209 // Actuate PAN servo
210 panAngleParam[ii] = int( panHomePos - ((2048/180) * (90 - ...
tempPan[ii]) ));
211 Serial.print("The pan angle is: ");
212 Serial.print(panAngleParam[ii]);
213 Serial.print('\t');
214 SetPosition(pan,panAngleParam[ii]); // change position of pan ...
servo
215
216 // Actuate YAW servo
217 yawAngleParam[ii] = int(yawAngle * 4096/360) + yawHomePos + ...
2*(1023-(maxYaw*(2048/180))); // Get to other blade
218 SetPosition(yaw,yawAngleParam[ii]); // change position of yaw ...
servo
219 yawAngle = yawAngle + yawStep;
220 Serial.print("The yaw angle is: ");
221 Serial.println(yawAngleParam[ii]);
222 delay(4000); // Waits for camera to stop oscillating
223 Serial.println(1); // Let Pi know servo moved
224 delay(2000); // Wait for Pi to download photo
225 }

Page 57 of 60
226 Serial.println();
227 Serial.println("Inspection process finished.");
228 checkReady = 0; // To ask for initialization input again after ...
first scan
229 }
230 }
231 // ---------------------------------------------------------------
232 initRcvd = 0; // Reset incoming data variable
233
234 // Bring back to home after inspection
235 SetPosition(pan,panHomePos);
236 SetPosition(yaw,yawHomePos);
237 }

H Python Code

# Senior Design Project Siemens Gamesa Camera Inspection Device


# Master Script

# Packages
import math
import numpy as np
import serial
import array
import struct
import time
from time import sleep
from datetime import datetime
from sh import gphoto2 as gp
import signal, os, subprocess
import os # Used for renaming pictures
from subprocess import call

# kill gphoto2 process that starts whenever we connect to camera


def killgphoto2Process():
p = subprocess.Popen(['ps','-A'], stdout=subprocess.PIPE)
out,err = p.communicate()

#Search for the line that has process we want to kil


for line in out.splitlines():
if b'gvfsd-gphoto2' in line:
# Kill the process
pid = int(line.split(None,1)[0])
os.kill(pid,signal.SIGKILL)

# Command to label each photo with time and date


shot_date = datetime.now().strftime("%m-%d-%Y")
shot_time = datetime.now().strftime("%H:%M:%S")

# Photo label string: have technician save input turbine name, and label
picID = "Photo" + shot_time

# Create command to capture


capture = ["--capture-image-and-download"," --filename","picID"]
savePic = ["--filename=picID"]

# Create command to download photo to Pi


downloadCommand = ["--get-all-files"]

Page 58 of 60
# Generate a folder with date of pic and picID label
folder_name = shot_date + shot_time
save_location = "Inpection" + folder_name # Save location

# Create function to create folder


def createSaveFolder():
try:
os.makedirs(save_location)
except:
print("A directory with this name already exists. Directory was changed to ...
existing one.")
os.chdir(save_location)

# Serial communication: connect to USB from FTDI on Arbotix


try:
port = "/dev/ttyUSB0"
ser = serial.Serial(port,9600)
time.sleep(3) # Give time for ARbotix to connect to serial
except:
port = "/dev/ttyUSB1"
ser = serial.Serial(port,9600)
time.sleep(3) # Give time for ARbotix to connect to serial
ser.flushInput()

time.sleep(2)

killgphoto2Process() # Housekeeping

if True:
readMessage = ser.readline().decode("utf-8")
print(readMessage)
for ii in range(0,5):
if ii == 0:
param = input("Enter the Tower Height in [m]: ")
ser.write(bytes(param,'utf8'))
confMessage = ser.readline().decode("utf-8")
print(confMessage)
if ii == 1:
param = input("Enter the Blade Length in [m]: ")
ser.write(bytes(param,'utf8'))
confMessage = ser.readline().decode("utf-8")
print(confMessage)
if ii == 2:
param = input("Enter the Tower Diameter in [m]: ")
ser.write(bytes(param,'utf8'))
confMessage = ser.readline().decode("utf-8")
print(confMessage)
if ii == 3:
param = input("Enter the Prebend Distance in [m]: ")
ser.write(bytes(param,'utf8'))
confMessage = ser.readline().decode("utf-8")
print(confMessage)
if ii ==4:
param = input("Enter the Distance from Centerline of tower to blade tip in ...
[m]: ")
ser.write(bytes(param,'utf8'))
confMessage = ser.readline().decode("utf-8")
print(confMessage)

while True:
readData = ser.readline().decode("utf-8") # "Input a single value to initiate..."
print(readData)
#print(len(readData)) # For debugging
if(len(readData) == 54): # this banks on the fact that first message is: Arbotix is ...
waiting on input to initialize inspection
initiate = input("Input a single value to initiate inspection process: ")

Page 59 of 60
ser.write(bytes(initiate,'utf8'))
while(initiate != []):
readData = ser.readline().decode("utf-8")
if(len(readData)>3 & len(readData)<54):# Don't print the confirmation "1" from ...
Arbotix
print(readData)
if(len(readData) == 3): # If RPi received "1" back from Arbotix, take photo
# Capture image, download to Pi, delete from camera, and rename file on Pi
call(["gphoto2","--capture-image-and-download","--filename", ...
"/home/pi/Desktop/Inspection-%Y%m%d/Photo-%H%M%S.jpg"])
ser.write(bytes(1))

Page 60 of 60

S-ar putea să vă placă și