Go to Post The GDC probably took bets on how many posts they could get off of a random CAD render, and bonus points for how many people go insane from thinking about it! :yikes: - gallo26 [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 24-01-2014, 09:27
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
LabView code of other teams ?

Hi,

My main role in the team is programming and I've been learning labview for a few weeks. I have read many pdf s and watched tutorials, but the way how i'm going to program our robot isn't enough clear in my mind yet. I need to control 2 super shifters with 4 CIM in drive train, 2 pneumatics pistols and 2 CIM in other systems. All systems is going to run in Autonomous Mode as well.

I think If I had some example robot codes from past years including controls like above, It would be great to understand and make other things clear in my mind. Any help would be ok.

Thanks from now.

Last edited by eren96 : 24-01-2014 at 09:29. Reason: addition
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2014, 09:38
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: LabView code of other teams ?

If you do a quick search on this site, you can find Team Titanium's code from last year. They used a lot more than what you're using, but they did a really good job all around, especially their autonomous mode.
__________________
Per Audacia Ad Astra
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2014, 12:28
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: LabView code of other teams ?

Quote:
Originally Posted by eren96 View Post
Hi,

My main role in the team is programming and I've been learning labview for a few weeks. I have read many pdf s and watched tutorials, but the way how i'm going to program our robot isn't enough clear in my mind yet. I need to control 2 super shifters with 4 CIM in drive train, 2 pneumatics pistols and 2 CIM in other systems. All systems is going to run in Autonomous Mode as well.

I think If I had some example robot codes from past years including controls like above, It would be great to understand and make other things clear in my mind. Any help would be ok.

Thanks from now.
http://www.chiefdelphi.com/media/papers/2874

In BEGIN you'll see how to start single and double action solenoids as well as how to set-up a 4 motor drive.

In FINISH you'll see how to end each of those things.

In TELEOP we just read the state of our driver controls and write them to global variables. We used button 3 for shifting and button 2 to control our arm moving up and down. We also read the X and Y joystick axis to pass along to our drive loop.

In PERIODIC TASKS/TIMED TASKS you'll find us reading the global variables. The X and Y joystick variables are read in the drive loop. You can ignore the logic involving the "SkySwitch".

When reading the button 3 variable you'll notice some logic used to toggle so the driver doesn't have to keep the button pressed to stay shifted. Ignore the "shift overide" logic. After the toggle we set the state of the solenoid. Single action solenoids are set to either off or on.

Our appendage on button 2 is set up in a similar fashion with a toggle. Again, you can ignore the intermediate logic. You'll notice that the double action solenoid is set to either forward or reverse instead of off or on.

During AUTONOMOUS we write to the same global variables that the driver's controls write to during teleop. If we wanted to lower the appendage we would write button 2 to true which simulates a driver button press. To raise the appendage we have to write it false (simulating the driver releasing the button) than write it true again (switching the output state of the toggle).
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)

Last edited by Alpha Beta : 24-01-2014 at 12:32.
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2014, 06:52
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: LabView code of other teams ?

Quote:
Originally Posted by Alpha Beta View Post
http://www.chiefdelphi.com/media/papers/2874

In BEGIN you'll see how to start single and double action solenoids as well as how to set-up a 4 motor drive.

In FINISH you'll see how to end each of those things.

In TELEOP we just read the state of our driver controls and write them to global variables. We used button 3 for shifting and button 2 to control our arm moving up and down. We also read the X and Y joystick axis to pass along to our drive loop.

In PERIODIC TASKS/TIMED TASKS you'll find us reading the global variables. The X and Y joystick variables are read in the drive loop. You can ignore the logic involving the "SkySwitch".

When reading the button 3 variable you'll notice some logic used to toggle so the driver doesn't have to keep the button pressed to stay shifted. Ignore the "shift overide" logic. After the toggle we set the state of the solenoid. Single action solenoids are set to either off or on.

