Lolz, this is going to be a fun project, not to mention I need to have it done to graduate. My robotics teacher has been making jokes about a segway for two years now.I am using a two motor robot with the vex built in accelerometors. This is the code I have so far.

Sorry, my html skillz aren't very good, so you are just going to have to deal with not knowing the indents. (Hint: I put a bracket whenever I indent.[{}])

Wed Oct 09, 2013 4:14 pm

mattallen37

Expert

Joined: Thu Sep 29, 2011 11:09 pmPosts: 184Location: Michigan USA

Re: Segway Robot

BTW, these forums don't use HTML for formatting. They use BBCode.

Try using the code tags:

Code:

[code][/code]

_________________Matt

Wed Oct 09, 2013 5:35 pm

123girr

Rookie

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

Re: Segway Robot

Oh, thanks for the tip.

Sun Oct 27, 2013 5:03 pm

123girr

Rookie

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

Re: Segway Robot

Working on building a more sturdy robot that can actually hold a person on it. It's going to have 3 wagon wheels, (my mentor felt it would be easier/cheaper to use 3 and have it be sturdy rather than 2 and have people falling over) 2 bigger motors from the first robotics team at my school, and just a vex cortex with the controller for the accelerometers. I am open to any ideas that some person might have. I'll record how it works and post it on youtube.

Tue Oct 29, 2013 4:01 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Segway Robot

123girr wrote:

Lolz, this is going to be a fun project, not to mention I need to have it done to graduate. My robotics teacher has been making jokes about a segway for two years now.I am using a two motor robot with the vex built in accelerometors. This is the code I have so far.

I would be really surprised if this code works. Would you tell us how you mounted the accelerometer? Which axis is up/down, which one is forward/backward, which one is sideway? I can't interpret your code without that info.

And yes it does work. I used a basic joystick control program and just replaced the Ch# with the AccelX&YI am going to have it mounted to a pole off of a base. I don't think they need it to be life sized or even 2 wheeled and I don't want to spend however much for an extra gyro to keep it up straight. Currently though, I am just holding it and having fun with a clawbot.

And yes it does work. I used a basic joystick control program and just replaced the Ch# with the AccelX&YI am going to have it mounted to a pole off of a base. I don't think they need it to be life sized or even 2 wheeled and I don't want to spend however much for an extra gyro to keep it up straight. Currently though, I am just holding it and having fun with a clawbot.

Your code does not show what AccelX and AccelY are. Are they the channels where you connected the X and Y axes of the accelerometer to? If so, the code seems way too simple. I would expect at least some sort of scaling of the raw accelerometer values before you can apply to the motor powers. I am not familiar with VEX, so I can't imagine how this code could work. Would you mind explaining your code and the configuration?Also, what do you mean by not keeping it up straight? If the robot has more than 2 wheels or cannot balance by itself, it is not a Segway.

Tue Dec 03, 2013 12:03 am

Ford Prefect

Guru

Joined: Sat Mar 01, 2008 12:52 pmPosts: 1030

Re: Segway Robot

AccelX and AccelY sound like accelerometer data (pls CMIIW). I honestly doubt that it would be possible ever to program a Segway-like self-balancing robot using just accelerometers. It simply doesn't exist a mathematical model for balancing an inverse pendulum (like a segway) by acceleration data neither by a formula nor by control and regulation loops.OTOH there are lot of models which work with different sensors, e.g., distance sensors, but the best approach certainly is using a gyroscope.

Well, couldn't you technically figure out the orientation of the pendulum by combining the x- and y- axis acceleration values, since gravity? Assuming the thing is oriented correctly, of course. It's waaaay more difficult than just using a gyro though

There is a sample project on the new EV3 called Gyro Boy. It is a Segway bot that uses just the gyro. So it is possible.

Wed Dec 04, 2013 2:28 am

123girr

Rookie

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

Re: Segway Robot

Yes, AccelX and AccelY are referring to the built in accelerometors in the vex joystick. Also, if you read my earlier comments, It is going to have four wheels. I don't need to worry about balancing it. A gyro is a bit out of my budget ($0).

Wed Dec 04, 2013 4:11 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Segway Robot

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).

Wed Dec 04, 2013 4:16 pm

Ford Prefect

Guru

Joined: Sat Mar 01, 2008 12:52 pmPosts: 1030

Re: Segway Robot

correct.a segway is a balancing bot. No balancing - no segway.by 4 wheels it's just a car.

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