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

Ford Prefect

Guru

Joined: Sat Mar 01, 2008 12:52 pmPosts: 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).

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

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 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

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 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:

//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] = true

while(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 }

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

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

123girr

Rookie

Joined: Wed Oct 09, 2013 3:55 pmPosts: 19

Re: Segway Robot

To JohnI 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.

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