Today I am going to be talking about some design work I've been doing for Ardie. If you recall, I recently discussed testing two new sensors for Ardie that I would be using for his eyes here. Since the tests went well, my next step was to determine where and how I wanted to mount those sensors on Ardie. In order to do that, I put together some schematics and Matlab code. Laying out the geometry of the sensors in the schematics allowed me to derive the mathematical relationships between where I mounted the senors, and what the field of view (FOV) of the sensors in front of Ardie would be. I could then use this math in Matlab code to vary the sensor mounting locations to determine which positions gave Ardie the optimal viewing field.
Please note, all materials for this project can be found in my dropbox account here.
Describing the Sensor Geometry
For this design, I decided to mount the sensors with a beta angle of ~7 degrees. The sensors have a FOV angle (gamma) of 10 degrees, which is the maximum value of beta that I could use. However, such a design would result in the two fields never intersecting and, thus, an infinite deadzone would exist directly in front of Ardie. A beta angle of seven degrees gives me an intersection some distance off of Ardie's front bumper, but also allows a little bit of FOV margin in case Ardie intersects any strangely shaped objects in his path that don't return the ultrasonic ping signal directly back to the source.
One of the disadvantages of this design decision, however, is that there will be a FOV deadzone out in front of Ardie, as well as at the right and left corners due to the conical nature of the senor fields. The front deadzone will resemble a tall triangle and will exist in the area between the two sensor FOV's before they intersect. So long as nothing gets dropped directly in front of Ardie, this deadzone should be allowable as the intersection of the two FOV's at some distance (h_d) off of Ardie's front bumper will allow Ardie to maneuver around objects before they enter this deadzone.
The corner deadzones could pose a problem however.
Nonetheless, these deadzones became the primary drivers in my design. By describing the height of the central deadzone off of Ardie's front bumper (h_d), as well as the width from Ardie's centerline to the inner edge of each FOV (w_d), and the width from the FOV outer edge to the edge of Ardie's frame (w_side), I could determine just how large, and therefore dangerous, each sensor deadzone could be.
Calculating the Height Intercept (h_int)
relationship between h_int, w_b, beta, and gamma.
To analyze this geometry properly, I drew a "zoomed in" version of the diagram posted above. This is shown as Figure 2. In order to determine h_int, I described the horizontal distance from Ardie's centerline to a single sensor mounting location as w_b (width to sensor B). Furthermore, I named the angle between Ardie's central normal vector (depicted in dotted black) and the sensor's inner FOV line (depicted in dotted green) eta (looks like a crooked '3' at the top of the diagram). Using basic trig, we can see that:
tan(eta) = w_b / h_int
If we describe eta in terms of gamma and beta, we can fully describe h_int based on known design parameters. In order to do this, we need to develop a few more angles on Figure 2. Note that theta is the angle between the sensor FOV center line (solid green) and the horizontal reference. Psi is the angle between the inner edge of the sensor FOV (dotted green) and the horizontal reference. Phi is the angle between the inner edge of the sensor FOV and the vertical normal. Mu is the compliment to Psi. While these are depicted (lightly) in Figure 2, it may help to refer to the original design documents for reference. Knowing these angles, we can describe eta in terms of gamma and beta as follows:
theta = 90 - beta
phi = gamma - beta by defintion
psi = theta + phi + beta by definition
(90 - beta) + (gamma - beta) + beta = psi
90 + gamma - beta = psi
mu = 180 - psi by definition
mu = 180 - (90 + gamma - beta)
mu = 90 - gamma - beta
since mu and eta are in a right triangle defined by h_int, w_b, and the centerline:
eta = 90 - mu
eta = 90 - (90 - gamma + beta)
eta = gamma - beta
And we finally arrive at the conclusion that:
tan(eta) = tan(gamma - beta) = w_b / h_int so
h_int = w_b / (gamma - beta)
Calculating Inner FOV Border (w_d)
a triangle very similar to the triangle completed
by w_b (marked in the lower left of the picture).
w_d = (h_int - h_b) * tan(gamma - beta) = h_d * tan(gamma - beta)
Calculating Outer FOV Border (w_side)
triangles necessary for design.
Figure 4 depicts the entire FOV triangle of sensor B denoted by the two thin, black, solid lines, and leftmost, thin, canted, dashed black line. There are also two widths called out in Figure 4: w_delta, and w_delta_2. Figure 5 elaborates on this geometry a little more, showing exactly what w_delta_2 corresponds to, while also defining two other widths: w_edge, and w_f, such that w_edge = w_delta_2 + w_f.
Futher inspection of both figures shows that w_delta corresponds to the horizontal distance between the inner edge FOV line and the FOV center line (two thin, black, solid lines in Figure 4). Meanwhile, w_delta_2 and w_f must be summed in order to equate the horizontal distance between the FOV center line and the outer FOV edge line (solid blue and dashed blue lines in Figure 5). Knowing this, we can determine that w_side corresponds to the distance between the outer edge FOV line (dashed blue in Figure 5) and Ardie's outer edge. Therefore, w_side exists in a corner deadzone and, by definition, is equal to:
w_side = (w_ardie / 2) - (w_d + w_delta + w_delta_2 + w_f)
... where w_ardie = Ardie's total width (7.8 cm). It is divided by two because we are talking about one half of Ardie.
w_delta_2 = h_b * tan (gamma)
w_f = a * sin(beta) * tan(gamma - beta)
w_edge = h_b * tan(gamma) * ( tan(beta) * tan(gamma + beta) + 1)
w_side = (w_ardie / 2) - (w_d + w_delta + w_edge)
The source code for this program can be found in my dropbox here. The outputs from the program corresponding to the design I selected can be found here.
Furthermore, this geometrical math will be useful when writing the control laws for Ardie that will govern the use of these sensors.
All in all, the project was fun. However, while applied mathematics can be interesting, it isn't nearly as fun as actually buidling something. So my next robotics blog should involve some tinkering and building, rather than all of this theoretical simulation stuff. Until then,
Good Luck, and Good Hacking!
Brady C. Jackson