Go to Post Ohhh Chiefdelphi how I love you and your 700 posts about a picture of a fish. - Boydean [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 20-02-2011, 19:36
dwmcc dwmcc is offline
Registered User
FRC #2192 (YAK Attack)
Team Role: Leadership
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Newport, Oregon
Posts: 14
dwmcc is an unknown quantity at this point
Victor + CIM Motor = Jumpy when Negative (Reversed)

Hello All,

Thanks in advance for any and all help on this issue.

We're using Labview with all updates installed, and our robot drives perfectly.
We have a Victor hooked up to PWM 3, and then to a CIM motor. In Labview, we have two True/False bracket that are separately hooked up to two different buttons from the Joystick. If Button 4 is true, it sets the Victor speed to 60. If it is false, it sets the speed to 0. In the other T/F bracket, it sees if Button 5 is true, and sets the Victor speed to -60. If it is false, it sets the speed to 0. The thinking is that if you press one button, the motor goes forward, and if you press the other, the motor goes backward. If no buttons are pressed, the motor is idle/stopped/set to 0.

Here's where it gets weird: If you press button 4, the CIM motor spins forward perfectly. If you press button 5, the CIM motor does not spin backward, and sometimes jumps backward (in reverse) in small increments. What the heck? The code should tell it to go in reverse just the same as it should have gone forward.

Now, we only have one T/F bracket, and we put, say button 4 (if true) to -60, and if false to 0, the motor spins in reverse perfectly.

The two T/F brackets are not connected, and shouldn't be influencing each other, right?

Any suggestions? We're stumped and haven't found any other problems like this on cheif delphi.

Thanks,
dwmcc
Team 2192 Programmer/Web Design/Electrician
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2011, 19:40
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Victor + CIM Motor = Jumpy when Negative (Reversed)

You cannot set the motor output in multiple places in your code. This leads to what is called a "race condition". In this case whichever code loses the race determines the output for one cycle. 20ms later during the next cycle the other set of code could "win" the race.

You need to use nested Case structures or a combination of select nodes to get down to a single Set Output VI for each motor.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #3   Spotlight this post!  
Unread 21-02-2011, 11:21
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Victor + CIM Motor = Jumpy when Negative (Reversed)

Kevin's described your main problem. Something else that might cause you problems in the future is that the jaguar and victor ranges are +/- 1. Your 60 is getting coerced to one. So, in the future, if you wanted to go half the speed you are going now, and try to enter 30, it won't change. To go half speed, you'd enter 0.5.
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 20: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