Controlling sequence SSC 32 RS 232

Hello Everyone,

i’m an enginner student and recently its been presented to me a senior final project.
The first goal of the project consists in controling A-Pod Lynxmotion Hexapode robot by an interface programed in Qt Creator. I’ve been able to send move comands, control servo one or more servos at a time etc from a computer interface, and also made the robot work with a PS2 command… But know i need to make the robot move in a similar way of PS2 control, but with a rs 232 interface in a computer interface.
For what i’ve been reading, i’m able to send pre-defined command sequences in to SSC like "PL

SQ " and make the robot make some pre-programed movements, like wlaking back and foward, rotate, etc.
Is there any manual or reference of the sequences already programed in SSC?
Thanks in advance

The SSC-32 has a built-in 12 DoF hexapod sequencer for robots like the MH2. However the A-Pod is an 18 DoF hexapod, so this functionality cannot be directly used. You’d need to adapt the A-Pod or Phoenix code:
lynxmotion.com/images/html/build184.htm (Basic)
lynxmotion.com/images/html/build99f.htm (Arduino)

The project i’m working on, is about putting to work together a beagleboard xm with ubuntu, a kinect microsoft camera and use open ni framework. The goal is to make a movement with the hand and the robot do a sequence of movement or maintain a distance to a person or with a right to left move of the hand make the robot that a step left… all of this with serial comunication…
At this time i don’t know how to aproach this… if work directly with SSC 32 and give direct rs232 commands, or work with boatboard II rs 232 or any other option. Do you have any sugestions??
Thanks in advance

Start with the complete A-Pod robot; you’ll get sample code which uses the PS2 controller. Modify the code slightly so instead of reacting to PS2 commands, it will react to specific instructions (a small string or even number sent via Bluetooth / WiFi or RF for example) which are sent to it.

Will you have the Beagleboard and Kinect mounted on the A-Pod or separate? If it’s mounted on the A-Pod, you can wire the Beagle Board to the Bot Board directly. The issue you will likely encounter is that the Kinect (the version for the XBox) is power hungry. The setup would be:

Kinect -> Beagle Board (image processing) -> Bot Board (inverse kinematics and walking) -> SSC-32 (servo control).

Thanks for the reply!!
The kinect camera will be mounted or glued in the top of the A-Pod. The power suplly will be independent.
Programming microprocessors is not my strong point! :frowning: Is no other way to do it??
in the lynxmotion page it says : “The Phoenix code also supports a serial control mode for controlling the robot via a serial connection.” but i can t find any thing or any code to do this…

You should use the sample code, and adapt it to accept serial commands instead of PS2 commands. This way you don’t have much coding to do.

It is not difficult. I have done for the other Lynxmotion hexapod robots, like the Phoenix, or T-Hex… However I never integrated the changes that Kåre (Zenta) did for the A-Pod into my sets of code bases. (As I do not have one of these to test the code on) I have tried to keep current stuff up on github. If you are using an Basic Atom Pro 28, the sources are up at: github.com/KurtE/Phoenix_For_BAPS

In that project there are several types of inputs, that one could define, including, PS2, Our DIY XBee stuff, and a Serial input, that was compatible with the old Powerpod program. I talked about it in other threads including: viewtopic.php?f=8&t=7041 The differences between the PS2 and Serial code is pretty simple. Instead of asking the PS2 for data which gives us something like 8 bytes of data, we instead ask for it over a serial port… Up on my BAP github, I believe there is a T-Hex sample project that did this.

Likewise if you are using an Arduino based board, I also have the code up on the project: github.com/KurtE/Arduino_Phoenix_Parts
But again I have not integrated the A-Pod specific stuff into this project.

Good Luck
Kurt

i’m going to try to alter the APod_PS2 project by analogy using your code “Phoenix+Beta+2_1+T-Hex+SSC-32+Serial”
Thanks :slight_smile:

Hello,

I’m trying to alter the code… but i came across a dought!!
The Phoenix Serial code uses a array of 7 Byte… but in the code is asked for bits…
i’m a little bit confused… what do we send trought serial to botboard?? a string of 7 bit (0/1) ?? in decimal or hexadecimal?

Thanks

You send through a string of 7 bytes. Each of these bytes has 8 bits of data in them. Some of these bytes have simple values for the joysticks on the PS2 and some of these are bit masks where each bit corresponds to the state of one of the buttons on the PS2 (or our simulation of the PS2).