Our appendage on button 2 is set up in a similar fashion with a toggle. Again, you can ignore the intermediate logic. You'll notice that the double action solenoid is set to either forward or reverse instead of off or on.

During AUTONOMOUS we write to the same global variables that the driver's controls write to during teleop. If we wanted to lower the appendage we would write button 2 to true which simulates a driver button press. To raise the appendage we have to write it false (simulating the driver releasing the button) than write it true again (switching the output state of the toggle).
wow, that is really helpful, thank you.

I read something regarding using global variables and it was saying that using a lot global variables may cause lags on your cRIO. We have FRC cRIO with 8 slots and as far as i know its ram is half of the cRIO with 4 slots. Should we avoid using them or it's not a big problem?

Did you use a custom dashboard to view the speed using encoders? We have encoders on shifters and we don't need them specifically, but we want to use them to view our speed on dashboard.

btw, what is the purpose of using "WPIEnhanced IOSet Ehanced digital config vi", i didn't understand those part in the begin.vi exactly.

Thanks again.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2014, 08:58
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabView code of other teams ?

Globals have a bad reputation. If used properly, they are fine, and often the best and most efficient method of sharing data. If used improperly, they will cause race conditions. Because they also represent a data copy operation, they can cause lag, but so will most other sharing mechanisms.

Simply opening the encoder and configuring it will make it available on the LV dashboard in test mode. That may be good enough for diagnostics, but not for driving feedback.

Sharing data to the dashboard is accomplished by reading the encoder and writing it to a SmartDashboard variable. On the dashboard the encoder will be in the Variables tab automatically. If you want it in your own display element, drop one in either Operation or Auto tabs and give it the name of the SD variable. Those tabs default to binding to SD variables using the control name. If you want other tabs to bind to SD, add them to the array on the block diagram.

For more sophisticated displays, you may instead choose to do an explicit read on the dashboard, do the calculation or combination of data, and update the display elements yourself. A good example of this would be graphing left versus right or doing other calculations and displays of encoder data. The top loop is a pretty good place for code like this. You could also make your own loop.

WPIEnhanced... is telling the driver station how the Cypress I/O board pins are to be configured. This can be done interactively on the I/O tab of the DS. It can also be done at runtime from the robot as they demonstrate.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2014, 17:31
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: LabView code of other teams ?

You can find team 1124's code up here - 2009 through 2013 are in LabVIEW. Keep in mind, it won't look like what you're used to, we tend to modify the structure to better suit what we wanted (overview).
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2014, 20:16
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Question Re: LabView code of other teams ?

I tried to understand them, but some seems hard to edit to me, especially when you add some additional vi s beside the default code. Now we can control our drive train and run arm motors, but can't control the pistons as we wanted. I added the default compressor code and by the help of pressure switch the pressure always sets himself to correct range. However the extend and retract functions only work when the pressure is above 100 psi. We use super shifters in our drive system and wired 2 shifting pistons to one solenoid to shift at the same time. So, 100 psi isn't needed to shift. How can we control pistons whenever we want to and no matter the pressure is?
Reply With Quote
  #8   Spotlight this post!  
Unread 28-01-2014, 21:48
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: LabView code of other teams ?

Quote:
Originally Posted by eren96 View Post
So, 100 psi isn't needed to shift. How can we control pistons whenever we want to and no matter the pressure is?
Try loosening the cylinder nut a little. Sometimes the alignment on the AM Shifters are a little off and they can bind up when fully tightened.
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
Reply With Quote
  #9   Spotlight this post!  
Unread 29-01-2014, 00:03
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: LabView code of other teams ?

Quote:
Originally Posted by eren96 View Post
...the extend and retract functions only work when the pressure is above 100 psi.
That sounds almost like the code to control the cylinder is only running when the compressor is not. Can you show us the relevant parts of your program?
Reply With Quote
  #10   Spotlight this post!  
Unread 29-01-2014, 14:56
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: LabView code of other teams ?

