Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Motor balancing (encoders?) (http://www.chiefdelphi.com/forums/showthread.php?t=90418)

shawnz 29-01-2011 14:45

Motor balancing (encoders?)
 
Is there a "good" way of balancing our drive motors with labVIEW? if we use encoders, is there a way to scale the motor outputs based on those values without taking apart the tank/arcade/holonomic drive VIs? Right now i'm investigating pulling open the devref and adding a transform vi ref to each motor -- but this seems like a very complicated solution for what strikes me as being a fairly common problem. Is there a nicer way?

j.cole 30-01-2011 00:59

Re: Motor balancing (encoders?)
 
It is possible and kinda complicated the best way to fix it would be a mechanical fix but if that isnt possible heres what you can do. Get the 4 encoder rate values and case if the rates are the same (i'd round if i were you) then do nothing to the value of the motors but if they arent the same then adjust the speed of the motors until they are.

Mark McLeod 30-01-2011 08:18

Re: Motor balancing (encoders?)
 
Scale the motor inputs just before they get into the tank/arcade/holonomic drive vi's. Using the LabVIEW PID functions.

Alan Anderson 30-01-2011 11:27

Re: Motor balancing (encoders?)
 
It isn't a common problem. If you are getting significantly different response on the two sides of your drive base, something is wrong with the hardware. It would be better to fix the cause rather than patch it with software.

But if you do want to mask the mechanical or electrical issue, you can use the gyro to modify the X axis input to the Arcade Drive function. Use the joystick as a rudder to determine the desired heading by applying a delta to the current heading as read from the gyro. Use that desired heading as the setpoint of a PID block that reads the current gyro angle and provides the X axis control.

When you're not calling for a turn, the PID will apply whatever turn command is necessary to keep the robot facing the same direction.

davidthefat 30-01-2011 11:33

Re: Motor balancing (encoders?)
 
It turned out that last year's robot had a mechanical "boo boo" because of one jumper. One victor had jumpers for both the "brake" and "coast" options. We did not notice it until 2 weeks ago. So for the whole competition, we had one motor stopping and the other one stopping a few seconds after the other one... That explained why the autonomous mode last year for us really sucked. Like I say everytime: the problem is the hardware, not the software.

Alan Anderson 30-01-2011 16:43

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by davidthefat (Post 1011637)
One victor had jumpers for both the "brake" and "coast" options.

This is not physically possible. The Brake/Coast selection is made by installing a jumper between either the first and second or the second and third pins of a three-pin header.

If you did manage to connect both the Brake and Jumper pins to the control pin at the same time, you would short out the Victor's 5 volt power.

Quote:

...we had one motor stopping and the other one stopping a few seconds after the other one...
It sounds like one Victor was set to Brake and another was set to Coast.

shawnz 30-01-2011 17:44

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by Alan Anderson (Post 1011635)
It isn't a common problem. If you are getting significantly different response on the two sides of your drive base, something is wrong with the hardware. It would be better to fix the cause rather than patch it with software.

i don't know how much of a difference this makes, but we're going 4WD (for omni/mecanum), so i assume any difference in motor output becomes a lot more noticeable more quickly than it would with plain tank. i would love for there to be a non-software solution for this, but it has plagued our last few bots and we don't know where else to look.

Quote:

Originally Posted by j.cole (Post 1011531)
if they arent the same then adjust the speed of the motors until they are.

Quote:

Originally Posted by Mark McLeod (Post 1011586)
Scale the motor inputs just before they get into the tank/arcade/holonomic drive vi's. Using the LabVIEW PID functions.


ah, but how is this done? the PID suggestion seems interesting, but how do we actually get inside the devref to do all this? just unbundle and go through the Motors array? at that point scaling could be trivial (i.e. just multiply) but is there a nicer way to actually get that far?

davidthefat 30-01-2011 17:50

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by Alan Anderson (Post 1011844)
This is not physically possible. The Brake/Coast selection is made by installing a jumper between either the first and second or the second and third pins of a three-pin header.

If you did manage to connect both the Brake and Jumper pins to the control pin at the same time, you would short out the Victor's 5 volt power.



It sounds like one Victor was set to Brake and another was set to Coast.

I guess that was it. I never actually looked at the victors; the electronics guy told me that.

Mark McLeod 30-01-2011 22:25

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by shawnz (Post 1011899)
iah, but how is this done? the PID suggestion seems interesting, but how do we actually get inside the devref to do all this? just unbundle and go through the Motors array? at that point scaling could be trivial (i.e. just multiply) but is there a nicer way to actually get that far?

Don't modify library code.
There's certainly no reason to breakout the DevRef.

You are feeding the settings into the drIve vi's now.
Modify them before you feed them in.
The default teleop.vi takes a joystick axes value and wires it into the Arcade Drive vi.
Put your new code between the Joystick axes and the Drive vi of your choice.

shawnz 31-01-2011 19:27

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by Mark McLeod (Post 1012116)
Don't modify library code.
There's certainly no reason to breakout the DevRef.

You are feeding the motor settings into the drve vi's now.
Modify them before you feed them in.
The default teleop.vi takes a joystick axes value and wires it into the Arcade Drive vi.
Put your new code between the Joystick axes and the Drive vi of your choice.

but, again, how do we do this for holonomic drive? there's a lot of trig performed on the joystick inputs before it gets out to the motor set VI in the holonomic drive VI -- breaking out the devref would give us direct access to the transform VI ref for each motor, which would let us do scaling like this. it seems like the only other option, barring rewriting the holonomic drive VI, would be to do all that math inversed on the axis values we're giving it -- and at that point we may as well just write our own drive VI.

in the mean time, i'll double check for any mechanical/electrical issues on our old bots (e.g. mis-set coast/break jumpers) with my team, because it seems like this really isn't a very common issue at all.

Alan Anderson 31-01-2011 21:22

Re: Motor balancing (encoders?)
 
Quote:

Originally Posted by shawnz (Post 1012772)
but, again, how do we do this for holonomic drive? there's a lot of trig performed on the joystick inputs before it gets out to the motor set VI in the holonomic drive VI...

Don't adjust the motor speeds explicitly. Adjust the drive control inputs. If you want to keep the robot going straight, put the PID between the joystick and the rotate input to the Drive vi. Use the gyro angle as the process variable and the desired heading as the control.


All times are GMT -5. The time now is 10:12.

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