First Program
ToddH
Posts: 34
Greetings - I got a SumoBot for Christmas. I was able to build it with no issues. I connected a serial cable to it and was able to download the sample programs no problems.
Here is were the novice comes out.
I want to create a simple program that will move my bot 2 feet forward at full speed, turn 90 degrees to the left and repeat. Basically moving in a "square" fashion. Sounds simple huh?
Well, I can't figure out how to say "move 2 feet". When I send the RobotForward command it just moved an inch or so. Do I need to throw that command in a loop for say 24 times? When I do this, it move in a very labored fashion - as if the motor is only operating at 10% power. Its also very herky-jerky -not smooth. The same thing happens when I send the RobotLeft command. It just moves left a few degrees. When I put that command in a loop - I get the same herky-jerky movement and again the motor labors as if it in on 10% power.
The sample programs that are on the BS2 chip work fine - very smooth - full power - no issues.
Can someone point this novice in the right direction?
Thanks!
Here is were the novice comes out.
I want to create a simple program that will move my bot 2 feet forward at full speed, turn 90 degrees to the left and repeat. Basically moving in a "square" fashion. Sounds simple huh?
Well, I can't figure out how to say "move 2 feet". When I send the RobotForward command it just moved an inch or so. Do I need to throw that command in a loop for say 24 times? When I do this, it move in a very labored fashion - as if the motor is only operating at 10% power. Its also very herky-jerky -not smooth. The same thing happens when I send the RobotLeft command. It just moves left a few degrees. When I put that command in a loop - I get the same herky-jerky movement and again the motor labors as if it in on 10% power.
The sample programs that are on the BS2 chip work fine - very smooth - full power - no issues.
Can someone point this novice in the right direction?
Thanks!
Comments
Since you say you use the 'RobotForward' command (a Tab SumoBot command) I'll assume it's the Tab Sumobot.
The Tab Sumobot puts a 16C505 PIC co-processor along with a programmable OEM BS2 on the circuit-board. You code the BS2 to issue the 'RobotForward' command -- and it sends messages to the co-processor to go forward. I believe the co-processor does each command for 200 mSec, so if you did:
MyLoop:
GOSUB SendCommand
PAUSE 200
GOSUB SendCommand
PAUSE 200
GOTO MyLoop
hopefully it would go forward continuously.
Now, you may have to do some experiments with speed settings, and number of repeats of the command, to find the set that will get you 2 feet.
Note also the 'built-in' behaviors belong to the 16C505, which has no trouble at all doing things smoothly. Getting the BS2 to talk to it but not too often may be the problem here.