Bug in v7.0 of the servo controller firmware

The simple servo sequencer that I’ve been working on has exposed a bug in the servo controller firmware. The bug is due to stack corruption during movement completion notifications, so it only happens if you use the ‘multi-move’ commands or the delay move command. The problem is that at the end of SerialSendMoveCompletionNotification we jump back to the serial data accumulation loop rather than using a ret to return… Since we enter SerialSendMoveCompletionNotification via a call rather than a jump we are failing to balance the stack and so eating two bytes each time we call the function.

Where are we?

Once the servo controller code was feature complete I switched to looking at the hardware side of things and thinking about the next stage, the servo sequencing. From a hardware point of view I had several things to work on. Firstly I needed to get the servo controller and I/O multiplexor chips off of a breadboard and onto something a little more permanent. Since I still find building things with perfboard a little hard I decided to build the controller itself on one board and build separate daughter boards for the I/O multiplexing.

Prototype fabrication

As I mentioned back in April after I’d put together my first prototype leg, “the prototype leg has some fairly major failings from a mechanical point of view”. Ideally the real legs will be designed and cut from sheet material, either plastic or metal. Getting to that point is going to take some time though and right now I haven’t been able to locate a UK based laser cutting service at an affordable price.

Once more with feeling

Having decided that the graduated servo positioning method was the way to go to allow for leg sensors to work correctly I started thinking about leg sensors. Here’s a new lower leg with three switches, one on the foot, one to the inside of the leg and one to the outside of the leg. ProtoLegv02-1.png ProtoLegv02-2.png Ideally the front and back switches would be extended with thin metal bars running the length of the leg and fixed just above the ankle.

More thoughts on the proto leg

I adjusted my quick and dirty servo controller program to calculate the number of moves required for the servo that needed to move furthest and then spread the movement of the other servos across the same number of moves. So, given that the servo controller works in terms on a position from 0 - 254 where 0 is full left and 254 is full right and we have three servos that make up the leg I look at the differences between where the three servos are now and where they will be at the end of the move and then build a sequence of moves to get from here to there.

Thoughts on the proto leg

The prototype leg has some fairly major failings from a mechanical point of view. The only part that may eventually find its way into a weight bearing leg is the lower leg where the cut out around the knee servo provides ample support for the servo itself and also a suitable mounting point for the servo. The hip servos need much more support before they could be used to form a weight bearing leg either in the form of metal brackets or more complexly cut board.

Prototype leg v0.1

I spent a little time at the weekend putting together my three servos into a prototype leg. The idea is that this very quick and very dirty little experiment should give me some more avenues to explore; and something to show people. I had originally planned to build the leg out of wood, perhaps thin plywood, but I didn’t have any laying around so instead I used some plastic window board which is relatively light and strong.

Servos with status feedback

I saw these Dynamixel DX servos mentioned on Trossen Robotics this morning, see here. They’re interesting because they have a richer interface than the normal hobby servos that I’ve been looking at and they provide a multidrop RS485 interface so that you can chain multiple servos together and control them individually via a single line. You can get feedback on the angular position, velocity and torque and also alerts if temperature and voltage deviate from expected (user specified) ranges.