Lobotomy Completed

John R. (chiphead@sbcglobal.net)

Back to Main Page

Introduction

Well the "new brain" is in place. We had some fun getting things functional. There was a "gotcha" with driving the HiTec Digital Servos directly from the Propeller, but that has been resolved. I spent some time on the Windows interface, but have a ways to go. More significantly I did get the Inverse Kinematics all (mostly) worked out, and had a joystick moving a leg in X, Y and Z, with the software calculating the appropriate servo commands.

The New Brain

I took the plunge, and replaced the BOE and two PSCs (Servo Controllers) with the PRC board from Wulfden. When I fired the puppy up, I was aghast! Nothing worked. I pulled out the oscilloscope, and started probing around. My servo pulses were going out, but the servos were not reacting. I pulled a servo, and put in one of the servos I was using for the "Pre-lobotomy Development", and it worked fine. I figured it was something to do with the digital servos.

I took a close look at the signal going to both servos, and found the following: When the "analog" servo was in place, there was a voltage drop to the signal pulse, and it dropped from the "top", as you would expect. When the "digital" servo was put in place, there was a larger voltage drop, and more significantly, the "upper" voltage was at a full 3.3 volts. It was the "ground" that came "up".

The servos are "normally" driven from the Propeller through a 4.7k resistor. This is done to protect the Prop from "Back EMF" from the servos, and is not 100% required. I started lowering the resistance, and about 2.4k, the digital servos started working. Originally, I had nice 1/8 watt 4.7k resistors all nestled down very neatly on the PRC. I had to take them all up, and I only had a mixed bag of 1/4 watt resistors. I've got a "hodge podge" in place of resistors ranging from 2.4k down to 1.8k or so, and they are "looped up" so I didn't have to trim the leads. At some point, I'll get some 1/8 watt 2.2k resistors and replace everything.

Here's a picture of the PRC board in place on the bottom deck:

Software Progress

On the software side, I've made some meaningful progress. I've started to refine the user interface, but it still is focused on "single leg" manipulations. I've defined a "Leg" object in the C# software, and have a "Nomad" object that sets up six instances of the Leg. It "tells" each leg where it is on the robot. Each Leg object can be passed an X, Y and Z coordinate, and will calculate the joint angles, derive the appropriate servo angles, and send out the corresponding servo pulse commands to the Propeller.

I can then select a leg in the software screen, and use the joystick to move the leg in the X, Y and Z directions, and the software will compute the required servo movements. I also wrote a "ToString()" method for the Leg object to report back what the "localized" coordinates are, as well as the servo angles and pulses. This was a great help in tweaking the formulas for the Inverse Kinematics.

The Inverse Kinematics probably deserves some in depth discussion, but that will have to wait for another update, when I'm more up to doing some writing and formal documentation. See the Discussion page in the CrustCrawler forums for more information.

Communications Improvements

The calculation and communication "round trip" started to get bogged down. When I was directly manipulating the servos, I was only sending out commands for the servo axis that actually changed. Now, for any leg movement (still only 3 servos for "one leg at a time"), my timing started getting long. The "round trip" was up to just under 50 ms. I know when I started multiplying this by 6, things would start to get a little jerky. I was sending data via "strings". I converted this to send and receive binary data, and got the cycle down to under 10ms for one leg. By changing to binary, I was able to reduce the byte count of the communications from 8 down to 3 for each leg.

What's Next

My next step is to write some sequencing software on the PC side, and get the Nomad walking again.