View Single Post
  #14   Spotlight this post!  
Unread 15-02-2014, 08:28
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,797
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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).

__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 15-02-2014 at 08:53.
Reply With Quote