Go to Post Be watchful of the "man this is so cool we should do it in build" as I've embarrassingly fallen victim to it so many times before, with varying results. - Aren_Hill [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-02-2014, 00:33
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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?
Attached Files
File Type: zip 2014 Boys robot.zip (4.84 MB, 19 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2014, 02:10
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-02-2014, 02:17
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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?
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2014, 02:19
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
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?
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2014, 02:31
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2014, 02:33
Brandon_L Brandon_L is offline
Back @ it again with the white vans
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,207
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
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?
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors
Reply With Quote
  #7   Spotlight this post!  
Unread 15-02-2014, 02:37
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 15-02-2014, 03:01
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-02-2014, 03:09
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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?
Reply With Quote
  #10   Spotlight this post!  
Unread 15-02-2014, 03:18
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
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.
Reply With Quote
  #11   Spotlight this post!  
Unread 15-02-2014, 03:23
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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.
Reply With Quote
  #12   Spotlight this post!  
Unread 15-02-2014, 08:17
lucas.alvarez96's Avatar
lucas.alvarez96 lucas.alvarez96 is offline
Registered User
AKA: Lucas Alvarez
FRC #2576 (Chilean Heart)
 
Join Date: Dec 2013
Rookie Year: 2013
Location: Chile
Posts: 120
lucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to all
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.
Reply With Quote
  #13   Spotlight this post!  
Unread 15-02-2014, 08:24
Ragingenferno's Avatar
Ragingenferno Ragingenferno is offline
That one guy
AKA: Josh
FRC #3053 (Stingers)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: NYC
Posts: 39
Ragingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really niceRagingenferno is just really nice
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.
Reply With Quote
  #14   Spotlight this post!  
Unread 15-02-2014, 08:28
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,844
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
  #15   Spotlight this post!  
Unread 15-02-2014, 08:40
Chadfrom308's Avatar
Chadfrom308 Chadfrom308 is offline
Slave to the bot
AKA: Chad Krause
FRC #0308 (The Monsters)
Team Role: Driver
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Novi
Posts: 272
Chadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to behold
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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