Quadruped electronics and program help

Hello everyone !

About a month ago, i was thinking about making my 1st quadruped so i started drawing around in autocad, i browsed through different robots to get an idea of how i can build a good design and finally im done!. I got all my custom parts laser-Cnc’d and ready to be built also got 16x Hitec mighty mini (yep, 16 = 4 each leg ) ready for assembly. now the final step for is it to determine the right components to use on my quadruped and i got my mind set on these :

-Bot Board II
-Basic Atom Pro
-PS2 wireless controller set (controller + receiver)
-and maybe an 3axis Accelerometer (not sure yet)

I could use some advice on whether the parts i chose are good or there are better/easier to program boards ( like ssc visual sequencer), also i was looking around for a tutorial on how to making gaiting codes but no luck so far,im running out of time at the moment and have to go, ill keep looking when im back :slight_smile: .

Thanks for help in advance :slight_smile:

Well you’ll definately need the Bot Board II and the Atom Pro to make a robot that just follows some programmed commands (I’ve just finished making my quadruped and I’m only using a Bot Board II and the Atom Pro 28 pin IC - viewtopic.php?f=8&t=7632) but if you’re thinking about remote control, then you’ll need the SSC-32 and the PS2 wireless controller set.

I’m not too sure that you’ll need the 3-axis accelerometer because if my knowledge is correct, an accelerometer only tells the IC what position the robot is in (i.e. if you set is at zero when a biped is standing up and it falls over, the accelerometer will tell the circuit board that you’re in a different position either negative or postive depending if you’ve fallen on your front or back and then the IC executes a programmed command making the robot pick itself up again). I hope that’s right, I haven’t had much experience with accelerometers. :frowning:

Hope this was helpful! :mrgreen:

1st off all, thanks for the reply :smiley:

ill be using the accelerometer so that the robot can deal with inclined surfaces and to rotate the legs upside down when he is upside down himself. what about the code you’re using ?, any link to a coding guide would be appreciated :slight_smile:

Edit: i looked around google for PS2 wireless set and SSC-32, i dont think you can attach the receiver for the wireless controller unless the SSC is mounted with a bot board, i dont think ill need SSC-32 since i have only 16 servos.

As far as the coding goes, I’ve just used the command “hservo” and then added the appropriate angles to make the servos rotate the required amount. The code that I’m using should be on the link for my project.

I see why you’re using the accelerometer but I’ve only used a two axis one so I’m sorry I can’t help there. I would reccomend that you check out some posts on the wireless control stuff just to be sure.

Would it be possible for you to share some designs for it, I’m just curious about what it’s going to look like. Thanks.

I saw your code in your project page, it looked rather long and really not sure what each line did, ill have to check some code guide about basic atom to figure it out :stuck_out_tongue:, About the design, well, at the moment all i got is pieces of sheet metal cut in different shapes,i dont think anyone will be able to understand the design untill i weld some parts together and assemble the whole buddy, ill weld them this sunday i hope. Ill post the whole project when im done with pictures and videos, Stay Tuned ! :smiley:

Welding the parts together? Interesting…

I’m sorry about the code, it is quite confusing but I learnt a lot about programming from the first kit I purchased from Lynxmotion - the Biped BRAT.

I just went through the Basic Micro syntax manual and they give you a list of the different commands with some examples (the manual can be downloaded from the Basic Micro website). I’ll try to explain some of the code so that it makes some sense :mrgreen: :

[code]main

command = 5
gosub move
pause 2500

command = 2
for xx = 1 to 3
gosub move
next[/code]

The command “main” means that you are now in the main part of the code where you will have all the commands. The part where it says “command = 5” just means that it is executing the command number 5 (which I’ll talk about in a minute) and then the “gosub move” gets the data (which in this case are angles) from command number 5 and does them. You can probably guess the “pause” command means wait for a specified amount of time which in this case is 2500ms or 2.5s.
The part where it says “for xx = 1 to 3” simply means repeat command number 2, 3 times (so xx = 1 to 5 would mean repeat the command 5 times).

move: if(command = 1) then ;WALK FORWARDS ;First Step - Top Right and Bottom Left hservo [p0\2000\200,p1\3000\200,p2\3000\200,p3\-2000\200,p4\0,p5\0,p6\-2000\200,p7\0,p8\0,p9\2000\200,p10\-3000\200,p11\-3000\200,p12\1500\200,p13\6500\50] pause 175 hservo [p0\4000\200,p1\3000\200,p2\3000\200,p3\-2000\200,p4\0,p5\0,p6\-2000\200,p7\0,p8\0,p9\-4000\200,p10\-3000\200,p11\-3000\200,p12\-1500\200,p13\6500\50] pause 175 hservo [p0\4000\200,p1\1000\200,p2\0,p3\-2000\200,p4\0,p5\0,p6\-2000\200,p7\0,p8\0,p9\-4000\200,p10\-1000\200,p11\0,p12\1500\200,p13\6500\50] pause 50

The command “move” just means that you are moving with respect to these angles. Also, anything text with a semi-colon (:wink: before it means that it is just text and it won’t affect the code (sort of like a memo or a note). The part where it says “if(command = 1) then” just allows the IC to know what to do when that command is called. The command “hservo” tells the IC that you are now dealing with servos. You then have to check which servos are connected to what pins and then type in the number of degrees that you want it to turn (e.g. if a servo connected to pin 0 (p0) was to be turned by 35 degrees, then you would type in the following line of code:

hservo [p0\3500\200] - the first number is the angle and the second is the speed (how fast you want it to rotate). As for all the brackets ] and and the \, they are just syntax things so you just have to stick them in where required. For a negative angle, you just stick a - sign in front of the angle). That’s the basics more or less for a very simple level of programming!

I hope this was helpful (and didn’t confuse you too much)! :smiley:

Thanks for all the info, and no its not too confusing :slight_smile:. i have enough experience in programming to figure out the basic commands like IF and for…next, but i guess ill have to check basic micro for the new codes x) . Got a couple of question at the moment , At a single hservo command, will all the servos in the argument move simultaneously or one at a time ?

second question, you mentioned negative angles … as far as i know servos go from 0-180 or 0-360 ( never really heard of a negative angle :stuck_out_tongue: ) so are the angle specified in the hservo argument relative to the current angle of the servo ? like if the servo is at 90 degrees and i wrote " hservo [p0-1000\200] " it moves to 80 degrees.

thats all, Thanks again for your active help :smiley:

Answer to question 1: All the servos in the hservo command bracket will all move at the same time (e.g. hservo [p0\0,p1\0] would move the servos connected in p0 and p1 simultaneously).

Answer to question 2: You’re right servos do move in total by 180 degrees but that is 90 degrees in the positive direction and 90 degrees in the negative direction (see image below):

Servo_Angle_Schematic_180_3.8.jpg

So a positive angle will make it move from 0-90 degrees to the right and a negative angle will make it move from 0-90 degrees on the left.

Say if the servo was at +50 degrees and you told it hservo [p0-3000\200] it would move by -30 degrees making the new angle +20 degrees.

I hope this cleared up a few things!

P.S. No problem, I’m always happy to help! :mrgreen:

Thanks alot for the info buddy :slight_smile:, all thats left now is ordering the goods, they’ll arrive in a week approx. Ill post the complete work when im finished :smiley:.

Good luck with your projects :slight_smile:

Thanks, good luck to you too! :mrgreen: