Go to Post I haven't been negative about any FIRST game yet, but scaling and cleaning fish in 2009 that were used in 2008 is going to stink. Literally. :P - Billfred [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 13-10-2010, 01:30
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Off season Questions **Need Help Asap/Code Check**

Hello,

We have recently made changes to our breakaway! robot and are attending CAGE Match. With the recent changes I just wanted to double check some programming thing before we get the robot ready to leave.

A) The purpose of the code: When button 6 is true the motor goes forward (aka lifting the lifting device). When False the speed is set to 0. When button 7 is activated, the lifting device is lowered. (Pictured Below)

B) I really needed to reduce the sensitivity of our drive system. I tried a method of hooking buttons up to cases and then multiplying the motor speeds by .5. However, when I built and deployed the code, all I got was watchdog errors. Is there any example code or anything of a simple drive system sensitivity system.

Thanks,
Dustin Shadbolt
Attached Thumbnails
Click image for larger version

Name:	test.jpg
Views:	90
Size:	55.6 KB
ID:	9340  
Reply With Quote
  #2   Spotlight this post!  
Unread 13-10-2010, 08:46
rsisk's Avatar
rsisk rsisk is offline
The GURU Channel
AKA: Richard Sisk
FRC #2493 (Robokong)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Riverside, CA
Posts: 2,748
rsisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond repute
Send a message via MSN to rsisk
Re: Off season Questions **Need Help Asap/Code Check**

I cannot tell from the code you posted what might be causing the watchdog error since there is nothing I can see that would cause the error.

Watchdog errors are often caused by a loop in the code that does not feed the watchdog before the watchdog times out.

You can quickly confirm the code you added is not the problem by removing it and retesting. If the errors continue, the problem is somewhere else.
__________________
Quote:
The views expressed are mine and should not be construed to represent the views of anyone else.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-10-2010, 08:53
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: Off season Questions **Need Help Asap/Code Check**

A Watchdog error could also be cause if you have connected a watchdog to a "Everlasting loop". The watchdog would have to wait for that everlasting loop until it can continue to the next task, but if you have connected it to a case that never stops, the watchdog is not going to move on.

Check if you have connected a loop that runs forever before watchdog can move on. That was our problem and we fixed it by rechecking this.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-10-2010, 09:08
DavidGitz's Avatar
DavidGitz DavidGitz is offline
Lead Technical Advisor
FRC #1208 (MeTool Brigade)
Team Role: Coach
 
Join Date: Dec 2006
Rookie Year: 1996
Location: O'Fallon, IL
Posts: 341
DavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud of
Send a message via AIM to DavidGitz Send a message via MSN to DavidGitz Send a message via Yahoo to DavidGitz
Re: Off season Questions **Need Help Asap/Code Check**

I agree. However, there might be a problem if the driver were to press button 6 and 7 at the same time. I would change the logic selecting the case statements, the first one would be button6 AND !button7; and the second would be button7 AND !button6
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 13-10-2010, 09:48
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: Off season Questions **Need Help Asap/Code Check**

There's also a problem with the snippet you posted if both underlying FALSE cases are setting the motor speed to 0.
They will be contradicting the other button's TRUE case.

You only want to set the motor speed to zero if both buttons are FALSE.

----------
Using one of the joystick throttles for adjusting sensitivity would give you the most control.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 13-10-2010 at 10:08.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-10-2010, 10:07
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: Off season Questions **Need Help Asap/Code Check**

@Mark

How would you go about doing that?
Reply With Quote
  #7   Spotlight this post!  
Unread 13-10-2010, 10:29
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: Off season Questions **Need Help Asap/Code Check**

Here's a sample of what I mean about using the throttle to adjust the sensitivity.

I didn't include the corrected button logic.
Attached Thumbnails
Click image for larger version

Name:	Sensitivity-1.jpg
Views:	66
Size:	15.9 KB
ID:	9341  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #8   Spotlight this post!  
Unread 13-10-2010, 10:59
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: Off season Questions **Need Help Asap/Code Check**

Quote:
Originally Posted by dShad View Post
A) The purpose of the code: When button 6 is true the motor goes forward (aka lifting the lifting device). When False the speed is set to 0. When button 7 is activated, the lifting device is lowered.
As Mark pointed out, your code gives an indeterminate result when either or both buttons are pressed. Both case blocks will try to set the motor at the same time, and which one actually succeeds is not predictable. To fix this, don't put the blocks in parallel. Put them in series. Instead of actually setting the motor speed inside the blocks, set it after them both. Here's how I suggest you do it:


Wire a constant 0 into the first block, connect Button 6 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant 0.5 to the output instead.

Wire the output of the first block into the second block, connect Button 7 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant -0.5 to the output instead.

Feed the output of the second block into the Set Motor vi. Done! This makes the "down" button take priority over the "up" button. Change the order of the case blocks if you want the "up" to override the "down" instead.



