|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
Labview help: How do you use a gyroscope to level something controlled by two motors?
Hello,
I'm from team 3053 and I’m asking for help making an auto leveling system for our part on our robot. It is kind of like a scissor lift. We are using two motors to control it. Can someone assist me in doing this please. I attached our code that we have right now. So basically, we have two motors, one is controlling the right side, one is controlling the left side. When both motors are moving, the "scissor lift" like mechanism raises. We wanted to attach a gyroscope to the bottom of it to automatically adjust the speed of the motors as we manually raise it with a button. How can we do this? |
|
#2
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
What you're describing seems better suited for motor encoders.
|
|
#3
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
I still wouldn't know how to do that. Could you describe or give me an example?
|
|
#4
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
To be completely honest, we're in that hole too.
What kind of motor controllers are you using for the motors? Jags or Vics or Talons? |
|
#5
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
For the small andymark motors for the lift system we are using victors. I know how to do most things for controlling the robot just not the advanced things like using a gyro to stabilize things.
|
|
#6
|
|||
|
|||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
Are you just trying to get both motors to raise the lift evenly?
|
|
#7
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
Yes, pretty much but controlling both motors from the same PWM isn't working out as we expected because the load on top isn't centered. That's why I thought of using a gyro to fix it.
|
|
#8
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
Interesting. Encoders as far as I know have to be on Jags.
Now what you could try doing is setting each motor with different output speeds and twiddle with that. IE if one is going faster, slow it down a little and speed the other one up in labview. |
|
#9
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
That would work but we are not certain how the ball will land on the lift. The lift will hold our ball along with pneumatic pistons. I think you get the idea of what we're doing there.
So gyro's in labview is that hard? |
|
#10
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
Not necessarily. I would write (I mean draw) an example for you but it's late and I don't really have the time to. Check out team 358's website on labview though, they have great examples that we've been utilizing.
|
|
#11
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
Okay no problem.Well, I already know how to code for gyros and things of that nature. I just don't know how to utilize the data it sends back as a variable and unfortunately the site(or at-least i couldn't find) doesn't have an example for that.
|
|
#12
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
First off, encoders don't NEED to be on Jags. You can just hook their A and B pins (and index if necessary) to the Digital Sidecar DIO pins. Concerning the mechanism, I'd say a potentiometer would be your best bet. In java, you can declare a pot with various parameters, allowing you to change the 0V to 5V range to something easier to work with, such as 0 to 270 degrees. And finally, once you have your sensor, I'd recomend a PID loop using degrees as your input units.
|
|
#13
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
I have almost no clue what you just said. I'm not using java although I do know the basics of it. I'm using labview as I wasn't given a chose.
A potentiometer? I don't see how that would work. I'm trying to keep something level, as in, level to gravity. |
|
#14
|
|||||
|
|||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
What you need is a PID control driven by your gyro.
For a simple approach I'd start with setting one motor speed to below maximum, e.g., control it directly with a joystick but cap the maximum at .8 That gives the other motor a little room to run faster or slower than the first motor while trying to keep things level. Then use PID just on the second motor to keep the gyro level. The right half of this example below. Replace the "What we want the pot to read" with your target gyro reading. Replace the "What the pot currently reads" input with the current gyro reading. The target reading might be taken when the platform is down and level before it starts to rise. You will need to adjust the PID coefficients by experimentation. Keep I & D zero and just play with P (start P at 1 for the first test and gradually increase it) until you get the platform to remain steady (but probably a little tilted) all the way up. Then start playing with I to level the platform out (start with a small number like .1 and decrease it). ![]() Last edited by Mark McLeod : 15-02-2014 at 08:53. |
|
#15
|
||||
|
||||
|
Re: Labview help: How do you use a gyroscope to level something controlled by two mot
I would start by creating a pid where the output to the motor is negative if tilted one way, and positive if tilted the other way. Then you could split the output of the pid and drive each side based on whether it is positive or negative. You probably would want to take it a step further and make one motor output the inverse if the other, so that now the scissor lift doesn't just go up
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|