Hi Everybody,
I am taking an intro to engineering class and need some programming help with a project. The goal is to build a device/robot that will drive a 25 foot distance stop and shoot at a target 15 feet away. I have a: Botboard II with Atom pro 28
2 lynxmotion.com/p-448-quadrat … cable.aspx
2 lynxmotion.com/p-653-gear-he … shaft.aspx
1 lynxmotion.com/p-563-saberto … oller.aspx
4 3" wheels w/ a solid axle on the back
1 lynxmotion.com/p-293-hs-645m … servo.aspx (to release firing mechanism)
The problem is that I suck at programming. Well I have actually never programmed anything. I don’t know Basic Atom and would like some help figuring out where to start or how to go about this project. I don’t have to worry about shooting (that is the responsibility of someone else in the group). I just need to be able to put it in the same spot 3 times and fire.
Any help or info would be greatly appreciated, Thanks Noram
There’s no easy way around it - you’ll need to learn how to program. Download Basic Micro Studio and start reading through the tutorials:
downloads.basicmicro.com/downloa … 0-0-18.exe
There’s some sample code available too, and we offer some additional help here:
lynxmotion.com/s-4-electroni … .aspx#micr
I think, from a not programmer, the best way would be to use a Arduino micro controller.
There are a lot of info on the net to get you starting no ?
Hi, Noram, welcome to the forum.
There are many friendly people here who are very glad to be helpful. However, they tend to be most helpful to people who work the hardest for themselves and are less willing to take over the entire job. You didn’t ask anyone to do your job for you (some do), so you’re off to a good start.
Both CBenson and DiaLFonZo are right in what they said, but they are discussing two different boards and programming languages. If you are free to make all your own choices, I too would recommend the Arduino board and its language.
LONG WINDED ALERT!
But, if I am reading properly between the lines of your request, you are under constraints that limit your choices. It might help us understand better if you could describe your constraints more fully:
- Is the device strictly autonomous, or guided by a human operator under remote control?
- Does the device always start from exactly the same position and orientation relative to the target, or is it set down randomly relative to the target? (Will sensors be required to tell device its position and to find the target?)
- Has the gun been selected or must it be designed?
- Is the gun mounted rigidly on the platform, or can it be aimed independently, or is it a combination of both?
You are part of a group with at least one other person responsible for programming a different part of the overall project. Also you have a partial bill of materials (BOM) which includes a specific microcontroller and chip.
From these I presume:
- The BOM was dictated as part of the project, and you are not free to select a different board/language.
- The whole group is supposed to program just this single board and not add auxilliary boards.
- You will program two functions: locomotion and navigation. (If device and target always start in same positions, your quadrature encoders should get you there. If not you will depend on sensor input.)
- You may also be partly or fully responsible for aiming.
- Someone else will program two gun functions: loading and firing.
- They may also be partly or fully resonsible for aiming.
- Other possible group functions:
– Leader/coordinator
– Designer - lay out plan of platform and gun - specify remaining BOM
– Builder
– Sensor selector/programmer (if needed).
END LONG WINDED ALERT.
So you’re stuck with programming the Atom Pro 28. Describe to yourself what process(es) you are responsible for.
Break the processes down into sub-processes and the subprocesses into the smallest individual steps. When you can write each step as a sentence, you have most of your program laid out. The rest is just program syntax.
All the LynxMotion robot kit listings in the store have links to sample codes. You can download these for FREE and find all kinds of useful code snippets that will help you build useful code to program each device.
Collaborate with your group mates to learn coding and stay on the same page for the project.
Good luck!
Thanks to everybody for the input. These are actually parts that I have purchased myself. I plan on going into robotics but this my first class where I get to build something like this. I have been looking at buying the botboard for a while now and this class just gave me the excuse to get it. I would love to learn everything that there is to know about it. I have read through the syntax manual twice. I was just wondering if anybody may have some tips or know of a good book that may go into more detail.
I thought that using the encodes would be a good way to go because I know that they are a 30:1 ratio for full rotation, 400 for each ration in the encoder and being used with 3" wheels (simple math). That would give me pretty accurate location. But, I am have a hard time finding an in depth descriptions and how to use them in a program to tell the robot to stop at a given distance.
I plan on machining the body myself (I’m a machinist but G-code it way different from BASIC Atom). To align with the target I will be putting a laser on the front that can be adjusted for accuracy and yes the vehicle will be staring from the same point for all three attempts and has to be self-navigating (no R/C).
Oh, I also forgot to mention that the fire mechanism will be adjustable. We are allowed to to touch and reset anything we need to before pressing the button to send it off.
Encoders are often directly connected to the output or rear shaft of a gear motor. Let’s take for example teh more difficult of the two where the encoder is on the rear shaft. Let’s make up some specs:
of encoder counts per revolution: 100
Gear ratio of the motor: 20:1
Radius of the wheel connected to the gear motor: 1 inches
We’ll assume 2WD and motors / wheels on either side are identical.
To pick up an count from the encoder, you need to connect the output to a digital pin and count how many times the pin goes high and low.
If the encoder (mounted on the rear shaft) picks up 100 counts / pulses, it means the rear shaft has rotated once, and the output shaft after the gear down has rotated 1/20th of a revolution = 0.05 .
To get the distance traveled, you need to know the circumference of the wheel, which is 2piR = 23.14151 = 6.28"
Therefore when the output shaft has rotated one complete revolution, the wheel will have moved 6.28 inches.
If the shaft has rotated 1/20 of a rotation, the wheel will have moved 6.28" / 20 = 0.314"
This assumes that there is no slip between the wheel and the surface (which of course in reality will happen).
How do I properly connect the encoder to the botboard II? I am having trouble with this do to the Output A and B connectors. Does only one have have to be connected to get a reading or do both? Do I connect them on the same row of pins that I am using for power? Do I use the logic voltage or the direct 5v for that pin group that I have them connected to? I looked at how they have the IR sensors connected in the tutorial but they only have the standard 3 wire connectors.
Once you understand the principle of encoders, you should be good for connections. The encoder tutorial can be found here:
lynxmotion.com/images/html/build095.htm
There should be four wires:
Red = +5vdc
Black = Ground
Green = Output A
Yellow = Output B
The “outputs” should each be connected to digital I/O pins. You can either connect the 5V to the 5V line or to a digital pin and set it to HIGH. GND to GND.