Dynamic balancing DIY biped robot

Discussions regarding building a walking robot at home. Most of the robots participating at Robo-One competitions are custom fabricated.
9 postsPage 1 of 1
9 postsPage 1 of 1

Dynamic balancing DIY biped robot

Post by VaulB » Tue Jun 09, 2009 8:26 pm

Post by VaulB
Tue Jun 09, 2009 8:26 pm

Hello everyone

I have recently started learning pic programming by C. My idea is to make a robot that is aware of its surroundings. Idea is to use as few preprogrammed loops as possible. It should learn and adapt it's surroundings. I'm pretty sure that 16F series has not enough "power" to accomplish this, but it's a start alright.

Here is the robot now.
http://www.youtube.com/watch?v=veDoZpiGuHI

It will probably needs couple more joints and more sensors. At the moment I am thinking how to make its feet to feel the ground. I have decided to use microswitches, but i don't yet know how to put them on.
Hello everyone

I have recently started learning pic programming by C. My idea is to make a robot that is aware of its surroundings. Idea is to use as few preprogrammed loops as possible. It should learn and adapt it's surroundings. I'm pretty sure that 16F series has not enough "power" to accomplish this, but it's a start alright.

Here is the robot now.
http://www.youtube.com/watch?v=veDoZpiGuHI

It will probably needs couple more joints and more sensors. At the moment I am thinking how to make its feet to feel the ground. I have decided to use microswitches, but i don't yet know how to put them on.
VaulB offline
Newbie
Newbie
Posts: 5
Joined: Tue Jun 09, 2009 7:48 pm

Post by NovaOne » Wed Jun 10, 2009 6:11 am

Post by NovaOne
Wed Jun 10, 2009 6:11 am

Hi VaulB

Good start. How many DOF do you want your biped to have.....can you control many more servos simulaneously?

What do you want your final leg kinematics to look like?

eg http://www.imp.bg.ac.yu/RnDProfile/ROBOTIKA/BipModel.htm

I am learnig C at the moment...It would be nice to see your code?

What others sensors are you going to use?
Perhaps small spring loaded potentiometers on the feet to measure how much contact they have with the ground?

Are you currently using accelerometers at all?

Please keep posting as it develops.
Hi VaulB

Good start. How many DOF do you want your biped to have.....can you control many more servos simulaneously?

What do you want your final leg kinematics to look like?

eg http://www.imp.bg.ac.yu/RnDProfile/ROBOTIKA/BipModel.htm

I am learnig C at the moment...It would be nice to see your code?

What others sensors are you going to use?
Perhaps small spring loaded potentiometers on the feet to measure how much contact they have with the ground?

Are you currently using accelerometers at all?

Please keep posting as it develops.
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by VaulB » Wed Jun 10, 2009 10:21 am

Post by VaulB
Wed Jun 10, 2009 10:21 am

I am not sure how many more servos I need. I believe four servos for one microcontroller is pretty max. For now it can't get up if it falls on its back or front, but i am able to tilt it by moving the lower servos. I thought it would be good if there would be a joint on the pelvis, that would allow to tilt middle body backwards and forwards. I can shape the back round so it will be easier for the robot to get up. The robot will not have knees because it uses exaggerated motion of pelvis to lift its feet. Same time the lower servos make it turn. The whole body kind of turns when it walks and its feet always point forward.

Now i only have one tilt sensor hooked to the robot. It's pretty clear that the robot has to see its surroundings, so some range sensors will be needed or maybe even a small camera.

I was thinking to go with the microswitches for now, but maybe later I will use force sensing resistors to do the job. Feet are actually my biggest problem now, because they tilt when the robot tilts and that causes a problem with sensing the ground. I might have to make a freely moving joint there to keep the feet pointing to the ground all time.

