Programming

Here it is in a nutshell. I am an advisor on a NRC team here in my home town, I have a 125 lb sumo bot really all the mecanics are done. I have no clue how to program the BotBoard II Board and parts, I have 4 line detectors, 2 IR detectors, and 1 Ping range detector, Like I said its a big Sumo, 17 foot ring black boottom with white stripe, Is there a program I can buy, steal, barrow,to get this thing working, I am about a week away from programming this beast, the kids and I are still building and installing a few things :question:Pictured are my drive units about 300ftlbs :arrow_right: Just a side bar here I am donating all the money, materials, all my time, My shop equipment useage and employees to these kids hopefully we can be a contender this year.

There are several online instructions and manuals that should give you the information required to program your choice of microcontroller. If you have the basic stamp 2, there is a free 500 page Syntax manual available for download which is worth getting and reading.

Thank you sir!! Where would one find such a book to download? Do you have the link?

John

Here you go. 504 pages! I would suggest saving it on a thumb drive and then take it to kinkos or some place that offers printing services. I also recomend printing on both sides of the paper to cut down the thickness of the manual. I don’t like reading for hours at a computer, so I rather have a printed copy, then I can kick back on the couch while I read. If sitting at the PC reading doesn’t bother you, then you’re all set!

Read this first:

parallax.com/Portals/0/Downl … amv2_2.pdf

Then read the 504 page monster:

parallax.com/Portals/0/Downl … M-v2.2.pdf

This will give you a really good understanding of how to write code for microcontrollers and build ultra simple circuits to interface to the stamp. When you’re ready, then you can upgrade to the Basic Atom Pro which has some differences, and requires a slight learning curve. I started out on the basic stamp 2 and I highly recommend it as a starting point for any raw newbie. Many people with programming skills already under their belt, are able to jump right in and start using the Basic Atom Pro but I think you would be better off starting on a BS2 which has the most documented resources than any other microcontroller out there.

Good documentation is a good point!

Parallax has a sumo kit:

parallax.com/Store/Robots/RollingRobots/tabid/128/ProductID/319/List/1/Default.aspx?SortField=ProductName,ProductName

Good place to start!

I think Parallax also has a Boebot, which has a LOT of documentation.

Alan KM6VV

For a sumo this is not a great platform… You have plenty of weight and powerful motors, but very little ground contact, i.e. no traction. You will need to make some sort of custom tracks that can attach or connect to the back side of the standard belts. You want a much lower hardness for the traction part of the belt system than the back side of the belts.

How fast is the thing?

You might not belive this but it will push a 460 ford engine block across my shop floor. their is method to my maddness, I have seen the single belt styles flip off might take a little more to pop 3 off, Like i said this is new to me and the boys and they are learning alot, and the time they spend here with us and not running the streets makes a difference

Make SParks
John LFab

I have no problem believing it will do some awesome looking, yet really unquantified pushing demonstrations. I was merely stating this is an area that could be improved. Sliding a heavy object is one thing. But pushing a heavy object that also has traction and is likely trying to push your bot at the same time is another matter. I do commend you on your willingness to help keep kids off the street.

I do like that idea, I have an electric hand truck we use to hall equipment that weight about the same and has a big traction motor on it, after the battle cage is done we just might have to have a pushing contest to see if it slips or not, sounds like a great teaching moment on pysics and some laws of motion.

John Lfab

Alright you have one week to do this so let’s stop fooling around.

You have the Atom Pro on a Bot Board II.

This tutorial tells you how to program the micro. You have to start somewhere…
lynxmotion.com/images/html/build157.htm

A microcontroller can’t turn motors on with 0-5vdc and only 20mA, so the motor controller does the work. What sort of motor controller are you using? Please we need model number and links to it’s docs if available.

Assuming the motor controller takes servo pulses, here is a program we used for our sumos.

[code]'Program name: basumo01.bas for Basic Atom Pro.
'This version uses the pulsout function to control the motors.
'This is for a sumo with two line detectors, but no opponent detectors.

left_motor var word
right_motor var word
backup var byte
turn var byte
edge_detect var byte
aa var byte

