Author Topic: Help to find ideas to program a shortcuts for a $50 robot  (Read 2183 times)

0 Members and 1 Guest are viewing this topic.

Offline JackalsTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
Help to find ideas to program a shortcuts for a $50 robot
« on: January 02, 2014, 06:43:06 AM »
So here I go  :), I'm not an accurate english master, more a practitioner, feel alright to tell me if you don't understand a part, It will be my pleasure to explain in other terms.

A little bit about me:  i'm studying in a cursus ( college/ university) of electrical engineering and industrial computer.

This year a large number of hours have been dedicated to a project. This project is really similar to the " $50 ROBOT " the main idea is that with 50 €, the chasis ,motivation, a bit of guidance we have to make a robot which can follow white lines.


Nowadays the project grow up, the mechanic is ok, the electronic part too : one circuit to detect coumpound with leds and photoresistor Bpw77, an other one to regulate the two motors, a third part with battery.

Interconnexion and a microcontroler have been added for the last part of the project : the race bettween groups and then robots.
All the differences , and so chances of victory, will be in the way of programming the microcontroller ;)   



If you can see this  ::) , THERE is my Question for you, i can bring up any begin of idea, I can't figured out how to turn on " raccourcie " = shortcuts, one clue there , just before the shortcut there a 90° angle that have been placed to help the robot to understand the shortcut.

Even before an integration in C++ code i try to understand how the robot can work to achieve a race more efficently by taking shortcuts.


 

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Help to find ideas to program a shortcuts for a $50 robot
« Reply #1 on: January 02, 2014, 11:05:23 AM »
The robot needs to be able to detect line crossings in addition to just where the straight-away line is.
Then, if the track is known, you need to program it to count the number of crossings it sees, and make the right call for left/right turning at the right time.
Typically, you'll want two additional line sensors on the front right/left to detect upcoming crossings, so the best approach is at least five sensors; one for "on the line," one each for "left of line" and "right of line," and finally one each for "left crossing line" and "right crossing line."
For better gradation in the control circuitry, you could use more sensors and program a stronger response the more "off" the robot detects its course.

Offline JackalsTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
Re: Help to find ideas to program a shortcuts for a $50 robot
« Reply #2 on: January 04, 2014, 07:31:00 AM »
Thanks for the response jwatte.

In fact on the robot there are 6 sensors.

Four in the middle of the circuits spaced by 1/4 inch (0,6mm) and two on the left and right corner spaced with the middle part by 1/2 inch distance (also 1.2mm in my country).
I'll try to upload some photos/pictures, could be nice  ;D


Maybe with the right call, like you said,
I'm a beginner and I don't really know where is the part i can make the robot do this trick.
Teacher give us a C++ code with part to complete.
So there two main sections we can modify: task and actions, we got also timer available but all the section to detect  line crossings have to be done.
I will upload these code Tuesday, so you can see more clearly what I'm talking about.

If anyone is good at C++ or have an idea where I put this detection it be welcome to help me :) 
I'm thinking that aiming in the detection of sensor the more on left it's a good beginning.
By the by if actually this sensor detect two lines on left or right in less than 100 ms, then the robot have to turn and jackpot  ;)
 

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Help to find ideas to program a shortcuts for a $50 robot
« Reply #3 on: January 04, 2014, 03:13:53 PM »
You need to learn how to use global variables to carry state between iterations of your control loop.

This will let you "count" the number of line crossings you have seen on each side, where in turn, a line crossing is a corner sensor first "seeing" a line, and then "not seeing" a line.

 


Get Your Ad Here