Quote:
Originally Posted by Alan Anderson View Post
That sounds almost like the code to control the cylinder is only running when the compressor is not. Can you show us the relevant parts of your program?
No, even if the compressor is running, we can still control extend and retract functions, but within some specific range.

http://imgur.com/yWLShcp
http://imgur.com/JcrDTcO&yWLShcp&NfAFJ3K&O8KQNNz#0 (green wires come from two different buttons)

These are the codes releated to our solenoids in our begin and teleop vi. To try in a different way, we first ran the compressor and filled the air tanks and then wired a solenoid and run the program. It still does the same thing. Although the pressure switch or compressor aren't wired, we can't extend the pistons below nearly 100 psi. Is it normal?
Reply With Quote
  #11   Spotlight this post!  
Unread 30-01-2014, 20:58
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: LabView code of other teams ?

Quote:
Originally Posted by eren96 View Post
http://imgur.com/JcrDTcO&yWLShcp&NfAFJ3K&O8KQNNz#0 (green wires come from two different buttons)
There's a red dot on the input to Solenoid Set. It means you've connected something of a type that the function doesn't expect, and it has coerced the value to something it can use. Where did you get the Forward, Reverse, and Off constants that you have going into the Select functions? It's possible that you're feeding the Solenoid function with Relay values. They happen to be completely compatible and shouldn't cause problems, but it's usually a good idea to keep the program as "happy" as possible.

Quote:
Although the pressure switch or compressor aren't wired, we can't extend the pistons below nearly 100 psi. Is it normal?
Most pneumatic systems will "work" down to 30 psi without difficulty, though they of course won't provide much force. I don't think your symptoms can be explained by anything in the code. It's probably time to examine your pneumatic system in detail. What kind of solenoid valves are you using? Do they have a manual actuation feature, perhaps a small button or lever?

Or maybe whatever you have the cylinder connected to just requires that much force in order to move. What is the mechanism you're trying to activate with the cylinder?
Reply With Quote
  #12   Spotlight this post!  
Unread 01-02-2014, 21:29
eren96's Avatar
eren96 eren96 is offline
Registered User
FRC #3646 (Integra)
 
Join Date: Oct 2013
Rookie Year: 2011
Location: Türkiye
Posts: 22
eren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really niceeren96 is just really nice
Re: LabView code of other teams ?

Quote:
Originally Posted by Alan Anderson View Post
There's a red dot on the input to Solenoid Set. It means you've connected something of a type that the function doesn't expect, and it has coerced the value to something it can use. Where did you get the Forward, Reverse, and Off constants that you have going into the Select functions? It's possible that you're feeding the Solenoid function with Relay values. They happen to be completely compatible and shouldn't cause problems, but it's usually a good idea to keep the program as "happy" as possible.



Most pneumatic systems will "work" down to 30 psi without difficulty, though they of course won't provide much force. I don't think your symptoms can be explained by anything in the code. It's probably time to examine your pneumatic system in detail. What kind of solenoid valves are you using? Do they have a manual actuation feature, perhaps a small button or lever?

Or maybe whatever you have the cylinder connected to just requires that much force in order to move. What is the mechanism you're trying to activate with the cylinder?

We solved our problems with solenoids. Thanks for your help. I guess I was lack of some essential information about solenoid. First we changed the code and then checked our wiring. We found out that our solenoid breakout is not fed by 24v on pdb and fixed it by wiring it to C and NC outs. All of our solenoids are 24v, we missed that detail. We can finally drive our robot, shift and control other pneumatic systems properly.

Now, the only thing that was left is vision processing in autonomous. We looked over the example code and tried to understand it. We could customize our dashboard by the example code. However, we still don't have any idea how to link the example code to our robot actions in autonomous mode. I know this thread is going far from its title and hope that it's not a problem. Do you have any simple and clear resources about using vision processing code in auto mode?
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 09:48.

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