input p2
input p3
low 14 'Left motor-control channel
low 15 'Right motor-control channel
backup = 20 'this affects how far the robot backs up from the line.
turn = 20 'this affects how far the robot turns after backing.

sound 9, [100\880, 100\988, 100\1046, 100\1175] 'three quick ascending beeps.

for aa=1 to 5 'Beep at the end of each of the 5 seconds in the delay.
pause 900
sound 9, [100\880]
next

start: 'Go forward at max speed.
left_motor = 2000
right_motor = 4000
gosub servo_pulses

edge_detect = (ina&%1100) 'Look at the 1st I/O nibble and mask off bit 1 and 2.
if edge_detect = %0100 then left_detect 'Look for left edge detector.
if edge_detect = %1000 then right_detect 'Look for right edge detector.
if edge_detect = %1100 then left_detect 'Look for both left and right.
goto start

left_detect: 'This is where the pulses are setup for the
for aa=1 to backup 'Scorpion motor controller for left detect.
left_motor = 4000
right_motor = 2000
gosub servo_pulses
next
for aa=1 to turn
left_motor = 4000
right_motor = 4000
gosub servo_pulses
next
goto start

right_detect: 'This is where the pulses are setup for the
for aa=1 to backup 'Scorpion motor controller for right detect.
left_motor = 4000
right_motor = 2000
gosub servo_pulses
next
for aa=1 to turn
left_motor = 2000
right_motor = 2000
gosub servo_pulses
next
goto start

servo_pulses: 'This is where the pulses are actually generated.
pulsout 14, left_motor '2000 = forward, 4000 = reverse, 3000 = stop
pulsout 15, right_motor '4000 = forward, 2000 = reverse, 3000 = stop
pause 20
return[/code]

Ok So far so good put the code in and it reads should be putting it down in the floor for tests next week, Thenks John

Ok I need inspiration, I have a H controler that runs 24 volt motors, it has a Joystick I want to tap into the joystick control with my botboardII with a Micropro28, it runs on 5volts and I have isolated the X and Y axis, Ideas and codes? I guess what I am asking is. I know that the Board can be controled by a joystick. Now can it control a joystick ? or say become one.?

I asked you for information on the motor controller. Apparently you aren’t using a motor controller and want to hack a wheel chair controller by injecting an analog voltage into the board replacing the the signals from the joystick. Personally I wouldn’t do it this way, but it can be done. I would get a real robotics H-Bridge that can accept servo style pulses. If you can find the model number from the motors we can find the current rating and then find a suitable controller. If you insist on using the existing controller you will have to build a digital to analog converter. The Atom Pro has a PWM command that can be used with a simple RC filter, (please see the Atom Pro programming manual) that will create the analog voltages from variables in your program.

You might could replace the joystick with two rotary pots and rotate them with servos, or use servos to mechanically operate the joystick.

Zoomy, you’re a genius. :stuck_out_tongue:

I would still prefer the pulse method, but this is probably their best bet as it doesn’t cost much and it’s mostly mechanical in nature. :wink:

There will be minor some mechanical issues to be overcome, but with only a week for a solution it may be time to get out the craft sticks, jumbo paperclips, hotglue gun, ect.

These are great Ideas but I am running out of money, I am funding this out of pocket (The School is broke) I am going to try to a few tricks, Two more wires and reset a idler and she is on the floor. Were can I get this board and how much?

Ok these are the specks on my wheelchair drive motors:
Voltage (Volts): 24
Power (Watts): 250
Current (Amps): 10.4166666667
Resistance (Ohms): 2.304
So they way i figure it I need 2 SyRen 10/ SyRen 20 motor driver? My reasoning is that with both motors together they pull about 19 to 20 amps under a load, and the Sabertooth 2x10 motor driver is only rated for 18amps under a load for a short time with the 2 SyRen 10/ SyRen 20 it doubles my avalable draw? and the botboard and pro will control both of them without a problem?? am I getting this? and the wheelchair company will not under any condition give out their information on the controlers (Propriatiary)?

I think this idea with your limited time/budget is worth investigating further…

You know I actually put that rig together, and it worked but it made the system even slower and the code was very tempermental, so I think i am going to have a class on motor controlers, The big show is moved back to April 15 to 17 so i got a little breathing room