Botboarduino JR

Coolness!!!

Hi Jim, Devon and others…

As the release of the Botboardduino is very very soon! I was thinking I may take another pass through some of the code and make it more understandable and also with some instructions like, here is where you download the needed libraries from…

The Phoenix code is probably fine as is as it uses the SSC-32 which uses serial communications. However I am using a beta version of the Software Serial class that some may have issues with…

The brat is a more interesting case. That is the default Servo library has simple calls that says, Set the pulse width for this servo to 1500 (or you can sort-of give it degrees… But there is no group move/timing as part of the interface. I wrote my own group move class which I included as separate files in m Brat sketch. This code sits on top of the Servo code and has it’s own timer that when the timer goes off it calls off to Servo and changes the pulse width. This is both somewhat inefficient as we have the extra interrupts being processed and the updates are not timed with the servo pulse cycle… I was thinking of changing it to:
a) As a minimum split this out of the Brat sketch and make it a library, as other programs may want these capabilities. Not hard, simply move to the the .cpp and .h files to a directory in the library directory. Probably create a keywords.txt file in that directory so the class and members show up color coded in the IDE… Maybe provide a simple examples sketch…

b) Maybe merge the code into the Servos library, with a new Name, like MServo or GroupServo or… That the users keep the same Servo library syntax, except you have a Top level object that has a couple of methods, like: Begin, Commit and maybe some function that gives you a bitmask of which servos are still moving… Would also add a method to the Servo class that returns if the individual servo is still moving(changing) as well. If a Servo.Write method is called while a group move is not active, it will be done immediately.

Does this make sense? If I do build this library it won’t take long to convert the brat code. If I only go with a), I simply remove the files from the sketch and then do an import of the library. If I do b), it will change some of the init code and a few places that look like:

mservo.GroupMoveStart(); mservo.ServoMoveDegrees1(RAS_I, mlsd1.rightanklepos); mservo.ServoMoveDegrees1(RKS_I, mlsd1.rightkneepos); mservo.ServoMoveDegrees1(RHS_I, mlsd1.righthippos); mservo.ServoMoveDegrees1(LAS_I, mlsd1.leftanklepos); mservo.ServoMoveDegrees1(LKS_I, mlsd1.leftkneepos); mservo.ServoMoveDegrees1(LHS_I, mlsd1.lefthippos); mservo.GroupMoveCommit(mlsd1.sMoveTime);
Would Look more like:

            mservo.GroupMoveStart();
            RightAnkleServo.writeMicroseconds(mlsd1.rightanklepos);
            RightKneeServo.writeMicroseconds(mlsd1.rightkneepos);
            RightHipServo.writeMicroseconds(mlsd1.righthippos);
            LeftAnkleServo.writeMicroseconds(mlsd1.leftanklepos);
            LeftKneeServo.writeMicroseconds(mlsd1.leftkneepos);
            LeftHipServo.writeMicroseconds(mlsd1.lefthippos);
            mservo.GroupMoveCommit(mlsd1.sMoveTime);

Plus I may need to add some conversion function in my code to convert the units in the brat code (10th of a degree) into microsceonds…

What you think?

Kurt

I like it!

I have in my hands three of the production boards from the board house. I’m turning them over to Mike today. He should have them checked over tonight. Then they will be finished programming wise, and shipped here. Very exciting!

Sounds good that you got a couple of the boards, hopefully they came out great!

Been playing around with my conversion to a library that supports the group move, with the majority of the Servo Interface unchanged. It is taking me a little longer than I thought as I am trying to make the code more Arduino…

In my previous private code, my interface had members that allowed me to set a servo offset. Likewise I could pass in 1/10th of a degree and it converted it using my own conversion and I could reverse the values… But the Arduino Servo interface does not have these, but instead has a different mechanism that I think may work OK, other than I may have to do the mirroring myself…

With that Servo mechanism, when you attach the servo, you can optionally pass in a MIN and Max servo value in microseconds. If you call the servo.write method with a value in the range from 0-180, it will take those values to be degrees and map them to microseconds. What it does is literally to use the map function map(value, 0, 180, MIN, MAX); where the min and max values were the values passed into the attach. So if I Pass in values like 563 and 2437 will map pretty close to what I am using centered at 1500. The offset can be handled by simply adding or subtracting the offset from the min or max…

Does this make sense?

Thanks
Kurt

Making progress. I have the timed moves working (I think :laughing:), still need to do some more testing of my servo zero code (and probably fixes). The question is, should I start to post in the public area some of the WIP, to get their interest as hopefully the Botboarduino will be released very soon…

Kurt

I knew I was forgetting something…

They didn’t program the bootloader or fdi chip, but Mikes checked them out. After set up they are working great. Not going to be much longer. :smiley:

I think it does. But wouldn’t the servo hit a stop on one side or the other after the offset is applied? I like the mapping. Too bad it doesn’t allow another decimal place to prevent loosing resolution. 0.0-180.0, but the 0-180 should be plenty of accuracy for most projects. :slight_smile:

Looking good!

Yes please feel free to post. This is awesome!

Did you include a 3.3v regulator other than the one on the ftdi chip? The 3.3v pin on my board only comes on when i’m plugged into usb. Silly question but serious because the Duemilanove always outputs 3.3v

Yeah the BBJRs are in!!!

Jumpers:
JA-JC enable the LEDS and switches on Digital pins 7-9
4th Jumper enables a PU resistor on pin 6.
So pins 6-9 can be use for PS2 where P6 is the DAT line

Another Jumper near speaker enables speaker on Digital Pin 5.

Another Jumper near power connection connects VS to VL(VIN)
Another jumper with 3 pins: either power board by USB or by EXT

4 Jumpers for choosing power for pin groups.

Looking at image of the board, I think there may be 2 more jumpers that enable PU resistors for SCL and SDA

Also I believe there is 2 resistor divider circuits (10K/30K) for the two different voltages, that you can jumper to Analog pins 0(VS) and 1(VL).

I think that is all for now. Let me know if this makes sense and/or I missed anything.

I uploaded both the Zip file (I believe again) and a PDF of the schematic.

Kurt
BBD_100.zip (396 KB)
Botboarduino Schematic.pdf (77.5 KB)

Thank you Kurt!