Testing Arduino Code on resurrected CH3-R

I thought I would post a quick and dirty video of my resurrected CH3-R Hex Robot. I rebuilt it using the old leg pieces, plus the Old body and with most all of the servos I had laying around. I also cannibalized one of my two Brats for parts as well.

I will be using this Hex to test out different platforms, such as the Arduino Mega, Chipkit Max32/Uno32, Arduino Due (when it is released). Unlike my main (now TH4-R), I will be using this platform to test code that uses the main processor to drive the servos. The other Hex robot will do the testing of the code with using an SSC-32 to drive the servos.

I will post more later on this, but thought I would do a quick and dirty video showing that it actually runs…

Currently I am using a Seeeduino Mega with a prototype shield. Hopefully next week I will replace this with the Official Arduino Mega and my Shield for it. Later will try with Chipkit Max32 with the shield… Will describe in more details soon…

Kurt

P.S. - will probably have to wait until my new battery charger arrives. The power cable on the old one went south…

I thought I would mention that the code base for this, started off being the same code base as the code I have for my THR-4 that is in the thread: viewtopic.php?f=20&t=6730

I am also trying to make the code be portable between the Arduino platform and the Chipkit platform. The biggest issue right now is that the Chipkit IDE and libraries have not been brought up to the Arduino 1.0 standard yet. It is at about build 23…

I then abstracted some of the Servo specific stuff out into a class, which I now have two implementations of. One that goes off to the SSC-32. The new version (the one for this thread), uses my ServoEx class library. This library is a modified version of the Standard Arduino library Servo, but I have added code to do the group/timed moves. That is I added a group move start/commit methods to a new class… The code definitely needs some cleanup but I think it preforming reasonably well. The Servo class (as well as the ServoEx), can handle 12 servos be 16 bit timer. The Arduino Mega (Atmega1280 or 2560) has several of these timers, so I knew it could in theory handle 18 servos. The standard Arduino as well as the Botboarduino use the Atmega328 which only has 1 16 bit timer, so at max could do 12 servos.

When I get the parts and complete my shields for the Mega and UNO (details in the thread: viewtopic.php?f=26&t=8021), I will develop a new implementation of servoEx for that platform. I don’t believe the standard servo library is ported yet, so I may base it on a different library SoftPWMServo. Should be fun.

While I am playing with this code, I may also start to clean up some other things as well, like create a Control class, and abstract some more of the code and data.

Well that is all for now.

Kurt

Looking forward to it Kurt! Maybe I will get back to my mostly home-built hex.

Alan KM6VV

That’s great work Kurt!
Looks like your hex move very well too.

I’m looking forward to see what you can get out of the MAX/UNO32. :smiley:

Thanks, me too. The shield prototypes fabrication should be done early this week and the parts from Digikey and Sparkfun have already shipped, so hopefully by the end of the week, I will have everything and start to assemble the first shield and then it should be easy to give it a try! I probably need to start working on my ServoEx library for the Chipkit.

Today I verified that with a simple #define change in the configuration header file, I can build the code for both my THR-4 robot that has an SSC-32 and for the CHR-3 that does not. Currently I am testing with Seeeduino Mega/prototype shield on the CHR-3 and a beta Botboarduino board on the THR-4 and it looks like most things are running.

In case anyone is interested, I am uploading a checkpoint of the current stuff… I am running all of this on Arduino 1.0 IDE.

Maybe next will be to create new input class, like I mentioned earlier. Or maybe I need to add (optionally) in the Servo zero point code for the SSC-32. I already have it in place for non-ssc32 as I needed a way to set it.

Kurt
PS2X_lib.zip (15.4 KB)
ServoEx.zip (9.6 KB)
Arduino_Hex_no_ssc32-120318b.zip (80.4 KB)