Submitted version of the thesis - Airlab, the Artificial Intelligence ...
Submitted version of the thesis - Airlab, the Artificial Intelligence ...
Submitted version of the thesis - Airlab, the Artificial Intelligence ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
4.3. PWM Control 47<br />
acollision, such as entrance <strong>of</strong> <strong>the</strong>wheels to a gap in <strong>the</strong>floor, sincewe don’t<br />
have a feedback on <strong>the</strong> motors we cannot determine whe<strong>the</strong>r <strong>the</strong> motors are<br />
turning.<br />
The motors are controlled by PWM generated from <strong>the</strong> microcontroller.<br />
To drive motors we used a PWM signal and varied <strong>the</strong> duty cycle to act as<br />
a throttle: 100% duty cycle = full speed, 0% duty cycle = coast, 50% duty<br />
cycle = half speed, etc. After some testing we realized that <strong>the</strong> percentage<br />
<strong>of</strong> <strong>the</strong> duty cycle and <strong>the</strong> speed are not changing with <strong>the</strong> same ratio (e.g.<br />
50% <strong>of</strong> <strong>the</strong> duty cycle does not correspond <strong>the</strong> half speed). Also <strong>the</strong>re is a<br />
minimum percentage <strong>of</strong> <strong>the</strong> duty cycle which <strong>the</strong> wheels start turning, and<br />
a maximum percentage <strong>of</strong> <strong>the</strong> duty cycle at which <strong>the</strong> speed remains as full<br />
speed after that. The minimum PWM value to start <strong>the</strong> motion is % 45 <strong>of</strong><br />
<strong>the</strong> duty cycle and <strong>the</strong> speed set to full speed after exceeding <strong>the</strong> % 90 <strong>of</strong> <strong>the</strong><br />
duty cycle which is <strong>the</strong> maximum PWM that can be applied. Since <strong>the</strong>re is<br />
a non-linear increase between <strong>the</strong> ratio <strong>of</strong> rotation <strong>of</strong> <strong>the</strong> motors and applied<br />
PWM ra<strong>the</strong>r than a linear one, <strong>the</strong> speed changes are not distinguishable.<br />
In o<strong>the</strong>r words, <strong>the</strong> range <strong>of</strong> PWM signal that enables movement is very<br />
narrow and <strong>the</strong> difference between <strong>the</strong> minimum speed and maximum speed<br />
is not very apparent.<br />
The script that is calculating <strong>the</strong> motor contributions according to <strong>the</strong><br />
target position is not taking into account <strong>the</strong> motor’s maximum or minimum<br />
speed. The script can return a motor contribution with 4000 mm/s or<br />
3 mm/s which is cannot be performed physically by <strong>the</strong> motors. After some<br />
experiments, to limit <strong>the</strong> script that calculates <strong>the</strong> motor contributions, we<br />
decided to bound <strong>the</strong> PWM signal value to be applied to <strong>the</strong> motors. The<br />
maximum PWM value defined for a motor is 2.5 meters/second and <strong>the</strong><br />
minimum PWM value is around 300 millimeters/second. Using both <strong>the</strong><br />
limits coming <strong>the</strong> physical characteristic <strong>of</strong> motor, and <strong>the</strong> PWM-rotation<br />
limitations, we implemented a map that transforms <strong>the</strong> motor contribution<br />
calculated by <strong>the</strong> script into a PWM signal. To do so, all <strong>the</strong> speeds between<br />
2500 mm/s and 300 mm/s should be mapped to PWM signals between 45%<br />
and 90% <strong>of</strong> duty cycle. Mapping 300 mm/s to <strong>the</strong> 45% and 2500 mm/s<br />
to 90% did not resulted as expected since reflecting speed changes is not<br />
possible.<br />
In order to express most <strong>of</strong> <strong>the</strong> speeds, we decided to tune <strong>the</strong> PWM<br />
sent to motors. Main idea is to boundto speeds in a dynamically changeable<br />
manner. We introduced, a fuzzy-like behavior that is based on <strong>the</strong> robot’s