I printed my own little Makerbot Minion a while back and was talking with Grog about making him a very simple Biped to test a Biped MRL service with. As of now I have to keep him tethered via USB until I work out the power issues I was having.
Below is the basic sketch I have loaded in him. It's mostly the sketch included on the thingiverse page but I also fixed some of their bad math that cause him to walk in a circle rather than straight. I've hard coded the throttle and steering variables that would normally get set by the 2 channels on the RC input. I added a Hop() function but I never tested it. It might work, might just make him stand on his "knife edges" or it might just be a good way to make him fall over.
// Simple Walk 2// this sketch is an evolution of simple walking program for the Minion// it moves towards the directon of estabilshing some basic control// Functions are as follows .../// Rest() Which will start moving the Minion back to a level position but the steering will still be taken into account. Looping on this will most likely be required to come to full rest position./// Walk() Which will start a sequence to walk forward or backward and is controlled by the throttle and steering. A full step sequence may require looping over this function multiple times depending on th value of the throttle./// Hop() Which will attempt to make the Minion hop in place from a flat footed position. Effectiveness of the hop will mostly depend on the speed of your servos and the weight of your Minion.#include <Servo.h>Servo lfoot; // create servo object to control Left FootServo rfoot; // create servo object to control Right FootServo lleg; // create servo object to control Left LegServo rleg; // create servo object to control Right Legint hip = 90; // variable to store the hip servo positionint ankle = 90; // variable to store the ankle servo positionint hipstep = 10; // degree of movement of the hipsint anklestep = 5; // degree of movement of anklesint sequence = 0; // variable to store current state of walking sequenceint walktime = 0; // variable to store delay untill next step sequence// Here's where we'll keep our channel valuesint ch1; //input value for throttleint ch2; //input value for steeringint throttle = 0;int steering = 0;//Setup commandsvoid setup(){//Blink the LED on startup to detect reset during operationint led = 17;pinMode(led, OUTPUT);digitalWrite(led,HIGH);delay(1000);digitalWrite(led,LOW);pinMode(2, INPUT);// ch1 pins for pulsein to receve from rc remotepinMode(3, INPUT);// ch2//hips.attache(4);//waist.attach(5);rfoot.attach(6); // attaches right foot to pin 6rleg.attach(7); // attaches right leg to pin 7lfoot.attach(8); // attaches left foot to pin 8lleg.attach(9); // attaches left leg to pin 9//get into rest position to startrfoot.write(ankle);lfoot.write(ankle);rleg.write(hip);lleg.write(hip);}//Primaty loopvoid loop(){ch1 = pulseIn(2, HIGH, 25000); // Read the pulse width ofch2 = pulseIn(3, HIGH, 25000); // each channelif(ch1 == 0, ch2 ==0){ // centers input values if pulsein times out, for when remote is disconectedch1 = 1400;ch2 = 1400;}//throttle = map(ch1, 800, 2000, 0, 20);throttle = 11;hipstep = throttle;anklestep = (throttle / 2);//steering = map(ch2, 800, 2000, 0, 40);steering = 20;// if(throttle == 10){// Rest();// }// else{Walk();// }delay(15); // delay for servo to get in possiton. this needs to be replaced with some type of counter function}//Functionsvoid Rest() //function to return the walker to rest configeration from any possable state{sequence = 0; //reset the walk sequenceif((ankle >85)&&(ankle <95)) // Need this check in case the ankle is less than 5 degrees from 90 otherwise the ankles will occilate{ankle = 90;rfoot.write(ankle);lfoot.write(ankle);}if(ankle < 90){rfoot.write(ankle);lfoot.write(ankle);ankle = ankle + 5;}if ( ankle > 90){rfoot.write(ankle);lfoot.write(ankle);ankle = ankle - 5;}if ((hip > (70 + steering - 10))&&(hip < (70 + steering + 10))) // Need this check in case the hips are less than 10 degrees from 70+steering otherwise the hips will occilate{hip = 70 + steering;rleg.write(hip);lleg.write(hip);}if ( hip < (70 + steering)){lleg.write(hip);rleg.write(hip);hip = hip + 10;}if ( hip > (70 + steering)){lleg.write(hip);rleg.write(hip);hip = hip - 10;}}void Walk() { //Function to allow the robot to walk forwards and backwardsif(sequence == 0) // Rotatates both ankles to lift right foot{if(ankle <= 105){ // checks to see if ankle is at 90+15 degrees not 135 degreesrfoot.write(ankle);lfoot.write(ankle);ankle = ankle + anklestep;//lleg.write(hip + steering);//rleg.write(hip + steering);if(steering < 20)lleg.write(hip + steering);if(steering > 20)rleg.write(hip + steering);}else{if(throttle >= 10){sequence = 1;}else{sequence = 3;}}}if(sequence == 1) // Rotatates both hips to move right foot{if(hip >= 45){ // was 25. checks to see if hips are at 45 if not they are moved by the amount dictated in hipsteplleg.write(hip);rleg.write(hip);hip = hip - hipstep;}else{ //once we reach 45, the sequence number is updated to 2if(throttle >= 10){sequence = 2;}else{sequence = 0;}}}if(sequence == 2) // Rotatates both ankles to lift left foot{if(ankle >= 75){ // checks for ankles 90-15 degreeslfoot.write(ankle);rfoot.write(ankle);ankle = ankle - anklestep;//rleg.write(hip + steering);//lleg.write(hip + steering);if(steering < 20)lleg.write(hip + steering);if(steering > 20)rleg.write(hip + steering);}else{if(throttle >= 10){sequence = 3;}else{sequence = 1;}}}if(sequence == 3) // Rotatates both hips to lift right foot{if(hip <= 135){ //was 115lleg.write(hip);rleg.write(hip);hip = hip + hipstep;}else{if(throttle >= 10){sequence = 0;}else{sequence = 2;}}}}void Hop() { //function to attempt a bunny hop in place by rotating the outside edge of both feet down quickly.// Ready .....lfoot.write(90);rfoot.write(90);rleg.write(90);lleg.write(90);delay(15);// Jump!!rfoot.write(0);lfoot.write(180);delay(15);// Brace for impact!rfoot.write(90);lfoot.write(90);delay(15);}
The next step is to slap MRLComm on the arduino ProMicro and convert that sketch to Python in MRL. After that it will be a Biped service.
Found the Poser software here
Found the Poser source code here - http://www.projectbiped.com/prototypes/fobo/poser
Of course... he has excellent documentation
RobotFreak @ letsmakerobots - already did a derivative for Bob http://letsmakerobots.com/node/38483
I think I'd like to port it to Java & MRL
I think the "frame" maker is
I think the "frame" maker is an interesting idea. In MRL currently the frames are part of Python functions, and Python supports more complexity, but a gui/frame maker might be a nice thing for people not quite comfortable with scripting... And if your only doing servo positioning it could aid in rapid prototyping.
We already have sliders for Servos & the servo guis allow them to undock and for many of them to be viewable at once. I think this might all be generalized to a multi-purpose Servo Frame Maker service... albiet rather lame name :)
Does the usb cord coming out
Does the usb cord coming out of his derierre affect his walking much ?
not really
When I tether him, he tends to have his skull cap off and his brains dragging on the ground behind him. :) Zombie Minion!
hey kmc, this bot looks cute
hey kmc,
this bot looks cute :)
have you designed this? do you have the files for printing this??
hey, just found the
hey, just found the thingiverse link :) I might make one too....
Blinking Bot
One of us really need to make the eyelid blink on this bot. That would be the final touch.
Cool Beans thanks for sharing Keith.