Ah, awesome, crenn - any help you can provide would be fantastic.
Yes, repeat start is the issue. I was pulling my hair out (no logic analyzer, limited debugging), so I wired up an Arduino Pro Micro (32U4), a logic level converter (5v Pro Micro, 3.3v I2C on the DC to DC converters), and wrote this sketch (similar to what I had for the STM32, but without HardWire and without the "stop" parameter):
'
#include <Wire.h>
void setup()
{
Wire.begin();
}
void loop()
{
Wire.beginTransmission(0x07);
Wire.write(0x98);
Wire.endTransmission(false);
Wire.requestFrom(0x07, 2);
Wire.endTransmission();
Serial.print (Wire.read());
Serial.print (" ");
Serial.print (Wire.read());
Serial.println (" ");
delay(50);
}
'
... which works fine (pulls out the PMBus version off the converter), so that should make what's needed pretty clear. :) I fiddled with the I2C ISR enough to know enough to be dangerous. Doesn't help that my fiddling amounts to load-and-test, I don't really have a C setup other than the Maple IDE (though, I've been using Visual Studio to edit files, look up definitions, etc).
PMBus is an extension of SMBus, SMBus does all kinds of stuff (found in PC's, etc) - basically a protocol on top of I2C to make for more advanced messaging. The STM32's have support for SMBus (which is the basis of PMBus), and they quote PMBus as well in their literature. The PEC byte (hardware CRC8) can be handled by the STM32, but I'm not expecting anyone to go that far with it (modifying the I2C functions). I won't worry about that myself until I find I'm running out of processor. :)
These DC to DC converters require a PEC byte when sending commands (rx doesn't need them, but the converter will reply with one). I know it'd be tedious to set the PEC bit at the right point in time for a tx, or the check on rx - I'm planning on doing the CRC8 handling in software for now (got code for CRC8, works properly).
I can't say if the one MPU-9150 in the torso (for a short biped) will be sufficient for all I want to do, I've been thinking of putting one on each hand as "bump" sensors or some such (along with STM32's via serial), could make for interesting gyro compensation scenarios.
As for the boards, I started on these boards over Christmas vacation, finished them up amidst work in early Jan, got it sent out to fab a couple weeks into Jan, got them put together in the past few weekends. It's been one of the faster aspects of my project!
My project revolves around a Robonova-1 (now discontinued), but he's not quite a RN-1 anymore (5 DOF hands, hip / wrist rotation, torso redesign - still needs work -, 3 DOF neck - some work remaining - , all stock servos replaced w/ HSR-5498SG's). I'm using some custom "bearings" as well, thrust bearings with CNC'd ball cages, off the shelf 1mm balls and washers. I have a mini-mill I converted to CNC a while back, it's already paid for itself.
The SBC that connects to these boards is an Intel Atom Z530 board from Kontron, 1.6 Ghz. It has 2Gb 667 Mhz DDR2, and I have some brand new SSD's sitting here (Transcend, TS64GHSD630, and a 740) that will go in as well. For now, I'm using a MicroSD as a hard drive, it's running WinXP.
The whole point of putting all of this effort into a foot tall 'bot is to show off some .Net software I've written, kind of like a "life's work" if you will, all I know, have come to understand, and believe about code and life, boiled down to its most simple, bare essence, then coded. It's some pretty out there kind of stuff - but I need a platform to show a glimmer of the potential. I started out writing a control system, but it became something much more flexible, then I went off and started thinking about AI, and life, and ended up where I am with the software - now, I just need to give it form.
The PMBus to the DC to DC converters lets you do quite a few things - voltage margining (increasing / decreasing by up to 25%, I think), measure volts in, volts out, current out, etc. Much more efficient than regulators. I'll run it all off 2c LiPo, so about 7.4v, putting me over 95% efficiency on the converters. The bot doesn't need full power all of the time. Oh - and these can be turned on / off over PMBus, so I can kill some power when he's recharging.
What do you want to know about the boards? I plan to use the Z530 board to send commands, the STM32 board will handle interpolation, perhaps sequences of moves up to a few steps, with gyro / accelerometer correction. The STM32 will run the hands over a USART to two more STM32's (boards not yet designed, but will be like this one, only with a lot less stuff on 'em). In all, 33 servos will be controlled via this board (indirectly for the hands, may just forward the serial packets to the hand controllers and let them do their own interpolation). Power functions will be exposed through the CP2103 connection to the PC board, for turning up / down power to main servos, turning off stuff, etc. The optocoupler is for the reset / power / HDD LED connections on the PC board. Lower right is a TS2012 class D audio amp, separate ground planes, ferrite beads, etc. The PC board has audio out and mic in, audio out will go to the 3 pins on the right (L, Gnd, R).
On the power board, 3 DC to DC converters - PDT012 12A for hand / neck servos, micros that require no more than 5v; UDT020 20 amp converter for the main body servos, PDT012 12A for the PC board, Transcend SSD, and 2 regulators - 1 regulator for audio amp power, 1 regulator for power for the control board.
The power board has a MAX1614 MOSFET controller tied to a 100A FET (40A at ambient) for power control, will notify the STM32 via GPIO when battery is low, then some GPIO back to shut it all down when ready (ex, after a safe position is set, after PC is shut down, etc).
The CP2103 was added to up the baud rate, to get data in and out of the STM32 faster than over the SerialUSB connection. I'm hoping for 4mS servo position updates, that seems to be the magic number for smooth operation - slower than this starts to show some jitter in the servos.
Sorry for the long reply, there's a lot to my project, and I tend to ramble... :)
My debug / testing up to now has been on this board (see pic), attached to the Kontron SBC, via remote desktop connection. I used my main PC for testing the 32U4 with the above sketch.
Thanks,
Paul