Pete
Sat, 6 May 2006 03:10:00 GMT
re: Hitec HMI interface
I've spent some time on reverse-engineering the HMI protocol.
Here's what I've learned:
- The yellow wire is talking "TTL serial" at 19.2 kbaud. It's bi-directional, so you need to drive it with an open-collector buffer and a pullup. I connected the serial port on my PC, via a MAX232 chip, and was able to capture bytes moving between the HFP-10 and an HS-5475. I added a 7407 buffer to the data line, and I was able to drive the line and send bytes myself. I used a C++ program on the PC to read/write the bytes.
- Most data is sent in packets of 6 bytes. The first 2 bytes seem to be a 'command', the 3rd byte is 'data', and the 4th byte is a checksum. The 5th and 6th bytes are always 0x2B, but I think they are sent by the servo as an acknowledgement(?).
- Before modifying any params on the servo, there is a large transaction of over 400 bytes sent/received. I *think* what's happening is that the HFP sends some command info, then the servo responds with *all* of its current settings. If you want to change a param, you must know the *current* setting first, which is sent by the servo. For example, to change the SPEED setting, you tell the servo both the current speed and new/desired speed.
- When you select the 'limit' param, there is a continuous stream of packets going back and forth (50 times per second, 12 bytes each). The data appears to be position info, actual/desired.
The main thing I couldn't figure out was how to reproduce the 400-byte 'init' transaction. If I let the HFP send that part, and then used my program to send command packets, I was able to modify the SPEED setting on the servo. But to do anything interesting (without an HFP), it's necessary to make the 'init' transaction work.
There is probably something about the start-up timing that I'm missing. For example, when the HFP does it, it powers up the servo, then about 10 mS later it raises the data line to a TTL high level, then there is a much longer delay, then some data starts to move (since the single wire is bi-directional, it's hard to tell which side is sending what).
If someone else is able to go further with this, I'd like to know how it's done...
Pete