|
Page 1 of 1
|
[ 6 posts ] |
|
Author |
Message |
gcelia
Rookie
Joined: Tue Feb 02, 2010 6:38 am Posts: 1
|
 Segway
Hello, I am working with RobtC on a segway, and I don't know how to do to keep the robot in balance; I think that I must use for this the gyroscopes. Any one for help? Thanks.
|
Tue Feb 02, 2010 6:43 am |
|
 |
hdima
Rookie
Joined: Tue Feb 02, 2010 4:59 am Posts: 3
|
 Re: Segway
Same question: a program to balance the robot with RobotC.... Please
|
Tue Feb 02, 2010 8:15 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Segway
Is this a homework assignment?
Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Tue Feb 02, 2010 8:19 am |
|
 |
hdima
Rookie
Joined: Tue Feb 02, 2010 4:59 am Posts: 3
|
 Re: Segway
No, it's not. It is my own initiative.
|
Wed Feb 03, 2010 5:13 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Segway
Did you Google for it? As far as I know there are several Segway-like robots on the Net that use ROBOTC. I believe there are even a couple on these forums.
Regards, Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Wed Feb 03, 2010 5:15 am |
|
 |
hdima
Rookie
Joined: Tue Feb 02, 2010 4:59 am Posts: 3
|
 Re: Segway
Of, course; It's the first thing that I did. I found also codes in this forum, like this one, but I don't understand them. Can you please explain it to me?
task main(){
int ng, gn=590, nw=0, rp=0, rg, lrp=0, rwi=0, md; bFloatDuringInactiveMotorPWM=true;
while(true){
ng=SensorRaw(S1)-gn; nw+=ng; //robot angle rp=nMotorEncoder(B); //wheel position rg=rp-lrp; lrp=rp; rwi+=rg; //wheel speed if (abs(rwi)>15){
gn-=sgn(rwi); rwi=0;
} //Gyro drift comp. md=(nw+ng*12+rp*5+rg*360)>>5; //pd contr. RXC large wheels md=(nw+ng*10+rp*4+rg*200)>>4; //pd contr. NXT small wheels md+=sgn(md)*48; //friction compensation motor[motorB]=motor[motorC]=md; wait1Msec(10); //while loop
}
|
Thu Feb 04, 2010 2:03 am |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|