View unanswered posts | View active topics It is currently Thu Jul 24, 2014 2:04 am






Reply to topic  [ 6 posts ] 
Segway 
Author Message
Rookie

Joined: Tue Feb 02, 2010 6:38 am
Posts: 1
Post 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
Profile
Rookie

Joined: Tue Feb 02, 2010 4:59 am
Posts: 3
Post Re: Segway
Same question: a program to balance the robot with RobotC....
Please


Tue Feb 02, 2010 8:15 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Tue Feb 02, 2010 4:59 am
Posts: 3
Post Re: Segway
No, it's not. It is my own initiative.


Wed Feb 03, 2010 5:13 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Tue Feb 02, 2010 4:59 am
Posts: 3
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.