Programming

Ok Everything works, we had to switch the motors to get them to drive forward, it does the countdown (5 Seconds) and then starts turning, so far so good whats next!!

Ok like I said before. If the bot is acting ok at this point you can put back in place the remark. This will enable the program to go into the behavior part of the code. So look where the apostrophe is in front of the “goto start” and delete it.

Keep the bot supported so the wheels don’t touch the ground. Now the program is looking at the SLD parts on pins 3 and 4. With black under them they should output a low. When you turn the bot on it will count down from 5 with beeps. then it will turn the motors on for forward motion. While this is happening place a white paper under the left sensor. The motors should reverse for a short time. The time is changeable by changing the value in backup. Making the number larger will increase the backup time/distance. Lowering the number will make it backup a shorter distance. Then the bot should rotate in place in the right or CW direction. Again the distance the bot turns is changeable with the turn variable.

backup = 30
turn = 40

If the bot does not turn the right way then swap the left and right values in the left_detect section.

If the right sensor detects the white line the opposite of above should happen.

If both sensors detect the white line it will behave as if the left sensor detected it. You can create a different behavior for both sensors if you want.

You might be done… or very close!

Ok we are rewired and reprogrammed it seems to chase its tail a little but so far so good whats next, I loose all my helpers friday till Wednesday we would like to set it on the floor and teast it aginst a box or two!!

Like I said, it should be done. I do not know what you mean by chase its tail. Perhaps you could make a video of the thing so I can see if it is acting right or not. You can also adjust the servo pulse values to make it go slower for the testing stage. Have you studied the code? It should be very easy to figure out how the different servo pulse values effect the speed of the bot…

All right!! I have it programmed with the above code, I have the sabertooth set with #1 and #6 in the down position according to the sabertooth quickreference the motors are plugged into left on 14 and right on 15 now I need to hook up left and right rear line detectors and left and right sharpe IR op detectors and a Ping dector ?

I’m reluctant to try and discuss adding sensors when I’m not sure the bot is working properly at this point.

Does it stay inside the ring when running this code?

Is it still chasing it’s tail?

Were you able to do the video?

I feel we have not been communicating very effectively so far. :frowning: Please slow down, use some punctuation, tell me what it is doing.

I understand, It just seem to not go to its right? when you place a white card under the left detector it rotates the motor backwards for 4 or 5 seconds, but the right motor when the sencer is activated only rotates 4 or 5 revolutions? I will test it on a black floor with white lines and video it for you, and we can see what happens, The boys learned alot about circuts today !!

Thank you , you are a world of help

I received the video you emailed me. It was too close up to actually see what is going on. Can’t you just place the bot onto the ring so we can see what it does? That is the ultimate goal eh? :wink:

I am goint to have to build the ring, It is not set up anywhere for practice I will see what I can do! I am getting worried?

John

We have done everything we can do short of a real world test. You wave a sheet of paper under the sensor and the bot reacts. Now you MUST see if it will work in real life on the floor. Have the competition organizers published what the ring is spec’d at? Size, materials, paint, etc?

I’m not sure of you are worried… But yes man the next step is to see if the sensors can react to the real world scenario, the ring.

facebook.com/video/video.php?v=409567569457

This is the best I can do for a video I did find out theat the light sencer was plugged with dirt twords the end Let me know what you think!!

John

Dude, no one can view that without a facebook account. Can’t you just youtube it like normal?

youtube.com/watch?v=Tz9c_uZKnyA

Sorry new to the game!!

Anyone else suspect the oil slick and non-uniform floor coloring has anything to do with the problem?

The video is almost useful, but not really, and here’s why.

A useful video would have the robot at stop, you should here the 5 second countdown beeps. Then the robot should move. That would give us is a first hand view of the starting process. I could for example know if the robot ever did go forward… Do you have a description of the real ring the bots will be using? Where is the competition and do they have a website? The bot appears to be “seeing” the line everywhere. The ground is not dark enough. The concrete appears to be shiny in places and that could be one of the reasons. The distance the line sensor is from the ground will effect how well it works. The angle the sensor is to the ground is important as well. It’s best to align the sensor to 45° to the ground. So, the bot is “seeing” the line too often. The line sensor has an LED on it to help you set it up properly. In fact you can move the bot manually and look at the LED to see for yourself how it is detecting the line when it is not there.

Yea the oil slick plugged a sencer I have sence cleaned and retested, its ok!! and it does go backwards, it should charge forward, it is being taken care of as I type, Its kinda hard to clear out a working repair shop to do this work, We are going to weigh-in tonite at 4:45 and then back to programming, we cannot tilt the sencer due to the size limitations 24x24x24 inches, it does respond to the sencers and changes direction thats what the tests were for. I concider it passing. now we need the update the code to turn on both rear line sencers 2 IR Sharpe sencers and a ping))) dead center in the front. test and tune is Thursday, eliminations are Friday and Finals are Saturday I am out of time.

John

Also the 5 second count down works perfect we tested it tonite at the weigh in it passed everything with flying colors and she is a slim 113.5 lbs

youtube.com/watch?v=HvAqTzUI_3Y
next Video

Kinda looks like you’ve got a wheel that doesn’t turn very good.

Alan KM6VV

I seen that before we checked it and it all turns free, We switched the drives and it does the same thing going the other way, we are hopeing new coding will take care of it, I call it moon walking!! Thanks for the input, the boys are working really hard on it!
Lfab John