Serial command set for controlling BB2 with powerpod program

I have seen in the power pod manual that the BB2 can be programmed with a powerpod program that is set for serial port control. I have searched for a command set that will permit me to do just that but cannot seem to find anything.
So the question is, what commands and in what format does the BB2 wait for, when the powerpod program that it is running is set for serial control, it order to control the program flow and eventually the bot?

I know Laurent put together an example C program or something. I will find out later today where the information is.

As I’ve posted previously, here’s the sequences of bytes that need to be sent to the Atom BASIC program.

L1 tile floor
04 FF FB 80 80 80 80 0D

(start) Knee Shift
08 F7 FF 80 80 80 80 0D

(Triangle) button
10 FF EF 80 80 80 80 0D

L2 default
01 FF FE 80 80 80 80 0D

(Circle) button
20 FF DF 80 80 80 80 0D

(Square) Button
80 FF 7F 80 80 80 80 0D

(Cross) Button
40 FF BF 80 80 80 80 0D

R2 Body Low
02 FF FD 80 80 80 80 0D

(select) Lock Legs
01 FE FF 80 80 80 80 0D

R1 tall grass
08 FF F7 80 80 80 80 0D

L3 Cycle Button
02 FD FF 00 00 00 00 0D

UP Button
10 EF FF 80 80 80 80 0D

Down Button
40 BF FF 80 80 80 80 0D

Right Button
20 DF FF 80 80 80 80 0D

Left Button
80 7F FF 80 80 80 80 0D

height down
E8 FF FF 80 80 80 68 0D

Y Speed - 84
A8 FF FF 28 80 80 80 0D

steer right
20 FF FF 80 80 A0 80 0D

steer left
E7 FF F8 80 80 60 80 0D

height up
15 FF FF 80 80 80 95 0D

X Speed - 84
A8 FF FF 80 28 80 80 0D

Y Speed + 36
28 FF FF A8 80 80 80 0D

Neutral 80
00 FF FF 80 80 80 80 0D

R3 (horn) Button
04 FB FF 80 80 80 80 0D

X Speed + 36
28 FF FF 80 A8 80 80 0D

XY speed +
00 FF FF A8 A8 80 80 0D

XY Speed -
00 FF FF 28 28 80 80 0D

XY speed +-
80 FF FF A8 28 80 80 0D

XY Speed -+
80 FF FF 28 A8 80 80 0D

X Speed max
7C FF FF 80 FC 80 80 0D

Y Speed max
7C FF FF FC 80 80 80 0D

Further, the Serial CP H3 program source code can be examined for additional information. It’s in the powerpod tools C++ directory.

Alan KM6VV

It’s installed when you install PowerPod. You can find the example C++ code and information here: C:\Program Files\PowerPod\Tools

Hope this helps…

Thanks for pointing this folder out!!

I am connected to my miniABB/atom with a serial to usb conv and the triangle button works fine and movement.

I notice when the robot is standing i get

Incoming Outgoing Checksum

rd 255,255,128,128,128,128 0

then it changes to

                         255,0,128,128,128,128             255

when triangle button is pressed.

If i use the terminal window on the basic ide program, what do i type to simulate the triangle button now i know the sequences above as i have tried to put the code above in directly to no avail

Thanks

The commands the Atom receives are hex values.When you type in the terminal screen you are sending ascii values. I do not know if there is a way to send hex values from the terminal screen.

I believe that Alan described what values need to be for the different movements.

The first byte in his table is the checksum value, which I believe you show as the last value.

In your description, you went from logically no buttons pressed, to the following buttons pressed:
(L1, L2, R1, R2, triangle, circle, cross, and square). Note: Alans values are in hex and yours is decimal. So I think the values for just the triangle button would in your format would be (note I put checksum first):

16, 255, 239, 128, 128, 128, 128, <cr= 13>

Note: if you want to enter it into a terminal window, I think you may be able to use the ALT key input (not sure). It has been a long long time since I did much ALT keypad stuff. I believe for each character you hold down the alt key and enter the decimal value of the character in the numeric keypad and release the alt key. So in this example the first value of 16 you would enter by:
ALT Down, 1, 6, Alt up…

You might try a free download of Docklight, it will allow you to compose strings using HEX, ASCII or DECIMAL, and assign them to function keys.

docklight.de

Alan KM6VV

Yes i agree with everything you have wrote, i have already downloaded docklight but i was told due to RTS/DTR controls this program will not work as easy as say the terminal window on the ATOM IDE.

What are the settings for the RTS/DTR options as i have sent the code you suggested in hex, dec and ASCII formats to no avail on the robot

