ROBOTC.net forums
http://www.robotc.net/forums/

VEX/Robotc balancing robot with new video and code
http://www.robotc.net/forums/viewtopic.php?f=15&t=4182
Page 1 of 1

Author:  hmoor14 [ Mon Jan 30, 2012 6:32 pm ]
Post subject:  VEX/Robotc balancing robot with new video and code

Here is the robot I made from VEX parts and robotc:

Robot in action: http://youtu.be/iTceFfr1_Ss

Closeup of the robot parts (actually not much to it:) http://youtu.be/VKmyDMTzyBE

I've attached my robotc code and also the scilab code i used for design and simulation.

One of the problems i'm having is getting data from the live robot when it is moving.
I used the debug stream to test the individual parts but that's not practical with the real time system. (I crashed the bot trying!)
If anyone has any ideas on this, i sure would appreciate it!

Attachments:
scilab_code.zip [1.91 KiB]
Downloaded 1161 times
robot_2w_12.c [8.37 KiB]
Downloaded 1348 times

Author:  sumasmreq [ Tue Jan 31, 2012 2:33 am ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Wow, that is really cool!
What kind of control feedback loop are you using? It looks like a Derivative controller, but I'm not sure. Have you considered using a PID Controller? Would that be suitable to this application?
Also, good code comments! Try to use more descriptive variable names if you can though ;-)

Good job overall, though, with building a VEX Segway! I don't think I've ever seen one made with VEX parts before.
P.S. You have a ton of PWM cables! :-)

Author:  hmoor14 [ Tue Jan 31, 2012 8:23 am ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Before I started this project, I looked at the "inverted pendulum on a cart" problem in which there is a ton of stuff on the net. Well, one of the articles "http://www.engin.umich.edu/group/ctm/examples/pend/invPID.html", showed PID control for the problem and its shortcomings. Most people were using full state feedback, so that is what I used.
Thanks for the nice comments!

Author:  vnguyen [ Tue Jan 31, 2012 3:49 pm ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Looks great again hmoor14!

Do you mind if I put this up on our blog?

Also, if you're fine with it, can you answer the following questions so I can add it?

1) What inspired you to build this robot?
2) How long did it take you to make this?
3) What are your future plans with the robot?

And if you have any descriptions you want to add, feel free. Thanks!

Author:  hmoor14 [ Tue Jan 31, 2012 11:51 pm ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

No, I don't mind - not at all!

1) What inspired you to build this robot?
I wanted to start learning about robots and how to control them. So, when I saw a video on a balancing robot, I decided I would try that project.

2) How long did it take you to make this?
This was my first robot, so it probably took longer than it should have!
I pretty much did it over the Christmas holidays and then some. So about a month part time. Most of the time was not actually spent building the actual robot but learning how to design it and test the pieces. Just getting around the deadzone in the motors took me a few days.

3) What are your future plans with the robot?
I'm fixing to take it apart, I need the parts for my next robot:(
But, I am going to keep what I've learned (which was so, so much).

Author:  vnguyen [ Wed Feb 01, 2012 10:12 am ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Thanks so much! I'll put this up on our blog.

Author:  jbflot [ Fri Apr 06, 2012 9:38 am ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

hmoor14, you're project is awesome!

I'm in the process of creating a self balancing robot myself, but am also having to compensate for the deadzone in the VEX motors. How did you come up with your mapping - something semi scientific or guess and check?

Any advice is greatly appreciated!

Author:  hmoor14 [ Fri Apr 13, 2012 3:28 pm ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Sorry for the late response (school just gets in the way).

Here is how I came up with the mapping.
1) I set the robot sideways on a table and strapped a 5 lb weight to the wheel (see the attached pic).
2) Then I used a program to measure the steady state speed for the following motor settings (50ms for 1st value and 50ms for second value):
20, -15
20, -10
20, -5
20, 0
20, 5
20, 10
20, 15
20, 20
30, 30
40, 40
50, 50
60, 60
80, 80
100, 100
110, 110
120, 120
127, 127
3) From the above table, I made a mapping table: (mv1,mv2) = mapTable(desired_speed) to linearize.
4) I tested the table and then tweaked (this was somewhat trial and error and hampered by the battery voltage. I should have included the battery voltage in the mapping but I was tired of fooling with it by then, and at the time, I wasn't sure the whole thing would work anyway!)

Some things I am going to try for next robot:
a) include battery voltage
b) try different weights

If you find a better way of doing this, please post it. I know I could use the help!
Thanks

Attachments:
File comment: Here is the code for testing the motor with 5 lb weight.
motor_params_test9.c [1.24 KiB]
Downloaded 899 times
File comment: Here is the 5 lb weight strapped to the wheel.
motor_test_setup.jpg
motor_test_setup.jpg [ 170.92 KiB | Viewed 19657 times ]

Author:  jbflot [ Mon Apr 16, 2012 10:46 am ]
Post subject:  Re: VEX/Robotc balancing robot with new video and code

Quote:
Sorry for the late response (school just gets in the way).


Thanks for the response! Very slick.

Honestly, I probably won't be able to get back to it for a few weeks, but I'll be sure to share what I do find (work just gets in the way, too).

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/