Is there anyway of controlling the BB2+Basic atom using serial commands from another controller. I want to control the flow of the program generated by powerpod using a microcontroller connected to the serial port of the BB2.
Is there a specific command set that can be used that will permit this control?
The units I will be using are:
Powerpod configured in serial control
BB2 with basic atom 28 loaded with basic program from PowerPod
Do you want to do this to control the gait in real time? I’m not sure how large the code generated by PowerPod is, but it seems this would be better done right on the Basic Atom itself. What will you expect to gain by controlling the Basic Atom from another microcontroller?
There is no existing protocol or command set that provides for this at this time. You would have to write your own protocol. I’ve set this up using Microchip PICs and text commands sent from another PIC over a serial port, but not with the Basic Atom. I have been tempted to try this sort of thing out though.
If I understand you, you want to send commands to a BB2 and SSC32. You’ve generated a “serial control” vers. of the Atom BASIC program.
Thus you’re good to go with the “Serial CP” windows program. Good. What you’ll want to write is a program for your micro that will generate the 7-byte strings much like the joystick:
The last one is for the “circle” command, for example. The first byte is a checksum, the next two bytes encode bits for all the buttons, and the last four bytes are 2 pairs of 2 bytes each, for the X and Y joysticks.
I use the Docklight terminal program to send these commands to my 'bot for testing, you can do the same from your micro.
I’m assuming you want to add the micro to add a higher layer of control to you 'bot. Not a bad idea. Might be easier then trying to add in your intended control to an “atonomous” version of the Atom BASIC code generated by PowerPod.
Here’s a set of commands I was working with, and their byte codings. Once you’ve got enough code in your micro to do a “Hello World”, you can send these BINARY strings instead to your BB2.
You will have to program the Basic Atom to understand what the hex codes mean and what to do for each one of them, such as which sequence to run, etc.
Getting your robot to walk should be easy using PowerPod. You will still have to do some programing beyond what PowerPod does for you to make all this work. I suggest just tinkering with PowerPod and having your robot run with the sequences it generates for awhile. Once you have your gait the way you want it, you can start working on the Atmel to Basic Atom communication.
Yes, that’s it. Just send the strings. You’ll have to go over the various PS2 type commands (I listed some samples), and send them. Study the PS2 commands in the instructions on the CH3.
The Joystick moves you forward and allows turns, various L buttons set the height as I recall. No specific speed to specify, you’ll have to experiment with the range of the parameters. I specified some to get you started. They are “center off” (80h), and go + and - from there.
It’s already programmed! The PowerPod will generate the program for the ABB. It will interpret the serial commands I have been describing. NO code to write for the ABB processor!
The PowerPod does all the ABB code needed (serial mode). You’re basically simulating a PS2 controller with your new processor, and you simply send the strings that activate the various actions you want. I believe the ABB sends an “ACK” back to your processor. You can wait for this reply before sending the next command.
Start off with a random walk, change the direction when an obsticle is encountered with a sensor. Leave all the driving to the ABB!
byte1 SLCT JOYL JOYR STRT UP RGHT DOWN LEFT
byte2 L2 R2 L1 R1 /\ O X ]
byte3 Right Joy 0x00 = Left 0xFF = Right
byte4 Right Joy 0x00 = Up 0xFF = Down
byte5 Left Joy 0x00 = Left 0xFF = Right
byte6 Left Joy 0x00 = Up 0xFF = Down[/code]
One more question.
Do the serial outputs of my micro require a MAX232 to interface to the serial inputs (S_IN, S_OUT) of the BB2 or can I connect it directly to the BB2 serial port ?
I’m trying to make my bot autonomous using the powerpod generated serial code. The bot is controlled using an external micro (atmega128) via the SER_IN port of the the BA pro28.
I have managed to send command like "&H80 ; &HFF ; &H7F ; &H80 ; &H80 ; &H80 ; &H80 'press square button (fly posture) " or
&H40 ; &HFF ; &HBF ; &H80 ; &H80 ; &H80 ; &H80 'press cross button (attack posture).
These work great and the bot responds without any problems. What I’m trying to do know is make the bot respond to navigation commands to make it go forward, backward or to turn.
The serial data for the “fly” and “attack” commands were straight forward but I’m having a hard time as to what serial data should I send for the movement (navigation) commands.
Does anyone care to explain as to how I would go about doing this ?
It has been awhile since I looked at this code, but I believe that this serial packet is emulating the PS2 controller input. So the last 4 values which you are currently sending H80s to control the walking and rotating. I believe the values are:
0 = Checksum of bytes 1 through 6
1 = first byte of button values - bit goes low of button pressed.
2 = second byte of buttons...
3 = y Direction for moving - 80 hex is zero
4 = X direction for moving
5 = Rotation
6 = Height
So try changing the values of bytes 3 and 4. The value 80 hex is the center point which implies 0 dont move. The values 81-FF will go one direction as the values get farther from 80 will go faster. The values 79-0 will go the opposit direction again the farther from 80 will go faster…
Byte 5 is the rotation value. Again the value of 80hex is zero and will not rotate. Like the move values the farther from 80 in each direction will rotate faster and one way will rotate clockwise the other will rotate counter clockwise.
Again remember to calculate your checksum in byte 0…
Kurte’s given you the essence of it. Try sending some X and Y values as I’ve suggested, and watch the results! The moves are simply a matter of encoding the two bytes.
Do I have to continuously send the data so it can move or is this a one-shot deal (send data once-it moves in set direction until it receives other data)?
if CheckSum <> DualShock(0) then
Sound 9,[50\2000]
NoData
DualShock(1) = $FF
DualShock(2) = $FF
for Index = 3 to 6
DualShock(Index) = $80
next
endif[/code]
You will notice that each time it does a query and it does not get any information, it sets the two button bytes to FFh (nothing pressed) and the other four bytes to 80h. Obviously you could change this code to do anything you want, like if I received a move operation continue with the last movement. You might want to put some form of timeout in, so that if you lose connection, it does not walk foreever…
I have my laptop connected to the serial on my Mini-abb board. The atom has the powerpod serial pc control program on it as mentioned.
As i want to simulate a “triangle button press” by sending a data string from my pc terminal window, what exactly do i need to send as triangle as posted above is
(Triangle) button
10 FF EF 80 80 80 80 0D
But when i send that i dont get any response, do i need to send some “standby to Rx command” etc???