Our first Kondo robot was Gulliver, an original KHR-1 (not to be confused with the more recent KHR-1HV kit). He's great, and we've had a tremendous amount of fun playing with him, and learning from him. But, seeing all the newer KHR-2HV robots out there playing soccer had us wishing for another robot just so that we could play too.
But, that would cost $$$, not to mention having to negotiate with our better half and trying to explain why we just can live without three, or four, humanoid robots to experiment with. If we weren't careful about it, we might have ended up with only the robots in an empty house...
So, we took the safer, and cheaper path, and swapped out Gulliver's older RCB-1 control boards for a single, and much more powerful RCB3 controller with the latest firmware. But we still needed to address the motion sequence differences between the two robots or we wouldn't be able to use all those cool soccer moves.
First, we should mention that you can accomplish everything we've outlined below without the aid of external software or file manipulation. The H2H3J software has all the necessary functions built-in, though they are a little bit hard to use if you want to convert a large number of motion sequence files, as we did.
We decided to create a simple software application using Visual Basic for several reasons. First, as we mentioned, we needed to convert up to a couple dozen (yes, we have that many KHR-2HV motion files) so we definitely wanted to automate the process. Second, we plan to develop more complex applications for the RCB3, and felt that this was a good place to get our feet wet.
Luckily, the physical geometry and linkages of the KHR-2HV and original KHR-1 are almost identical. There are some weight distribution differences, but they are small enough that we should be able to compensate by adjusting the motion sequences once they are running on Gulliver. There are, however, two significant differences between the two robots:
- The servo channel assignments don't match
- Four of the key leg servos are reversed
The KHR series motion files (RCB) are flat text files with a simple data format. They start with a header block that contains information about the motion, like the size of the work area, number of objects (items), number of links, etc.
The header block is followed by a series of item blocks that correspond to objects on the work area in H2H3.
For purposes of this conversion, we needed to focus on the last line in each block that always begins with "Prm=". This line has 25 sections that start with the POS speed setting (12 in the example above) followed by the absolute position for each of the 24 servo channels. To remap the servos, we parsed this line into its individual sections, arraigned them in the new order for the KHR-1/RCB3, then created a new motion file that could be used by H2H3.
Dealing with the four reversed servos was a little more challenging. The calculation was simple enough, however Kondo uses the channel values in objects to indicate operations other than servo positions. For example, some specific high channel values tell the RCB3 to change the ICS settings for a particular servo. So, we had to include some additional logic to deal with those unique cases.
Our initial application allows selection of the source file, then converts all the data into the KHR-1/RCB3 mapping, and generates a new output file. All the input and output data is also available in text boxes on the control panel where it can be selected and copied if necessary.
In the screen shot above, you can see that the values for all the servos are set to 32774 which changes the ICS settings for all servos to SET1.
Since there are less than a handful of people that have upgraded their KHR-1s to use the RCB3, we don't plan on distributing this particular application. We do have several other, much more advanced applications on the drawing boards that might have a wider potential user base, and we are certainly open to making them available if there's enough interest.
Next on the agenda is a similar program to convert all the old KHR-1 motions into the KHR-1/RCB3 format (there are some servo position scaling and speed issues that need to be addressed). After that, we have a preliminary strategy to attack some of the persistent TRIM and HOME POSITION problems, as well as a POS editor that should be more intuitive and easy to use. No schedule promises though - we're trying to squeeze this into the very limited free time we occasionally have available.
Ideas and suggestions are definitely welcome!