Hi,
I am currently working on developing my first bot which I expect to function as a humble obstacle-dodging machine. I call it "dodging" because unlike the machines which avoid an obstacle and change their course altogether, I wish it to keep to (return to) the straight path it was set on even after it encounters an obstacle.
I have two 38 kHz IR proximity sensor modules (purchased ready-made as I didn't wish to have any hassles the first time around) but I guess I'll employ just one in the bot this time around.
I have visualized a circular form factor for the chassis with the sensor and the breadboard circuit mounted. The wheels are run by two 300 rpm DC Geared motors.
I have the following algorithm in mind (and partially implemented) for the purpose:
#1. Check (front) sensor status.
#2. If High (No obstacle) move straight ahead.
#3. If Low (Obstacle Detected):
3a. Generate pseudo-random boolean value for switching
3b. Use an if-else/Switch statement to turn right/left.
3c. Delay for some time (to be determined by trial and error?)
3d. Call the complementary motor function i.e. if turned left earlier then turn right.
3e. Delay for the same time.
//Assuming bot comes back on course
#4. Resume free run.
I am currently working on the C code for the same but figured any additional inputs/criticisms/suggestions would be great before I get my hands dirty!
Thanks!
I am currently working on developing my first bot which I expect to function as a humble obstacle-dodging machine. I call it "dodging" because unlike the machines which avoid an obstacle and change their course altogether, I wish it to keep to (return to) the straight path it was set on even after it encounters an obstacle.
I have two 38 kHz IR proximity sensor modules (purchased ready-made as I didn't wish to have any hassles the first time around) but I guess I'll employ just one in the bot this time around.
I have visualized a circular form factor for the chassis with the sensor and the breadboard circuit mounted. The wheels are run by two 300 rpm DC Geared motors.
I have the following algorithm in mind (and partially implemented) for the purpose:
#1. Check (front) sensor status.
#2. If High (No obstacle) move straight ahead.
#3. If Low (Obstacle Detected):
3a. Generate pseudo-random boolean value for switching
3b. Use an if-else/Switch statement to turn right/left.
3c. Delay for some time (to be determined by trial and error?)
3d. Call the complementary motor function i.e. if turned left earlier then turn right.
3e. Delay for the same time.
//Assuming bot comes back on course
#4. Resume free run.
I am currently working on the C code for the same but figured any additional inputs/criticisms/suggestions would be great before I get my hands dirty!
Thanks!