Go to Post I read every darn page of this thread. - Paul Copioli [more]
Home
Go Back   Chief Delphi > CD-Media > Photos
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

photos

papers

everything



Lab view

By: Rochester2909
New: 11-03-2014 14:28
Updated: 11-03-2014 14:28
Views: 891 times


Lab view

here are a couple snips of our program we are having trouble with the solenoids and programing, also if you find any other errors point them out thanks!

Recent Viewers

  • Guest

Discussion

view entire thread

Reply

11-03-2014 15:35

Jay1986


Unread Re: pic: Lab view

Well to fix your solenoid problem, the "solenoid set vi" needs a on/off command for single solenoids and not a true/false. To fix this, right click on the terminal of the "set vi" and hit create constant. This will give you the correct command. Then copy and paste another one and change it to "off". Then wire both commands to a select with the "on" wired to "true" and "off wired to "false". Then wire the output of your button to the input of the select and finally wire the output of the select to the input of the solenoid "set vi". Do this for both solenoids.



11-03-2014 15:38

randantor


Unread Re: pic: Lab view

Quote:
Originally Posted by Jay1986 View Post
Well to fix your solenoid problem, the "solenoid set vi" needs a on/off command for single solenoids and not a true/false. To fix this, right click on the terminal of the "set vi" and hit create constant. This will give you the correct command. Then copy and paste another one and change it to "off". Then wire both commands to a select with the "on" wired to "true" and "off wired to "false". Then wire the output of your button to the input of the select and finally wire the output of the select to the input of the solenoid "set vi". Do this for both solenoids.

The solenoid VIs will work with either a boolean or an enum value.



11-03-2014 15:47

Jay1986


Unread Re: pic: Lab view

Other suggestions with the rest of the code: First of all, don't have all of you code in teleop. The more code you have in teleop, the laggier your controls will be since all of the code is waiting for each other before it starts another iteration. What I recommend you to do is, write all the outputs from the buttons to global variables and then put all of your code in periodic tasks with separate loops and read the global variable from teleop. Doing this also allows you to have your code run in autonomous, so you can just write to your global variables instead of rewriting all of your code in autonomous. You don't have much code, so this is not a necessity this year. Another suggestion, you are using case structures like selects, so the case structure is a bit unnecessary. Also, the "motor set vi" reads values from -1 to 1, not -255 to 255. Other than that, it looks fine.

Hope this helps!



11-03-2014 15:48

Woolly


Unread Re: pic: Lab view

Correct me if I'm wrong, but for a double solenoid, don't you need to select between forward and reverse to make the mechanism extend and close.
Also, looking at your comments you want it to toggle being in or out on button press.

You will need to wire your button through this vi (thank you Channel Cats)
http://2013swat-robot-code.googlecod...E-FLIP-FLOP.vi

and then to a select statement that selects between the forward and reverse constants.



11-03-2014 16:19

Mark McLeod


Unread Re: pic: Lab view

Except those are Single solenoids, not doubles.
But the button toggle suggestion is good.



11-03-2014 17:06

AGPapa


Unread Re: pic: Lab view

The motor sets need a double from -1 to 1, not an integer.



view entire thread

Reply
previous
next

Tags

loading ...



All times are GMT -5. The time now is 13:38.

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