EasyManua.ls Logo

Parallax Boe-Bot - Page 293

Parallax Boe-Bot
360 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 8: Robot Control with Distance Detection · Page 279
= 2 – 4
Output adjust = error
×
K
p
= –2
×
35
= – 70
Right servo output = Output adjust + Center pulse width
= – 70 + 750
= 680
By making some substitutions, the three equations above can be reduced to this one,
which will give you the same result.
Right servo output = (Right distance set point – Measured right distance)
×
Kp
+ Center pulse width
By substituting the values from the example, we can see that the equation still works:
= ((2 – 4)
×
35) + 750
= 680
The left servo and IR pair have a similar algorithm shown in Figure 8-5. The difference
is that Kp is –35 instead of +35. Assuming the same measured value at the right IR pair,
the output adjust results is a pulse width of 820. Here is the equation and calculations for
this block diagram:
Left servo output = (Left distance set point – Measured left distance)
×
Kp
+ Center pulse width
= ((2 – 4)
×
–35) + 750
= 820
The result of this control loop is a pulse width that makes the left servo turn about ¾ of
full speed counterclockwise. This is also a forward pulse for the left wheel. The idea of
feedback is that the system’s output is re-sampled, by the shadow Boe-Bot taking another
distance measurement. Then the control loop repeats itself again and again and
again…roughly 40 times per second.

Table of Contents

Other manuals for Parallax Boe-Bot