View unanswered posts | View active topics It is currently Sat Dec 14, 2019 9:03 am

 Page 2 of 2 [ 23 posts ] Go to page Previous  1, 2
 Print view Previous topic | Next topic
Segway Robot
Author Message
Guru

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Re: Segway Robot
ok, then it's probably not even a car

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)

Thu Dec 05, 2013 3:36 am
Rookie

Joined: Wed Oct 09, 2013 3:55 pm
Posts: 19
Re: Segway Robot
WOW! People with your semantics, it's just a senior project that I want to do for fun.
Does it have to be two wheeled to be posted on RobotC? I'm a poor man without a job atm using a schools vex kit! Give me a break!

Fri Dec 06, 2013 5:15 pm
Guru

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Re: Segway Robot
my reply was just to Ernest3.14.
You called the topic "Segway robot" - that's a fixed term. But MHTS already wrote what it's actually about:
MHTS wrote:
 123girr wrote:It is going to have four wheels. I don't need to worry about balancing it.

Then it is not a Segway robot. It sounds like you are just using the accelerometer as a controller (i.e. tilt it forward and the robot goes forward ... etc).

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)

Fri Dec 06, 2013 5:54 pm
Rookie

Joined: Wed Oct 09, 2013 3:55 pm
Posts: 19
Re: Segway Robot
I GET IT!!! Regardless, it's my project, my discussion, my idea, and your semantics. Can I not call it what I want?
If you have something to say, let it be about the code.

Tue Dec 10, 2013 4:13 pm
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Re: Segway Robot
I am sorry you got upset about our replies. For me, I was just trying to learn something from the forums. Segway robot is one of the things I wanted to learn more about. So when I saw the title, I was excited to read about it. But the description of your project doesn't match what I have in mind. That's why I was inquiring about it. It is not meant to be any criticism.

Tue Dec 10, 2013 4:26 pm

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Re: Segway Robot
Let's get this back on track

Would you be able to post a picture of the robot (if possible)? This will help us to determine what type of code you will need to run, exactly. For a basic, four-wheeled drive example, you should be able to simply add the extra motors and map them to the correct Joystick Accelerometer values:

 Code:  while(1)   {      bmotorflippedmode[port1] = true      bmotorflippedmode[port10] = true                     //Both my motors are upsidedown :D      motor[port1] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the front right motor      motor[port10] = vexRT[AccelY] - vexRT[AccelX]; //Assuming this is the front left motor          motor[port2] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the rear right motor      motor[port9] = vexRT[AccelY] - vexRT[AccelX]; //Assuming this is the rear left motor   }

Now if you wanted to get a bit fancier you can; for example you could adjust the front/rear motor values depending on the encoder values each are returning, to give them a more 'even' speed value:

 Code:        //These can be moved outside of the infinite loop, as they only need to executed once in the program      bmotorflippedmode[port1] = true      bmotorflippedmode[port10] = truewhile(1)   {           //This assumes both the rear and front right wheels have encoders attached     //If the two are traveling at the same speed     if(SensorValue(frontRightEncoder) == SensorValue(rearRightEncoder))     {     //Assign the same motor value      motor[port1] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the front right motor      motor[port2] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the rear right motor     }   //If the front is moving faster than the rear   else if(SensorValue(frontRightEncoder) > SensorValue(rearRightEncoder))    {      //Increase the rear motor's speed      motor[port1] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the front right motor      motor[port2] = vexRT[AccelY] + vexRT[AccelX] + 5; //Assuming this is the rear right motor    }   //If the front is moving slower than the rear   else if (SensorValue(frontRightEncoder) < SensorValue(rearRightEncoder))   {      //Decrease the rear motor's speed      motor[port1] = vexRT[AccelY] + vexRT[AccelX]; //Assuming this is the front right motor      motor[port2] = vexRT[AccelY] + vexRT[AccelX] - 5; //Assuming this is the rear right motor   }   //Repeat process for left motors}

Now this code isn't perfect by any means (it is also assuming one encoder on each wheel), but it is a good start for gaining 'finer tuned' control of the robot. You can really expand on the robot depending on what sensors you have available, what you would like for it to do, etc; the more information you are able to provide on your particular robot, the better we will be able to assist you (for instance, a listing of what sensors/motors are plugged into what ports, what you have available to use, etc).

Edit: Side note for explanation: the accelerometer values used here are from the VEXNet Joystick Controller itself, not from a sensor plugged into the Cortex. There is a 3-axis accelerometer built into the VEXNet Joystick Controller which can be used in lieu of (or tandem with) the physical joysticks to control a robot: http://www.robotc.net/wiki/VEX2_Functio ... net#AccelX

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

Tue Dec 10, 2013 4:50 pm
Rookie

Joined: Wed Oct 09, 2013 3:55 pm
Posts: 19
Re: Segway Robot
 MHTS wrote:I am sorry you got upset about our replies. For me, I was just trying to learn something from the forums. Segway robot is one of the things I wanted to learn more about. So when I saw the title, I was excited to read about it. But the description of your project doesn't match what I have in mind. That's why I was inquiring about it. It is not meant to be any criticism.

If this is the case, then why do you say things like "Its not a segway" and "I would be supprised if this code works"?

Tue Jan 07, 2014 5:19 pm
Rookie

Joined: Wed Oct 09, 2013 3:55 pm
Posts: 19
Re: Segway Robot
To John
I took the robot apart in frustration and absorption in another project, but the final robot is going to look something like this:
--|--
|
|
|
|
||-----||
This is a piece of crap for presentations, but it will work (maybe).
For my purposes, the code I posted at first will work fine.
My Robotics teacher wants his supplies to survive as long as possible, and he won't let us stand on it because he is scarred it will burn out the motors (I highly doubt it though). I will just need to make a little joystick for being off my bot, then I could control it while I'm off of it. I won't need any gyros because, like I said, its 4 wheeled. Also, for your program, it is a two motored robot, and I plan to keep it that way. Neither have encoders on them, and I was hoping that I could just make it go at a custom speed based on the position of the robot. As for "fine tuning" it, I don't think I need to do that.

Tue Jan 07, 2014 5:34 pm
Display posts from previous:  Sort by
 Page 2 of 2 [ 23 posts ] Go to page Previous  1, 2

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning