Go to Post Its never too early to start dreaming. - Robert Cawthon [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2011, 14:45
shawnz shawnz is offline
Flamewar Initiator
FRC #0907 (E. Y. Cybernetics)
Team Role: Programmer
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Toronto
Posts: 36
shawnz will become famous soon enough
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2011, 00:59
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
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.
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2011, 08:18
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,795
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: Motor balancing (encoders?)

Scale the motor inputs just before they get into the tank/arcade/holonomic drive vi's. Using the LabVIEW PID functions.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2011, 11:27
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2011, 11:33
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
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.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2011, 16:43
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Motor balancing (encoders?)

Quote:
Originally Posted by davidthefat View Post
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2011, 17:44
shawnz shawnz is offline
Flamewar Initiator
FRC #0907 (E. Y. Cybernetics)
Team Role: Programmer
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Toronto
Posts: 36
shawnz will become famous soon enough
Re: Motor balancing (encoders?)

Quote:
Originally Posted by Alan Anderson View Post
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 View Post
if they arent the same then adjust the speed of the motors until they are.
Quote:
Originally Posted by Mark McLeod View Post
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?

Last edited by shawnz : 30-01-2011 at 17:47.
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2011, 17:50
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Motor balancing (encoders?)

Quote:
Originally Posted by Alan Anderson View Post
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.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #9   Spotlight this post!  
Unread 30-01-2011, 22:25
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,795
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: Motor balancing (encoders?)

Quote:
Originally Posted by shawnz View Post
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 31-01-2011 at 21:30.
Reply With Quote
  #10   Spotlight this post!  
Unread 31-01-2011, 19:27
shawnz shawnz is offline
Flamewar Initiator
FRC #0907 (E. Y. Cybernetics)
Team Role: Programmer
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Toronto
Posts: 36
shawnz will become famous soon enough
Re: Motor balancing (encoders?)

Quote:
Originally Posted by Mark McLeod View Post
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.

Last edited by shawnz : 31-01-2011 at 19:30.
Reply With Quote
  #11   Spotlight this post!  
Unread 31-01-2011, 21:22
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Motor balancing (encoders?)

Quote:
Originally Posted by shawnz View Post
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.
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 10:12.

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