I don't have a page where i could upload the code, but i can send it to you. It's a pretty simple code actually...
I am not sure how many more servos I need. I believe four servos for one microcontroller is pretty max. For now it can't get up if it falls on its back or front, but i am able to tilt it by moving the lower servos. I thought it would be good if there would be a joint on the pelvis, that would allow to tilt middle body backwards and forwards. I can shape the back round so it will be easier for the robot to get up. The robot will not have knees because it uses exaggerated motion of pelvis to lift its feet. Same time the lower servos make it turn. The whole body kind of turns when it walks and its feet always point forward.

Now i only have one tilt sensor hooked to the robot. It's pretty clear that the robot has to see its surroundings, so some range sensors will be needed or maybe even a small camera.

I was thinking to go with the microswitches for now, but maybe later I will use force sensing resistors to do the job. Feet are actually my biggest problem now, because they tilt when the robot tilts and that causes a problem with sensing the ground. I might have to make a freely moving joint there to keep the feet pointing to the ground all time.

I don't have a page where i could upload the code, but i can send it to you. It's a pretty simple code actually...
VaulB offline
Newbie
Newbie
Posts: 5
Joined: Tue Jun 09, 2009 7:48 pm

Post by NovaOne » Wed Jun 10, 2009 6:43 pm

Post by NovaOne
Wed Jun 10, 2009 6:43 pm

Sounds cool.

Have you seen the robots on David Buckleys site:

http://davidbuckley.net/DB/index.htm

I think you are on a similar frequency as him. eg

http://davidbuckley.net/DB/Loki.htm

Interested to hear how you get on with FSR's.

Are you intending to go down the passive dynamic walker route: eg
http://ruina.tam.cornell.edu/research/topics/locomotion_and_robotics/papers/efficient_bipedal_robots/bipedal_walking_robot_cornell.pdf
Sounds cool.

Have you seen the robots on David Buckleys site:

http://davidbuckley.net/DB/index.htm

I think you are on a similar frequency as him. eg

http://davidbuckley.net/DB/Loki.htm

Interested to hear how you get on with FSR's.

Are you intending to go down the passive dynamic walker route: eg
http://ruina.tam.cornell.edu/research/topics/locomotion_and_robotics/papers/efficient_bipedal_robots/bipedal_walking_robot_cornell.pdf
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by NovaOne » Wed Jun 10, 2009 7:01 pm

Post by NovaOne
Wed Jun 10, 2009 7:01 pm

[quote]I don't have a page where i could upload the code, but i can send it to you. It's a pretty simple code actually...[/quote]

Just cut and paste the code into a normal message thread and mark it as code be typing [code] at the beginning and [/code] at the end
[quote]I don't have a page where i could upload the code, but i can send it to you. It's a pretty simple code actually...[/quote]

Just cut and paste the code into a normal message thread and mark it as code be typing [code] at the beginning and [/code] at the end
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by VaulB » Fri Jun 12, 2009 2:20 pm

Post by VaulB
Fri Jun 12, 2009 2:20 pm

Ok, here is the code. Some things are written in finnish :) mittaus means measurement and ajotus means timing. Kaatui mean fell down and jatka means continue. analin mean analog in. Now you know some finnish :D. I wrote this code when i was really tired so it's not the best. I think the transfer from analin to mittaus is unnecessary and maybe the delays too(i just put them there to give adc conversion some time). There is probably a better way to shift the measuring data.

#include "C:\PIC\JEEJEE\main.h"


int16 mittaus1;
int16 mittaus2;
int16 mittaus3;
int16 mittaus4;
int16 mittaus5;
int16 mittaus6;
int16 mittaus7;
int16 mittaus8;
int16 ajotus;
int16 analin;




