Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   accelerometers and gyroscope to control arm? (http://www.chiefdelphi.com/forums/showthread.php?t=63719)

Hazmatt 10-02-2008 12:46

accelerometers and gyroscope to control arm?
 
Hello all. How can I use accelerometers to keep a robot's arm parallel to the ground? My initial thought process was to use the accelerometers to measure acceleration due to gravity, and if it felt any, then make the motors move the arm the opposite way. Does this seem about right? And can this be done with one accelerometer? Thanks in advance!

Kevin Watson 10-02-2008 14:59

Re: accelerometers and gyroscope to control arm?
 
Quote:

Originally Posted by Hazmatt (Post 695809)
Hello all. How can I use accelerometers to keep a robot's arm parallel to the ground? My initial thought process was to use the accelerometers to measure acceleration due to gravity, and if it felt any, then make the motors move the arm the opposite way. Does this seem about right? And can this be done with one accelerometer? Thanks in advance!

Yes, this can be done, but you need to use a dual-axis accelerometer. The best mounting orientation is with the x and y axis at a fourty-five degree angle relative to the gravity vector (this is because the maximum rate of change of the accelerometer outputs is at this angle). Also, have a look at the atan2() function.

-Kevin

GUI 10-02-2008 15:06

Re: accelerometers and gyroscope to control arm?
 
Have you considered using a potentiometer instead? You could mount one on the pivot point on your arm, and use a PID loop to get it to be level by default. I would think this would be easier and more accurate than an accelerometer.

Kevin Watson 10-02-2008 15:11

Re: accelerometers and gyroscope to control arm?
 
Quote:

Originally Posted by GUI (Post 695912)
Have you considered using a potentiometer instead? You could mount one on the pivot point on your arm, and use a PID loop to get it to be level by default. I would think this would be easier and more accurate than an accelerometer.

I'm not sure if it's easier or more accurate, but I do know the accelerometer is a cooler solution :D.

-Kevin

Hazmatt 10-02-2008 15:21

Re: accelerometers and gyroscope to control arm?
 
We have been trying to mount a pot on the arm for a long time, and are finding it nearly impossible. I think we are going to have to go with the potentiometer though, after just realizing that the accelerometer is going to measure the acceleration of the entire robot also, if I set it up this way.:(

Kevin Watson 10-02-2008 15:58

Re: accelerometers and gyroscope to control arm?
 
Quote:

Originally Posted by Hazmatt (Post 695923)
We have been trying to mount a pot on the arm for a long time, and are finding it nearly impossible. I think we are going to have to go with the potentiometer though, after just realizing that the accelerometer is going to measure the acceleration of the entire robot also, if I set it up this way.:(

It's more work, but you could use another accelerometer pair mounted perpendicular to the gravity vector to measure the 'bots acceleration due to movement and then use this information to correct the arms position.

-Kevin

Lil' Lavery 10-02-2008 16:13

Re: accelerometers and gyroscope to control arm?
 
Quote:

Originally Posted by Hazmatt (Post 695923)
We have been trying to mount a pot on the arm for a long time, and are finding it nearly impossible. I think we are going to have to go with the potentiometer though, after just realizing that the accelerometer is going to measure the acceleration of the entire robot also, if I set it up this way.:(

If you can't mount a potentiometer on the actual rotation point on the arm there are other solutions. One would be mounting a shaft encoder somewhere else, and running a cable from it to the arm. As the arm moves, it will pull the cable and turn the encoder (essentially a spool or an inverse winch). You can then translate the rotations of the encoder into distance travelled into rotations of the arm.

Hazmatt 10-02-2008 20:04

Re: accelerometers and gyroscope to control arm?
 
Quote:

Originally Posted by Lil' Lavery (Post 695962)
If you can't mount a potentiometer on the actual rotation point on the arm there are other solutions. One would be mounting a shaft encoder somewhere else, and running a cable from it to the arm. As the arm moves, it will pull the cable and turn the encoder (essentially a spool or an inverse winch). You can then translate the rotations of the encoder into distance travelled into rotations of the arm.

Where can we get one of these encoders? Can't encoders only measure distance traveled, or can they measure direction also?

GUI 10-02-2008 23:57

Re: accelerometers and gyroscope to control arm?
 
Quadrature shaft encoders can measure direction as well as distance. There are many suppliers for shaft encoders, pretty much any large electronics supplier will carry them, as well as some specialty companies.

cjtenny 11-02-2008 00:20

Re: accelerometers and gyroscope to control arm?
 
Hey,

I suggest using an accel & gyro so as to correct for the linear acceleration. Kinda like we did on the DIY Segway (http://web.mit.edu/first/segway/)... You can even view our code.

Then again it might not work as well for this.

It's like as Kevin suggested:
Quote:

It's more work, but you could use another accelerometer pair mounted perpendicular to the gravity vector to measure the 'bots acceleration due to movement and then use this information to correct the arms position.

-Kevin
But since they don't give you two accelerometers, and they do give you 1 accel & 1 gyro... it's more KOP-compatible.

Although if anybody has an extra gyro, we need one, ours is broken and we want to use it. Just a heads up, as we've already posted in CD-swap. We can probably trade our accel for your gyro if you wanna do the 2-accel method.

windell747 11-02-2008 08:46

Re: accelerometers and gyroscope to control arm?
 
Why not use an absolute or even an incremental encoder to monitor the position of the arm? Actually, the potentiometer might be the simplest idea, but since I didn't see anything about an eoncoder...decided to mention it. On the other hand, if you're using ferrous metal gears on your arm you could use the GTSs too!


All times are GMT -5. The time now is 23:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi