|
1 |
| -## laser scanner |
| 1 | +## Motors |
2 | 2 |
|
3 | 3 | ### Directory Contents
|
4 | 4 |
|
5 |
| -This directory contains number of simple sketches for testing the laser scanner. |
| 5 | +This directory contains a number of simple sketches for testing the main motors of the robot. |
6 | 6 |
|
7 |
| -#### laser_moto_test_1 |
| 7 | +#### OmniTestSoftware_1 |
8 | 8 |
|
9 |
| -This sketch checks that the DC motor & encoder are working. The function `encoderIS()` handles the encoder interrupts. There should be 3360 per revolution of the laser scanner. The sketch also contains code to drive the DC motor at different speeds. |
| 9 | +This sketch drives the two motors connected to one Uno and effectively moves the Robot diagonally. *Note that we keep the speed of motor `M1` fixed and vary the speed of motor `M2`*. |
10 | 10 |
|
11 |
| -#### laser_moto_test_2 |
| 11 | +This sketch attempts to make each encoder yield the same number of ticks over time and hopefully move in a straight line. We reset the encoder counts every `delayTime` milliseconds, but we keep a running total, i.e., we adjust speed based on the counts for the last period |
12 | 12 |
|
13 |
| -This is essentially the same as `laser_moto_test_1` except that it stops after 15 revolution of the laser scanner. |
| 13 | +**This does not work and the total counts diverge**. |
14 | 14 |
|
15 |
| -#### laser-single-distance |
| 15 | +#### OmniTestSoftware_2 |
16 | 16 |
|
17 |
| -This example is supplied by the manufacturer. |
| 17 | +This sketch is similar to `OmniTestSoftware_1`, but we adjust the motor speeds based on the total number of ticks and not just the number in each period. |
18 | 18 |
|
19 |
| -#### laser-continuous-distance |
| 19 | +**This works much better than `OmniTestSoftware_1`**. |
20 | 20 |
|
21 |
| -This example is supplied by the manufacturer. |
| 21 | +#### OmniTestSoftware_2 |
22 | 22 |
|
23 |
| -#### laser-continuous-distance-interrupt |
24 |
| - |
25 |
| -This is a modification of `laser-continuous-distance` that uses interrupts to determine when a new reading has arrived. |
26 |
| - |
27 |
| -#### combined_test_1 |
28 |
| - |
29 |
| -This is a combined test of the laser and DC motor, i.e., the head rotates and laser fires continuously. **This sketch needs more work.** |
30 |
| - |
31 |
| -### Issues |
32 |
| - |
33 |
| -1. It is essential that we handle every interrupt generated by the encoder. **How can we assure that this happens even when other code is executing? For example, does the `Serial` library interfere with interrupts, e.g., by disabling them at any stage?** |
34 |
| -1. Using `laser_moto_test_2` it is clear that the head does not finish in same position as it started. **Why?** |
35 |
| -1. The `combined_test_1` sketch does not perform very well; it behaviour is some what erratic. This probably due time issues and lost interrupts. |
36 |
| -1. **If the inaccuracies in the rotation the the scanner and the laser range finding are significant what can we do in software to improve accuracy? ** |
| 23 | +Again, this sketch is similar to `OmniTestSoftware_1`, but its main use is to check that we are using the correct encoders, i.e., if we switch one motor on, then that motor's encoder should have a non-zero count. *Note that the other motor should have a zero count and if it does not, then there is something wrong with the hardware*. |
0 commit comments