void main()
{

setup_adc(ADC_CLOCK_INTERNAL); // ADC clock
setup_adc_ports(pin_a0);
set_adc_channel(0); // Select RA0
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
// TODO: USER CODE!!
#use delay(clock=4M)

while (1)

{ kaatui:
analin = read_adc();
mittaus1 = analin;
delay_us(4);
analin = read_adc();
mittaus2 = analin;
delay_us(4);
analin = read_adc();
mittaus3 = analin;
delay_us(4);
analin = read_adc();
mittaus4 = analin;
delay_us(4);
analin = read_adc();
mittaus5 = analin;
delay_us(4);
analin = read_adc();
mittaus6 = analin;
delay_us(4);
analin = read_adc();
mittaus7 = analin;
delay_us(4);analin = read_adc();
mittaus8 = analin;
delay_us(4);
ajotus = (mittaus1+mittaus2+mittaus3+mittaus4+mittaus5+mittaus6+mittaus7+mittaus8)/8;
goto jatka;



for(;;)
{
mittaus8 = mittaus7;
mittaus7 = mittaus6;
mittaus6 = mittaus5;
mittaus5 = mittaus4;
mittaus4 = mittaus3;
mittaus3 = mittaus2;
mittaus2 = mittaus1;
analin = read_adc();
mittaus1 = analin;;
ajotus = 1*((mittaus1+mittaus2+mittaus3+mittaus4+mittaus5+mittaus6+mittaus7+mittaus8)/8);


if (ajotus>820)
{ for (count1 = 0; count1 < 7; count1++)
{
output_high(pin_c1);
delay_us(650);
output_low(pin_c1);
delay_ms(20);
output_high(pin_c2);
delay_us(850);
output_low(pin_c2);
delay_ms(20);
}
goto kaatui;
}

if (ajotus<260)
{ for (count1 = 0; count1 <7; count1++)
{
output_high(pin_c2);
delay_us(2100);
output_low(pin_c2);
delay_ms(20);
output_high(pin_c1);
delay_us(2100);
output_low(pin_c1);
delay_ms(20);

}
goto kaatui;
}


else

jatka:
output_high(pin_c2);
output_high(pin_c1);
delay_us(1950-ajotus);
output_low(pin_c2);
output_low(pin_c1);
delay_ms(20);



}
}

}


Right now I am having a headache with the feet sensors. There are now couple of microswitches between the servo and foot in both feet. Problem is that the robot is not heavy enough to press down the microswitches in every position. It's crucial for balancing to know if your feet are on the ground. How would one walk if he didn't know if hes feet were on the ground or not :)
Ok, here is the code. Some things are written in finnish :) mittaus means measurement and ajotus means timing. Kaatui mean fell down and jatka means continue. analin mean analog in. Now you know some finnish :D. I wrote this code when i was really tired so it's not the best. I think the transfer from analin to mittaus is unnecessary and maybe the delays too(i just put them there to give adc conversion some time). There is probably a better way to shift the measuring data.

#include "C:\PIC\JEEJEE\main.h"


int16 mittaus1;
int16 mittaus2;
int16 mittaus3;
int16 mittaus4;
int16 mittaus5;
int16 mittaus6;
int16 mittaus7;
int16 mittaus8;
int16 ajotus;
int16 analin;




void main()
{

setup_adc(ADC_CLOCK_INTERNAL); // ADC clock
setup_adc_ports(pin_a0);
set_adc_channel(0); // Select RA0
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
// TODO: USER CODE!!
#use delay(clock=4M)

while (1)

{ kaatui:
analin = read_adc();
mittaus1 = analin;
delay_us(4);
analin = read_adc();
mittaus2 = analin;
delay_us(4);
analin = read_adc();
mittaus3 = analin;
delay_us(4);
analin = read_adc();
mittaus4 = analin;
delay_us(4);
analin = read_adc();
mittaus5 = analin;
delay_us(4);
analin = read_adc();
mittaus6 = analin;
delay_us(4);
analin = read_adc();
mittaus7 = analin;
delay_us(4);analin = read_adc();
mittaus8 = analin;
delay_us(4);
ajotus = (mittaus1+mittaus2+mittaus3+mittaus4+mittaus5+mittaus6+mittaus7+mittaus8)/8;
goto jatka;



for(;;)
{
mittaus8 = mittaus7;
mittaus7 = mittaus6;
mittaus6 = mittaus5;
mittaus5 = mittaus4;
mittaus4 = mittaus3;
mittaus3 = mittaus2;
mittaus2 = mittaus1;
analin = read_adc();
mittaus1 = analin;;
ajotus = 1*((mittaus1+mittaus2+mittaus3+mittaus4+mittaus5+mittaus6+mittaus7+mittaus8)/8);


if (ajotus>820)
{ for (count1 = 0; count1 < 7; count1++)
{
output_high(pin_c1);
delay_us(650);
output_low(pin_c1);
delay_ms(20);
output_high(pin_c2);
delay_us(850);
output_low(pin_c2);
delay_ms(20);
}
goto kaatui;
}

if (ajotus<260)
{ for (count1 = 0; count1 <7; count1++)
{
output_high(pin_c2);
delay_us(2100);
output_low(pin_c2);
delay_ms(20);
output_high(pin_c1);
delay_us(2100);
output_low(pin_c1);
delay_ms(20);

}
goto kaatui;
}


else

jatka:
output_high(pin_c2);
output_high(pin_c1);
delay_us(1950-ajotus);
output_low(pin_c2);
output_low(pin_c1);
delay_ms(20);



}
}

}


