Botboarduino JR

Sounds great. It’s amazing that you have the Jr replacing the Atom Pro! Forwarder sounds awesome as well! That’s so cool! Ooh - too many !'s lol Looking forward to the video if you can manage it. Thanks so much! Oops did it again. :slight_smile:

Sorry I missed this. Any port in a storm will be fine. :wink: Alan, maybe… He seems knowledgeable, but sometimes he just doesn’t get the simplest things. LinuxGuy… I sent him $600.00 worth of stuff in hopes of some code, and received back nothing. Not even a thank you. That was a few years back. Maybe Alan if we can’t find a more suitable candidate.

One of the next things I am going to play with the Arduino, is my earlier Brat code. I have not tried it in awhile and probably needs lots of work. But just in case someone gets to it before me, here is a checkpoint of my current code.
Arduino_Brat-110804a.zip (15.9 KB)

Here’s the code you wanted kurte
exampe_for_kurte.pde (1.31 KB)

Yep it shows there is an issue… Looks like I will play with this first before rearranging my own code.

There are some obvious things with the test program, that I would change for real code. Example You don’t need to keep setting the servo position in the loop. Also it is calling the PS2 approximately every 2.3ms. But it looks like the servo code is losing it’s down … Will investigate more. Also will probably double post this up on the forum that the PS2 library guy first posted the library…

Kurt

I am pretty sure I know what the problems are. In particular the PS2 code uses some macros: Set/CLR that look like:
#define SET(x,y) (x|=(1<<y))

I have not totally verified that, but my guess is that these functions are not atomic and use something the SBI or CBI, but instead probably fetch the current value from the IO register (value for up to 8 IO pins), than it sets the appropriate bit and then stores the value back out. But the problem is that the servo function also may set some of these IO bits. So if the interrupt happens after the value is fetched by the PS2 code but before the new value is stuffed out, the PS2 code will tromp on whatever the Servo code did to those 8 IO pins…

Hope that makes sense.

Fix is either to change the Set/Clr functions to somehow use atomic operations (pain, could do a branch on the different IO pins) or to disable interrupts duing the Set/CLR… Easier, but will slightly impact interrupts…

Kurt

OK, I did a quick hack to the PS2 code. I did not update the Init code only the read… My Logic Analyzer output looks a lot better now. Give it a try and see if it works for you…

The files need to go into your Arduino Libraries folder… Note: I only updated the .CPP file and all of the changes have *** KJE *** in the comment

Kurt
Partial Fix PS2X_LIB.zip (15 KB)

The jitter is not nearly as bad but it’s still there.

OK I wrapped more of the calls in cli (restore last interrupt status) calls and then tried my Brat that I have an Seeeduino Mega and version 1 of the Botboarduino Mega shield on it. It appears to be working a lot better than my earlier try. Not saying it is perfect, but it looks like this helps quite a bit.

I did not get very far with my debugging of this setup earlier as I thought it was maybe due to bad connections on my shield… Try it out on the Jr board and see if it is working better. Probably could still be a few (probably lots :laughing: ) of bugs in my code. Also need to check my own code to make sure that I don’t have a bunch of debug code screwing up stuff. (things like setting IO pins high or low), debug output…

It is also possible my own interrupt handling is causing some jitters, so need to investigate a little there.

My problem right now is, several things I would like to play with, like:

:smiley: :smiley: :smiley:

Not sure, but maybe I should unshiny the cover with Sandpaper or something? Now I need to get a few parts to put it together, like some screws to hold the keypad, display, … Switches, Power jack, battery… But that is off topic here :slight_smile:

Kurt
Partial Fix PS2X_LIB.zip (15 KB)

I have been playing around some more with my Brat code and changed a few things.

In particular, I changed my interrupt handler for the group move to enable interrupts pretty quickly so it would not hang up other interrupt handlers. Also added defines for which digital pin is connected to servos… Also added some code that if you define an Analog pin for voltage checking, if the voltage drops below a value you set, it will turn off the servos and play a sound. This is to keep from having it when I turn off robot power it still tried to run the servos on USB which can cause problems…
Arduino_Brat-110808a.zip (16.4 KB)

Not that it is a great video. But here is my CHR-3 running with a BBDuino Jr and SSC-32, PS2…

It is using my merge of the beta code. What do you think? Should I also post this in the BBDuino forum. Or wait until we have a BBDuino JR board to go with it…

Kurt

Sweet! Please feel free to post on the public side. The first 3/4 of the video is great. Seams like the very last part the body was too low, or the legs weren’t lifting enough. But it’s definitely good enough to post. Yesterday we got the mandibles for A-Pod working with pressure sensor feedback with the Botboarduino Jr. I’m having Devon post there too with this little teaser. :smiley: I think I can have boards in 4-6 weeks, so I’m interested in creating as much interest as possible. Thanks man!

PS your A-Pod will be sent to you as son as I receive all the laser cut parts. They are cutting them now! :open_mouth:

One more thing. Now that I have tested the new ground sensing tibias I am making one that would fit onto your CH3R. I will send them as soon as I get parts. 8)

Thanks Jim can’t wait!

The last bit was me trying the turn on Balance mode, which in many of the gaits always looks a bit off to me. But at least with the current code it does not tie the robot into a pretzel like the last code I publicly posted. I was also thinking of posting some Brat stuff as well. I currently have it running on the Seeeduino Mega/BB Shield, but should work on BBDJR as well, but I have let the Hex hog it. Would it be better to now move it to the brat before posting stuff about brat?

Kurt

P.S. - Sounds great for CHR-3 :smiley:

I would focus on Jr. publicly for now. The mega stuff is a bit farther down the road. :frowning: Thanks for your support!

Ahh, balance mode works the best with the tripod gait, slowed down a few clicks, and lift the body up more so the femur is more horizontal. Then it will look awesome. Try it to see what I mean. :wink:

I understand get stuff working with JR… I posted a little about a the brat up on the main forum… Have not posted the updated code.

Here is a snapshot in case anyone wishes to play some more :smiley:

Will probably have to hook up Mega to try out the ballance mode as JR is now in the brat.

Kurt
Arduino_Brat-110821a.zip (16.9 KB)

Cool thanks! I will get you some of the new boards when Mike gets them working. :smiley:

Sounds good.

Keeping busy!

Kurt

Thanks for posting the video Kurt!
It looks great and seem to perform very fine. :smiley:

Looks like some values are a bit off maybe? Some legs seem to skid along the ground (look at 00:40)?