I will be writing an algorithm for a robot to navigate beacons. I am using
·the Propeller to write the code and was seeking some advice on whether to use loops or repeats, and the general structure. Here's my
flowchart, and also an image of the beacon
course:
Comments
Now the program checks outputs from 6 sensors on Left side of bot: Left input. The 3-10kHz filtered sensors have outputs connected, so 1 pin will read this value via adc(call it S1). The other 3-20kHz sensors will have the same wiring, and the adc value(call it S2) will be subtracted with S1
>>Left beacons will be 10kHz, Right beacons are 20kHz
-Left input = S1 - S2; 'this will see if a left beacon is closer than a right beacon.
The Right side of the bot has the same 6 sensors with the same filters.
-Right input = S2 - S1; 'this will see if a right beacon is closer than a left beacon.
--LEft input > right input;· Now the program will determine if the bot needs to avoid a left beacon. If left>right, the bot needs to turn a little right. If right>left, the bot needs to turn a little left.
This is first draft flowchart, and I know I am missing a few other 'decision' blocks: but I plan on adding a block: (left or right input > max_input_value): make bot back up and change approach angle. And also I need to add a beginning procedure so the bot will roam forward if no beacons are detected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 4/19/2009 7:34:02 PM GMT