Go to Post From what I've seen in FIRST, teams that copy generally always learn something from it, and if they don't, the copy they produce is of much lower quality than the original. - TheOtherGuy [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-02-2011, 20:20
dahlboy15 dahlboy15 is offline
Vice President
AKA: Dyson Dahl
FRC #3290 (Robo-Bears)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Baudette, MN
Posts: 14
dahlboy15 is an unknown quantity at this point
Program 2 coil solenoid

I want to program a 2 coil solenoid so that when I push a button, the bimba extends and then when I push the same button again it retracts. I cannot figure this out. If someone could provide some code it would be greatly appreciated, or talk me through it in simple text.
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 20:55
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: Program 2 coil solenoid

Normally I wouldn't post complete code (I'd rather give suggestions and help guide you) but since we are almost a week away from ship here you go.

Attached .vi works by toggling a state whenever button 1 is pressed and actuating the appropriate cylinders. We aren't using pneumatics this year so I just noticed that the solenoid vi's use enumerated constants (like the relay's) compared to boolean values like last year, but this should still work fine. We used this last year for a periscope on our robot that one of our drive team would toggle up and down with the joystick trigger. Good luck!
Attached Files
File Type: vi SolenoidTrigger.vi (12.8 KB, 21 views)
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2011, 19:47
dahlboy15 dahlboy15 is offline
Vice President
AKA: Dyson Dahl
FRC #3290 (Robo-Bears)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Baudette, MN
Posts: 14
dahlboy15 is an unknown quantity at this point
Re: Program 2 coil solenoid

Quote:
Originally Posted by DavidGitz View Post
Normally I wouldn't post complete code (I'd rather give suggestions and help guide you) but since we are almost a week away from ship here you go.

Attached .vi works by toggling a state whenever button 1 is pressed and actuating the appropriate cylinders. We aren't using pneumatics this year so I just noticed that the solenoid vi's use enumerated constants (like the relay's) compared to boolean values like last year, but this should still work fine. We used this last year for a periscope on our robot that one of our drive team would toggle up and down with the joystick trigger. Good luck!
I changed your code to satisfy our double coil solenoid, but the problem with my code is that when the bimba is in its retracted state the solenoid clicks nonstop. I think that it is because my code is trying to make it do something but since it is already there it can't and just keeps trying. I've attached a copy of my solenoid code so any suggestions would be appreciated.
Attached Files
File Type: vi Teleop.vi (31.2 KB, 12 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2011, 23:29
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: Program 2 coil solenoid

Couple problems:
-It is clicking because you have the same reference and are issuing 2 different commands at the same time. With a double acting solenoid this means that it should be operating on 2 channels. If you are using the solenoid module on the cRIO this means that you should use Channels 1 and 2 (or whatever you are using). The code that I originally posted should satisfy this exactly.
-Also you definitely want to avoid having while loops in your Teleop, this is a bad practice and will more than likely make your drive sluggish at best. With your code the while loop only executes once, so why even have it?
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2011, 09:30
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,113
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: Program 2 coil solenoid

Quote:
Originally Posted by DavidGitz View Post
With your code the while loop only executes once, so why even have it?
There is a valid reason to use a "run-once" loop (though Dyson's code doesn't do it). It lets you use a shift register to remember a value between runs of the surrounding vi. If you have a bunch of such values you need to keep around, a single loop surrounding the relevant functions can be a little cleaner than a bunch of feedback nodes.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2011, 14:09
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: Program 2 coil solenoid

Alan - That is a good point. I tend to avoid using shift registers if at all possible, as I think it can be detrimental in troubleshooting effectively, but that's just me. And I would still be vary wary about implementing them in the FRC Teleop.vi as a poor implementation could lead to other (and possibly unforeseen) problems in the future. A better idea to me would be to use a For Loop, at least then you can definitively control how many times a loop will run before exiting, compared to a While Loop where you are more likely to be checking on an external (from the Teleop.vi) input.

But the application that you stated, using shift registers in place of multiple feedback nodes is great!
__________________
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:30.

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