Thanks

Flow control off will probably do it. The Atom board is not using handshaking as far as I know!

Alan KM6VV

for docklight to work, the DTR pin must be unconnected. It will not work even if you have flow control set to OFF

Yes,

I don’t believe I have either of the two handshake line pairs connected.

Alan KM6VV

Well i had flow control off so im still stuck

Is there an initialize sequence i need to send as in docklight i am sending the command

255 0 128 128 128 128 255

which is what the triangle button sends and i have seen this on the powerpod serial demo program.

Once i have cracked how to send it, i can then think of writing my own program

Am i being naive thinking all i need is to send the above to simulate a triangle button press??

As I have wrote earlier, The DTR signal that goes to the pin3 of the basic atom pro 28 must be isolated, meaning that you must install some sort of switch between DTR and pin3 of the Basic atom. The switch can be installed on you serial cable.

Trying to find an example of how to do this?

Any pointers in right direction, i swear i have seen a photo somewhere on these forums!

Ive downloaded advanced serial port monitor and i can turn the DTR signals off. When i do this i rx a continuous rd signal so that means its working right??? As the atom is now ready to rx from what i understand?

So what exactly should i send now i appear to be communicating fine?? i have tried 10 FF EF 80 80 80 80 0D in different formats - binary, hex etc to no avail

Ill install a switch if i can find out how - anything to get out of this rut!!

Apostolos is saying to disconnect the DTR line (pin 4) from the Atom board. The simplest way to do this (not permanent) is to get a pair of DB9 connectors, one male, and one female, and connect pins 2 - 2, 3 - 3, and 5 -5. This will give you basic 3-wire connection when connected in line with your serial cable.

DTR (4) should be an output from the Atom board, although it is marked ATN on the Bot Board II schematic. Thus I’m surprised it makes any difference. Simple way to verify is measure the voltage on this pin with the board powered up. An RS-232 output will be driven to either -5 to -12 or +5 to +12 V. An input pin, what I would expect for an attention line, should show 0V.

I’ve got a new Bot Board II on order (old one went to a friend), so I may be of more help later.

Alan KM6VV

Actually the DTR pin at the Atom is an input and it is connected to the reset pin of the microcontroller on the Atom.

So it IS an input. I didn’t find anything about ATN in the Bot Board II manual, but in the chip manual for the BASIC Atom-28 schematic I do see that it’s connected to reset. Also calls it a reset to the chip.

the “3-wire cable” should open this connection for him, 'tho. Of course, you might want to go back and forth between programming and running. So a switch in the serial cable as I just saw mentioned would be an even better idea.

Alan KM6VV
P.S. Did I read somewhere that there is a C compiler for the BB2 and the BASIC Atom-28 module?

Ok ill try that, not got access to my bot for 2 weeks now but i can make the cable up sat on the plane!

Ill make the lead and let you know how i get on, thanks for the help!

I take it i want the switch so that i can have a normal config for programming and then the “Modified” setup for trying to run the commands

Thnaks for the help

:smiley:

Hi.

In the past few days I have managed to setup communication between the BBII and my ATmega128 control board.
The BBII is running a serial controlled program generated by powerpod and I have my ATmega128 board connected to the BBII via an RS232 level shifter (pins serin, serout)

All the serial commands that are used to control the BBII are pretty straight forward. For example, if I want to make the robot “fly” I simply send the command Printbin #1 , &H80 ; &HFF ; &H7F ; &H80 ; &H80 ; &H80 ; &H80
or if I want to make the bot “attack” I send the
command Printbin #1 , &H40 ; &HFF ; &HBF ; &H80 ; &H80 ; &H80 ; &H80.
The same implies to all the other commands. The only commands that need to be continuously sent are the gait speed commands (left, right arrows) and the gait height commands (up, down arrows).

Is there any way that I can send these command with one serial stream?
For example, if the gatespeed is 3 and I want it to go to 10 the I have to press the left arrow key 7 times so the speed goes to 10. What I’m trying to do is send a serial command so the speed goes from 3 to 10 with one command and not 7.

This is a snippet from the powerpod code that is resposible for increasing or decreasing the gaitspeed

if (DualShock(1).bit5 = 0) and LastButton(0).bit5 then ;Right Button test GaitSpeedTmp = (GaitSpeedTmp + 1) max 20 elseif (DualShock(1).bit7 = 0) and LastButton(0).bit7 ;Left Button test GaitSpeedTmp = (GaitSpeedTmp - 1) min 3 else goto NoSound1 endif Sound 9,[20\(50-GaitSpeedTmp) * 35 + 400]

Has anyone done something like this ?