For this kind of thing I would actually use select functions instead of case blocks, but that's not a big deal.
Reply With Quote
  #9   Spotlight this post!  
Unread 13-10-2010, 11:35
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: Off season Questions **Need Help Asap/Code Check**

Thanks guys. I think I have it fixed now. I will try it tonight at the shop and post my results.]\


-- Results--

Below I have included pictures of the section of code I'm wondering about. (I fixed the watch dog error thanks to whcirobotics and I got a rough version of motor sensitivity down.) This is the code that Alan suggested (well as I could understand from the text). Should it function properly?
Attached Thumbnails
Click image for larger version

Name:	falsetrue.jpg
Views:	47
Size:	96.2 KB
ID:	9343  Click image for larger version

Name:	falsefalse.jpg
Views:	36
Size:	93.8 KB
ID:	9344  Click image for larger version

Name:	truefalse.jpg
Views:	34
Size:	81.8 KB
ID:	9345  

Last edited by Dustin Shadbolt : 13-10-2010 at 23:57.
Reply With Quote
  #10   Spotlight this post!  
Unread 14-10-2010, 03:11
rsisk's Avatar
rsisk rsisk is offline
The GURU Channel
AKA: Richard Sisk
FRC #2493 (Robokong)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Riverside, CA
Posts: 2,748
rsisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond repute
Send a message via MSN to rsisk
Re: Off season Questions **Need Help Asap/Code Check**

Another way to do this would be to do an Exclusive OR of the Button6 and Button7 values and feed the result into a case.

False would set the motor speed to zero.

True would feed the value of Button7 into and If, the true leg = +1, false leg = -1. Output of IF would be multiplied by .5 and fed to motor speed.

The Labview XOR looks like this:

XOR returns FALSE if both values are either TRUE or both values are FALSE, otherwise it returns TRUE.
__________________
Quote:
The views expressed are mine and should not be construed to represent the views of anyone else.
Reply With Quote
  #11   Spotlight this post!  
Unread 14-10-2010, 07:48
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: Off season Questions **Need Help Asap/Code Check**

Quote:
Originally Posted by dShad View Post
This is the code that Alan suggested (well as I could understand from the text). Should it function properly?
It looks like it will do what you want. You got it exactly as I described (except for the superfluous wiring through of the select input to an output of each case block -- that can be deleted without worry).
Reply With Quote
  #12   Spotlight this post!  
Unread 14-10-2010, 17:05
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: Off season Questions **Need Help Asap/Code Check**

Thanks Alan. It makes total sense now after seeing it done. I can't believe I didn't think of doing it that way before.
Reply With Quote
  #13   Spotlight this post!  
Unread 14-10-2010, 17:39
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: Off season Questions **Need Help Asap/Code Check**

Quote:
Originally Posted by dShad View Post
Thanks Alan. It makes total sense now after seeing it done. I can't believe I didn't think of doing it that way before.
It takes a while to get used to the "sensical" way of doing things in LabVIEW.

The TechnoKats 2009 robot had several motors that were used as either off, fixed speed forward, or fixed speed reverse. Our code got a lot less cluttered when we build a subVI to handle that function. Given a motor reference and a pair of button inputs, it did exactly what you were asking for. The forward and reverse speed values defaulted to +/- 1, but could be overridden by additional inputs. We also added limit switch inputs to disable travel in one or the other direction. That exact subVI wasn't reused in 2010 because it had never been published and was therefore not strictly legal for the new season according to the manual, but it was only a matter of minutes to recreate it from the basic concept. If we need it again next year, we know how to do it, and we'll probably put it out for public enjoyment this time.
Reply With Quote
  #14   Spotlight this post!  
Unread 23-10-2010, 22:53
versedaaron's Avatar
versedaaron versedaaron is offline
Lead Programmer
FRC #1747 (HBR)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lafayette IN
Posts: 6
versedaaron is an unknown quantity at this point
Send a message via AIM to versedaaron
Re: Off season Questions **Need Help Asap/Code Check**

Quote:
Originally Posted by dShad View Post
Thanks guys. I think I have it fixed now. I will try it tonight at the shop and post my results.]\


-- Results--

Below I have included pictures of the section of code I'm wondering about. (I fixed the watch dog error thanks to whcirobotics and I got a rough version of motor sensitivity down.) This is the code that Alan suggested (well as I could understand from the text). Should it function properly?
how i usually go about this is two selects, this way its easy to fallow which one has priory over the others so which it does if both are pressed.
__________________
Opinions expressed by me do not reflect the views of all members of 1747 HBR.
If you have any objections to my post please PM me.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP- Need Globe Motors ASAP Brandon Holley General Forum 0 03-11-2009 10:37
Shipping confusion need help ASAP Doug_I_854 General Forum 7 19-02-2008 10:58
need help with ifi asap!! 1075master Technical Discussion 13 06-01-2006 14:22
Need Mplab help ASAP !! L33T-meh- Programming 3 03-02-2004 21:39


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

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