// DualShock(0) : Checksum of other byte // DualShock(1) // bit7 - Left Button test // bit6 - Down Button test // bit5 - Right Button test // bit4 - Up Button test // bit3 - Start Button test // bit2 - R3 Button test (Horn) // bit1 - L3 Button test // bit0 - Select Button test // DualShock(2) // bit7 - Square Button test // bit6 - Cross Button test // bit5 - Circle Button test // bit4 - Triangle Button test // bit3 - R1 Button test // bit2 - L1 Button test // bit1 - R2 Button test // bit0 - L2 Button test // DualShock(3) - Right stick Left/right // DualShock(4) - Right Stick Up/Down // DualShock(5) - Left Stick Left/right // DualShock(6) - Left Stick Up/Down
I am not sure what you are using on the PC (or other processor) to be talk to the serial port of the BAP. The earlier powerpod program for the earlier 3dof hexapods like the chr-3, had a test program for testing out the serial interface. It was written in C++, but I don’t remember which compiler he used… The program as well as it’s sources are installed where you installed powerpod. In my case c:\Program files (x86)\Powerpod…

On an Arduino you can simply output a binary byte, by using the write method for a serial class. …

Again you want to send the binary data and not the Ascii strings that make a human readable value. Note on the buttons, the value for it is a 1 if the button is not pressed and a 0 if it is pressed. So to emulate for example the start button being pressed you would send data like: (Hex values) 0x08 0xf7 0xff 0x80 0x80 0x80 0x80
The first byte is the checksum, the next byte only has the 4th bit not set (Start button), next byte all set no button pressed, the last 4 values are the simulated joystick values where 0x80 (128 decimal) is more or less at the center, like the ps2 joysticks being centered).

Again not knowing what you are using to generate these values on the host end, hopefully the above helps.
Kurt

Thanks a lot Kurte!!
I’m using/creating an interface on Qt Creator 5.0 to send the data trought serial port…

Regarding the data to send to the serial port is it exactly like your example? in hexadecimal, with spaces between and with no terminator or carriage return?

To do start and to remain ON, as in your example, does the bit dualshock(1).bit3 as to be always “0”?

Thanks again

First off, I do not know how you send data in Qt Creator. Maybe someone else has used this…

I simply gave the hex values that if sent through hopefully would emulate pushing the start button. Note: Most of the code that detects button presses, works like. If the value is on (0) and the previous value for it was off (1), then do whatever you wish to do for the button press. Normally your next message, would probably have the button going off again… But again look at the example code. You need to wait for it to ask you for data before you send it.

Kurt

thanks for the quick reply
in Qt i know how to send data… i have a working version of controlling single servo by sending the macro commands!!
when i finish i will post here all the code!

What do you mean by :"You need to wait for it to ask you for data before you send it. "

i’ve notice the code "serout S_OUT, i9600, “Rd”] ; ready to read data now

but do i keep sending continuasly the data trought serial?? Or how can i know when the BAP is ready to recieve the data?

The code on the PC, should wait until it receives the Rd prompt from the BAP and then send the 7 byte response. This is because serin on the BAP is a software implementation of serial input and it will only receive the data while it is sitting within the Serin command. If you start sending too soon, it will miss the data. Too late and again it will miss the data. In fact when you get the Rd back from the Bap, your code may have to put a small delay in, to allow the bap enough time to transition from the Serout command to the Serin command.

Good Luck
Kurt

Hello,

I’ve been able to alter the BAP micro code to recieve commands trought serial port and its working with the h3/h3-R serial port control panel program.
I can see that the commands sent is like 08 F7 FF 80 80 80 80 - Star button…
Now i’m trying to send this same command trought this program:

sites.google.com/site/terminalbpp/

I recieve the Rd string but when i send the command of start button nothing happens :s

Any ideas?

Again I am not sure how you sent the binary data. Also Should mention the first byte 08 is the checksum of the other bytes, so you may need to double check that is correct.

Now assuming that you sent the correct binary data and not the human readable ascii strings like I put in previous posting. Then there is the issue of timing. That is the response from the PC can not be too fast or too slow. Too fast and the BAP will not have made it into the serin command and ready to receive the data, and too slow the BAP serin command will timeout.

Also there is the issue of sequences of responses. That is assuming the code is working properly (on both sides), you will probably receive at least 20 of these requests per second and the code remembers what the previous response was, such that it can emulate the PS2. To process button presses only once when the button first goes down, the code is setup to say a Button like the start button is pressed, will say it is pressed, when the corresponding bit is clear in the current response, but was set in the previous response. So you may need to make sure that on previous Rd requests the appropriate packet was sent…
Something like: 00 FF FF 80 80 80 80
Note: you may need to double check the xor check-sum…

Kurt