Gyroscope Module 3-Axis L3G4200D...wow
joy1
Posts: 32
I've purchased the gyroscope to help with a robot we're building. We have a robot with 2 wheels at the front controlled by two seperate motors. We have to place pallets on a shelf. Problem is, there is a 3/4" piece of plywood in our way (can't be moved) which is OK for the center shelves since both wheels are on the plywood. for the shelves on the side, one wheel is up on the plywood and one wheel is down. So, we thought a gyroscope would help us with this. We were thinking we only need one axis to determine if the base of the robot is "flat"...when one wheel is up and one down, the gyroscope would give us the degree of angle it is off and we would use linear actuators to raise whatever side of the robot to bring it to "flat" again. This way, we would always be able to enter the shelving unit level.
We're using BasicStamp BS2.
That's our story. So we purchased the Gyroscope and i'm not sure but this seems very complicated than anticipated. I downloaded the code online and it reads 0 for all three axis. I move the unit and I get readings but then it goes back to 0 no matter what the position is.
What I want it to do is:
For example:
Focus on "x" axis...if base is "flat"...measure 0
if the robot tilts to the left then I would like to see what the angle is and then record the value
if the value is at let's say 15 degrees, then move therobot back to flat by activiating the left linear actuator
the same would happen for the right.
Can anyone help...do I need something else to make this happen?
thanks
We're using BasicStamp BS2.
That's our story. So we purchased the Gyroscope and i'm not sure but this seems very complicated than anticipated. I downloaded the code online and it reads 0 for all three axis. I move the unit and I get readings but then it goes back to 0 no matter what the position is.
What I want it to do is:
For example:
Focus on "x" axis...if base is "flat"...measure 0
if the robot tilts to the left then I would like to see what the angle is and then record the value
if the value is at let's say 15 degrees, then move therobot back to flat by activiating the left linear actuator
the same would happen for the right.
Can anyone help...do I need something else to make this happen?
thanks
Comments
*Ok, that's not true for a mechanical gyro. But it is for a MEMS gyro.
A better solution would be to use an accelerometer. You drive the robot until you're sure it's on the plywood, then stop. You use the accelerometer to measure the tilt, and you compensate.
A better solution than that would be to use some sort of sensor by each wheel: the sensor detects the plywood or lack of plywood, and you can calculate your tilt from that (since the plywood is constant, the tilt is constant. You don't need to actually measure it). I suggest some sort of color sensor, or an IR sensor to do the detection.
The best solution would be to put plywood all the way across, so you don't have to worry about it.
I'm guessing the plywood is part of a course made for robots. This sounds like some sort of contest or challege. I doubt they get to modify the environment.
I think the accelerometer would be the easiest of the solutions offered by SRLM. I think it best solves the problem of the robot not being level.
That makes sense. I didn't think of this as part of a contest.