Pages: [1] 2   Go Down
Author Topic: Help finding the best way to get position of wheel  (Read 1032 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am helping a local school with their Robotics competition as a mentor. We're currently finishing up the controls and we're stuck at the following problem:

How do you know how many degrees a wheel has turned?

Now I am not talking about forward movement. Iam talking about the wheel rotating to the left or right so the robot can steer left or right. The robot has been setup to work exactly like a car. Steer the steering wheel left the wheels should rotate left; steer to the right, rotate right.

Both wheels are encased in a holding we constructed that should be able to turn freely for up to 30 degress. We have a DC Motor handling the turning. The problem I am having is fining the best way to make sure the wheels are turned a maximum of 30 degrees in either direction.

The only method we could think of was using a potentiometer. We make some sort of cam that will turn the knob on the potentiometer as the wheel turns to the left or right. Then we calibrate the range and add that to the software. Thus if the potentiometer goes out of range one way, we only allow rotation in the other direction. I dont know if this is the best solution. Any better suggestions? Or is the method I have adequate?
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Assuming you have used a geared motor to control the steering, could you measure rotation of the armature of that motor with an encoder?  Some kind of optical encoder would do it.  You can then sense the end-points of the motion of the steering with microswitches, so that the software can calibrate itself for absolute position.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We did think about using an encoder but our problem is there is no way to save a state when the power turns off. The encoder would work fine if the robot always started off in the same position, but if the robot turns off mid way, there is no way for the encoder to know where the wheels are.
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is it the FIRST competition by chance?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
there is no way for the encoder to know where the wheels are.

So when you power up you turn the wheel hard left until it hits an end stop or until it stalls. Then tell the encoder it is hard left and go from there.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@weirdo557: Yes this is the FIRST competition! What gave it away I might add?

@Grumpy_Mike: We intially created the chasis without thinking of this issue and there really isn't a way for us to add a controls hard stop (through microswitch, touch sensor, etc). If there was, there would be no need for the potentiometer or the encoder - as soon as you hit the hard stop in one direction, you can't turn any more in that direction.

Therefore I am trying to think of a solution which requires no hard stop, mechanical or electrical, at all. The problem is if the robot accelerates in a turn of more than 30 degress the robot has a high chance of toppling over.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In that case.
There are two sorts of optical shaft encoder, one that gives you pulses and one that gives you position. The latter is what you want but they are quite expensive.
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well, you said mentor, robotics competition, and tracking the position of a motor or something.

team 3035 member here, corpus christi.
« Last Edit: February 09, 2009, 04:26:04 pm by weirdo557 » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never even heard of a position optical encoder!

Just did a quick search on digikey but didnt find anything. Would you happen to have a link to something that might work?

I am seriously considering using and encoder with an Atmega168 to store data to the EEPROM or Flash. Then output a PWM output to the main controller through a low pass filter.
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ohh, also, i think the Crio controller that you are using can save text files in the memory of the controller. I'm pretty sure you can use standard C++ fstream library and redirection operators to read and write values that wont be deleted upon powering off.
Logged

Earth
Offline Offline
Sr. Member
****
Karma: 14
Posts: 326
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've never even heard of a position optical encoder!

Just did a quick search on digikey but didnt find anything. Would you happen to have a link to something that might work?

I am seriously considering using and encoder with an Atmega168 to store data to the EEPROM or Flash. Then output a PWM output to the main controller through a low pass filter.

Coming from an industrial background this is something I've run into. Positional encoders are pretty expensive and not something you'd want to use unless you have no choice. Even most CNC machinery uses rotational encoders. If you move the machine while the encoder is off they lose their position. As you said, you could use a normal encoder and store the position to EEPROM or flash. But you can't write to the flash memory of an arduino from the program (well... you can if you write your own low level code) so you'd have to use external flash or the built in eeprom. The EEPROM is rated for 100,000 cycles so be careful how often you write to it. Ideally it would be nice if you could count on being able to save just before the robot is turned off and rarely if ever before that. Then you'll never wear out the memory. You'll still need a way to calibrate it initially and then whenever the calibration is suspect.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The problem is if the robot accelerates in a turn of more than 30 degress the robot has a high chance of toppling over.
How about using an accelerometer to sense if the robot is becoming unstable and limit the turn and/ or speed ?
« Last Edit: February 09, 2009, 04:45:31 pm by mem » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've never even heard of a position optical encoder!


http://www.usdigital.com/products/encoders/absolute/rotary/shaft/ma3

http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=4929157
« Last Edit: February 09, 2009, 05:31:18 pm by Grumpy_Mike » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I saw an article in Nuts and Volts a while back on creating an autonomous PowerWheels (TM) vehicle. He used a DC motor to rotate a steering shaft - and he implemented it by putting reed switches on the left and right side of the car and magnets on the steering mechanism (or vice versa) either way, when the reed switch closes, you're at the maximum turn. I don't think it's an ideal solution, but it might work in your case.

I can't seem to find the article online right now, but if you're interested in hearing more, I'll find the issue# when I get home.

Tim
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep, in this too, wat team r u representing?

team 1155 here
« Last Edit: February 10, 2009, 12:30:35 am by jezuz » Logged

Pages: [1] 2   Go Up
Jump to: