Go Back   VEX Forum > Community > Technical Discussion

Technical Discussion Open Technical Discussion of the VEX Robotics System.

Reply
 
Thread Tools
  #1  
Old 01-22-2012, 06:41 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,234
Images: 2
Partner joystick communications protocol

One of the things I really enjoy is figuring out how things work. A question was asked about the partner joystick communications and so (although I'm sure JVN will give the official answer) here is what I have found after an hour or so of poking around.

The partner joystick connector is a 4 pin RJ-9 (or is it RJ-22, not sure) and uses a 4P4C telephone handset cable to connect to the partner joystick.

Connector pinout

Pin1 GND
Pin2 Tx Data from the joystick
Pin3 Rx Data to the joystick
Pin4 GND

The connection uses RS232 communication at normal RS232 levels rather than the TTL levels used on the programming port.

Communication is 8 bit No Parity (I think) 1 stop bit at 115200 baud.

The Master joystick sends a message to the partner joystick roughly twice per second, the message is 4 bytes (shown below in Hex) and seems to be used to keep communication alive.

AA 55 3B 01 (This is inconsistent with all other VEX messages, should be 1 more byte if it followed the normal format )

The partner joystick responds with a message similar to the following (again in hex) at a much more frequent rate (to lazy to time it).

AA 55 39 0A 7F 7F 7F 7F 00 00 65 7F 7F A1

the breakdown of this is as follows

AA 55 39 - header, nearly all VEX messages start with AA 55
0A - data length, including checksum
7F 7F 7F 7F - the values for the 4 analog joysticks
00 00 - the buttons as bitmapped data. ie. one button per bit
65 7F 7F - accelerometer data
A1 - checksum, the sum of all data bytes and the checksum byte will be 00 (mask sum with 0xFF )

I will leave it to others to add more detail on switch bit positions, I did decode this for one of the other communication protocols but to be honest I'm too lazy to type it out here.

I had the joystick hooked up to a PC through a USB serial adapter, it would be very simple to create a partner joystick simulation if needed.

This is obviously unofficial information so use at your own risk

Enjoy

Last edited by jpearman; 01-23-2012 at 05:00 PM.
Reply With Quote
  #2  
Old 01-22-2012, 08:07 PM
tutman96's Avatar
tutman96 tutman96 is offline
Senior Member
VEX # 675A
 
Join Date: May 2011
Location: Duluth, GA
Posts: 384
Images: 1
Re: Partner joystick communications protocol

Im thinking that the data that the Master sends out is for the lights on the partner stick. One byte per light and then the color within the byte.

Edit: Perhaps the normal start byte and the light value and then a checksum.
__________________
Team Leader of Team 675A

Tournament Champions (11/17/12)
Excellence Award Winner (1/26/13)
Driver Skills Champion (280)(1/26/13)
Programming Skills Champion (175)(1/26/13)
Tournament Champions (2/23/13)
Reply With Quote
  #3  
Old 01-22-2012, 10:25 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,234
Images: 2
Re: Partner joystick communications protocol

Quote:
Originally Posted by tutman96 View Post
Im thinking that the data that the Master sends out is for the lights on the partner stick. One byte per light and then the color within the byte.

Edit: Perhaps the normal start byte and the light value and then a checksum.
Perhaps, I did not monitor an actual exchange between two joysticks, I only have one. I posted this for the students at KTOR to have something to get them going with their custom partner controller. If I have any time in the next couple of days I will throw together a demo application that can simulate the partner joystick.
Reply With Quote
  #4  
Old 01-22-2012, 11:10 PM
Imnotabot's Avatar
Imnotabot Imnotabot is offline
Junior Member
VEX # KTOR
 
Join Date: Jan 2012
Location: Philadelphia, PA
Posts: 10
Re: Partner joystick communications protocol

Thanks Jpearman. It's a great place for us to start from as you said. Right before worlds we'll post our control box if all goes according to plan (ie we can actually figure out how to get it to work).
Reply With Quote
  #5  
Old 01-22-2012, 11:27 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,234
Images: 2
Re: Partner joystick communications protocol

Quote:
Originally Posted by Imnotabot View Post
Thanks Jpearman. It's a great place for us to start from as you said. Right before worlds we'll post our control box if all goes according to plan (ie we can actually figure out how to get it to work).
PM me if you need help, you could use something like this to make the cables easier if you need to. I hope JVN will post the full protocol so we don't have to do any more experiments.
Reply With Quote
  #6  
Old 01-23-2012, 06:34 AM
JVN's Avatar
JVN JVN is offline
VEX Robotics
 
Join Date: Oct 2005
Location: Greenville, TX
Posts: 1,285
Images: 18
Re: Partner joystick communications protocol

Quote:
Originally Posted by jpearman View Post
PM me if you need help, you could use something like this to make the cables easier if you need to. I hope JVN will post the full protocol so we don't have to do any more experiments.
I thought you just said you enjoy figuring out how things work?
__________________
John Vielkind-Neun | VP of Engineering | VEX Robotics, Inc.
Reply With Quote
  #7  
Old 01-23-2012, 08:05 AM
Imnotabot's Avatar
Imnotabot Imnotabot is offline
Junior Member
VEX # KTOR
 
Join Date: Jan 2012
Location: Philadelphia, PA
Posts: 10
Re: Partner joystick communications protocol

We are actually using a phone jack at the moment to achieve the same principle and JVN while we are trying to figure this we would never turn down additional help/information.
Reply With Quote
  #8  
Old 01-23-2012, 10:48 AM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,234
Images: 2
Re: Partner joystick communications protocol

Quote:
Originally Posted by John V-Neun View Post
I thought you just said you enjoy figuring out how things work?
Absolutely I do, but there is always a trade off between time invested and the reward it supplies. I am skeptical that you will ever release any significant technical details based on past requests for this type of information. I recently tried to get more insight into the changes in the latest master firmware and, although receiving a polite reply, still feel short changed when asking about these things. Here are a couple of (admittedly very old) posts from the FAQ that seem to express the general attitude.

http://www.vexforum.com/showthread.php?t=24

http://www.vexforum.com/showthread.p...light=protocol

There are many of us who would like access to schematics and communication protocols, not for any particular reason but just to educate ourselves. I have looked into many things, both HID and CDC USB protocols used for connection of the cortex to a PC (I have OSX drivers for both), certain aspects of downloading and uploading firmware, the whole ROBOTC communications protocol, internal mapping of IO ports on the STM32 processor, lots of stuff, nothing used for destructive purposes and most of this I keep to myself unless asked about it. Next on the list I guess will be the new I2C interface, what's the clock frequency, how does the address auto-negotiate work as I'm used to static addresses. One day perhaps I'll take a crack at the WiFi protocol, although that will take a little more effort and I'm not that interested.

So I hope you will surprise me John and let out a few secrets
Reply With Quote
  #9  
Old 01-23-2012, 09:16 PM
JVN's Avatar
JVN JVN is offline
VEX Robotics
 
Join Date: Oct 2005
Location: Greenville, TX
Posts: 1,285
Images: 18
Re: Partner joystick communications protocol

Quote:
Originally Posted by jpearman View Post
So I hope you will surprise me John and let out a few secrets
I was just joking with you.
We will release as much as we can. I'm on the road right now but when I get back to the office I'll discuss in more detail with my team.

As you know there are reasons to keep some things proprietary, and reasons to make things public. We try to find the balance between these two...

-John
__________________
John Vielkind-Neun | VP of Engineering | VEX Robotics, Inc.
Reply With Quote
  #10  
Old 01-24-2012, 12:37 AM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,234
Images: 2
Re: Partner joystick communications protocol

Quote:
Originally Posted by John V-Neun View Post
I was just joking with you.
I know, but it's always an opportunity to jump on the soapbox.

Quote:
We will release as much as we can. I'm on the road right now but when I get back to the office I'll discuss in more detail with my team.
Any information on any of the protocols would be appreciated.

Quote:
As you know there are reasons to keep some things proprietary, and reasons to make things public. We try to find the balance between these two...

-John
I understand and face this situation on a regular basis.

In the mean time....

Here is a silly little app I threw together this evening that simulates a partner joystick on a PC or Mac. Not very polished, just a bunch of sliders and buttons, but I have no real use for it so don't plan to develop it any further. You can use the prolific serial adapter or any other serial port available (needs to be there before launching the app under windows). Obviously, a custom 4P4C to DB9 cable needs to be made, use the pinout from the first post in this thread.





OSX version available for download here.

Win32 version available for download here.

Enjoy
Attached Images
File Type: jpg joysim_grabosx.jpg (75.9 KB, 948 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 09:26 PM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.