Right now I am having a headache with the feet sensors. There are now couple of microswitches between the servo and foot in both feet. Problem is that the robot is not heavy enough to press down the microswitches in every position. It's crucial for balancing to know if your feet are on the ground. How would one walk if he didn't know if hes feet were on the ground or not :)
VaulB offline
Newbie
Newbie
Posts: 5
Joined: Tue Jun 09, 2009 7:48 pm

Post by NovaOne » Sat Jun 13, 2009 7:18 am

Post by NovaOne
Sat Jun 13, 2009 7:18 am

Thanks for uploading the code. :)

RE:
Problem is that the robot is not heavy enough to press down the microswitches in every position.

Since you only want sensitive foot switches, (not pressure sensors), have you considered quatum tunneling composite?
http://www.mutr.co.uk/product_info.php?cPath=18_177_165&products_id=1144
Thanks for uploading the code. :)

RE:
Problem is that the robot is not heavy enough to press down the microswitches in every position.

Since you only want sensitive foot switches, (not pressure sensors), have you considered quatum tunneling composite?
http://www.mutr.co.uk/product_info.php?cPath=18_177_165&products_id=1144
NovaOne offline
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by VaulB » Tue Aug 18, 2009 12:00 am

Post by VaulB
Tue Aug 18, 2009 12:00 am

I have now decided to ditch this chassis and use lynxmotion scout instead, because it is easy to customize. It's pain in the a$$ to make servo brackets if you don't have any tools. I was more interested about the programming anyways. I wonder if the pic 16F690 can keep up with 12 or more servos + some sensors : :roll:

Does anyone know if hitec servo horns fit in sanwa and futaba servos?
I have now decided to ditch this chassis and use lynxmotion scout instead, because it is easy to customize. It's pain in the a$$ to make servo brackets if you don't have any tools. I was more interested about the programming anyways. I wonder if the pic 16F690 can keep up with 12 or more servos + some sensors : :roll:

Does anyone know if hitec servo horns fit in sanwa and futaba servos?
VaulB offline
Newbie
Newbie
Posts: 5
Joined: Tue Jun 09, 2009 7:48 pm

Post by VaulB » Fri Dec 04, 2009 4:25 pm

Post by VaulB
Fri Dec 04, 2009 4:25 pm

Well I got the scout somewhat working now. Here are the vids. Unfortunately they are a bit dark.

http://www.youtube.com/watch?v=YesBnrBGf8U
http://www.youtube.com/watch?v=CWeTtTv7U9E

I think it's wiser for me to move to lynxmotion's forum..
Well I got the scout somewhat working now. Here are the vids. Unfortunately they are a bit dark.

http://www.youtube.com/watch?v=YesBnrBGf8U
http://www.youtube.com/watch?v=CWeTtTv7U9E

I think it's wiser for me to move to lynxmotion's forum..
VaulB offline
Newbie
Newbie
Posts: 5
Joined: Tue Jun 09, 2009 7:48 pm


9 postsPage 1 of 1
9 postsPage 1 of 1