Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Labview help: How do you use a gyroscope to level something controlled by two motors? (http://www.chiefdelphi.com/forums/showthread.php?t=126485)

Ragingenferno 15-02-2014 08:50

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Okay, thanks. I'm actually going to robotics now and I will try and see if I can get it to work. I'll update you guys soon :)

Greg McKaskle 15-02-2014 10:27

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
What some of the previous posts are pointing out is that you need some feedback element, and a gyro isn't your only choice. A pot, or potentiometer is basically like the knob on your stereo, or something that still has analog knobs. It relates a voltage to a position. There are a variety of them to choose from, but they are one approach and benefit from generally having an absolute value for each position of your mechanism.

Encoders count up and down as their shaft is turned CW or CCW. They generally don't have an absolute number for a given position, but have work great when something is turning many revolutions and you want to know how far it has turned.

The gyro can be used to how much something has turned since it was inited, but they drift over time.

Accelerometers can measure the force of gravity and can help level mechanisms as well, but they tend to lag and are subject to other forces such as bumps, uneven ground, and driving forces.

All of these provide feedback to your code. In your code, you can implement any number of control approaches. Bang-bang is perhaps the simplest, but I'd think that a simply proportional control would be just fine for you. You will send a PWM value, say 0.5 to both motors, but a bit later you will measure each side to see if one is ahead of the other. You'll take that error amount and use it to slow one down and speed the other up by some proportional amount. Rinse/repeat. This will help to correct for binding and friction and other forces that make one side go slower than the other. You can make this yourself or use the PID VI with only P being nonzero.

The biggest tip I can give is to plot your motor values and the feedback on your panel. Once you implement the control, also plot your error term. This will help to see whether problems are due to feedback noise, lag, or control values. It will also help you realize the type of binding or other issues that are forcing the motors to operate at different levels. The plotting is accomplished by bundling the values together into a cluster and wiring that to a stripchart on your panel. You can change the X scale to show more or less data, and you may want to turn off the Y autoscaling once you know the range of numbers you'll be plotting. You may want to stack the plots or make additional Y scales if the numbers are vastly different ranges.

Greg McKaskle

Ragingenferno 15-02-2014 18:08

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Thanks for your tips. I will be sure to try everyones ideas but I have another problem. I tried today to control both motors from the same PWM output. I used a 3 pin spitter that normally comes with the kit. When I did this, only one of the victors was receiving code. The other one wasn't. I even tired switching the cable to see if it was at fault. I couldn't get the PWM signal to split.

Is this normal? Can you actually split a PWM signal?

Alan Anderson 15-02-2014 21:06

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Is there any way you can physically link the two sides of your lift, so you don't need to use software to coordinate the motors? That would be my preferred solution.

Greg McKaskle 15-02-2014 21:11

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Does the Digital breakout have 12V power connected to the PD? Are the LEDs bright?

Greg McKaskle

Ragingenferno 16-02-2014 02:34

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
I tried today to control the two motors from one PWM signal. But when i used the splitter, only one victor was receiving code. The other was not and I even tried switching the cables and the victor with a new one. My Digital side car is plugged into the 6 volt connector on the power distributor.

My solenoid break out, and analog breakout has a direct 12 volt from the power distributor.

So, why doesn't splitting the signal work? Am I doing something wrong?

Alan Anderson 16-02-2014 12:59

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Quote:

Originally Posted by Ragingenferno (Post 1343849)
My Digital side car is plugged into the 6 volt connector on the power distributor.

The Power Distribution Board does not have a 6 volt connector. Do you mean the 5 volt output? That's intended for the camera. Do you mean the boosted 12 volt output? That's intended for the D-Link "robot radio" (by way of the 12v-to-5v converter).

The Digital Sidecar must get its power from a regular battery connection on the Power Distribution Board, protected by a 20 A snap-action circuit breaker.

Ragingenferno 16-02-2014 19:17

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Quote:

Originally Posted by Alan Anderson (Post 1343992)
Do you mean the 5 volt output?

Yes, I meant the 5volt connector. Thanks for the heads up, I will be sure to switch it to the Power distributor. Do you think that will fix the problem of the signal not splitting?

Alan Anderson 16-02-2014 20:18

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Quote:

Originally Posted by Ragingenferno (Post 1344153)
Do you think that will fix the problem of the signal not splitting?

Yes.

You weren't giving the Digital Sidecar enough voltage for it to do its job. It was able to sip enough from the cRIO through the ribbon cable to barely control the speed controllers, but I would expect that they would stop working if you ran enough of them in reverse at the same time.

Ragingenferno 16-02-2014 20:25

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
Yay. Okay great, one problem solved.

I'll know that for our girls robot. We have two teams unfortunately and the girls don't really help out on there own robot.

So now lets say I still want to use the gyro, but just to get a read to tell the driver that the top is indeed level. How would I wire it?

I believe I have the programming part of the gyro complete.

Alan Anderson 16-02-2014 20:53

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
A gyro isn't going to tell you whether anything is level unless you have another method to make sure it's level at some point. But if you can do that, just wire it the normal way: connect the Rate pins to either Analog Input 1 or Analog Input 2.

A dual-axis accelerometer can measure the direction of gravity. It might be a better sensor, assuming you can ensure that the robot won't be bumping around much while you're trying to use it.

Ragingenferno 16-02-2014 20:59

Re: Labview help: How do you use a gyroscope to level something controlled by two mot
 
If the gyro is level and the platform that it is connected to is parallel to the gyro, that would give an accurate read right?


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

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