Go to Post free hugs-one size fits all - joshsmithers [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 27-01-2010, 13:08
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: Program Pnuematics

Thanks Mark!
  #17   Spotlight this post!  
Unread 27-01-2010, 22:40
Ozomalti's Avatar
Ozomalti Ozomalti is offline
Registered User
FRC #2389 (Oklahoma S.T.O.R.M)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Yale, Oklahoma
Posts: 2
Ozomalti is an unknown quantity at this point
Re: Program Pnuematics

Thanks that helped. but there is no way to control the psi with labview?
  #18   Spotlight this post!  
Unread 27-01-2010, 23:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,860
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: Program Pnuematics

There isn't any device that LabVIEW can control that adjusts the psi.
You can develop your own device, but some kind of device would be necessary.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #19   Spotlight this post!  
Unread 28-01-2010, 03:21
PaW's Avatar
PaW PaW is offline
Registered User
AKA: Paul W
FRC #1899 (Saints Robotics)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2006
Location: Seattle, WA
Posts: 175
PaW has a spectacular aura aboutPaW has a spectacular aura about
Re: Program Pnuematics

Your webpage is very helpful, Mark. Thanks. I'm forwarding to our programmers.
  #20   Spotlight this post!  
Unread 01-02-2010, 13:44
Hadi379's Avatar
Hadi379 Hadi379 is offline
Registered User
FRC #0379
 
Join Date: Jan 2007
Location: Girard
Posts: 171
Hadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to behold
Re: Program Pnuematics

Mark,

In your telop example, is it necessary to reference Joystick 1 again and unbundle the buttons? Could you just use the other "Joystick Get" block that comes from the "Joystick Read" you have unbundled the axis off of?
  #21   Spotlight this post!  
Unread 01-02-2010, 16:04
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,860
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: Program Pnuematics

Sure.
I just wanted to emphasize how to access a joystick and keep the whole process as a somewhat isolated case.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 01-02-2010 at 16:08.
  #22   Spotlight this post!  
Unread 02-02-2010, 09:17
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: Program Pnuematics

Mark,

We tried the compressor programming and were not able to get it to work. In trying to debug this, I need to understand more and I have some basic question about the setup in this 2010 Framework.

From the screen shots, it looks like begin.vi has the initialization and operational functions for the compressor. Am I to understand that the compressor control (with feedback from the pressure switch and drive from the relay driver) is done completely within begin.vi? I would have thought that the solenoid control needs to be part of teleop.vi or some other recursive vi.

Also, unbundling the buttons within the joystickget block is possible, but when I edit the block and then save the changes, the periphery of the joystickget block within the teleop.vi does not have the added buttons. What else needs to be modified within the joystickget block to enable the buttons being accessible on the block periphery?

Thanks in advance.
Lance
  #23   Spotlight this post!  
Unread 02-02-2010, 11:08
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 Pnuematics

Quote:
Originally Posted by sparks-1784 View Post
From the screen shots, it looks like begin.vi has the initialization and operational functions for the compressor. Am I to understand that the compressor control (with feedback from the pressure switch and drive from the relay driver) is done completely within begin.vi? I would have thought that the solenoid control needs to be part of teleop.vi or some other recursive vi.
The actual control of the compressor relay is done in a separate task which gets created when you open the Compressor. It's magic that happens without any attention from the rest of the project.

Quote:
Also, unbundling the buttons within the joystickget block is possible, but when I edit the block and then save the changes, the periphery of the joystickget block within the teleop.vi does not have the added buttons. What else needs to be modified within the joystickget block to enable the buttons being accessible on the block periphery?
Delete the Joystick Get from the Teleop vi block diagram and add it back again. Then the new terminals will be noticed. You'll have to reconnect everything that was already wired.
  #24   Spotlight this post!  
Unread 02-02-2010, 14:12
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: Program Pnuematics

Ok. Thanks for the help.

Unfortunately, the more magic that happens 'behind the scenes', the less one is able to understand how things work - especially for debug. I did open 'down' into each vi to try and understand what each was doing. Sometimes the vi's look a bit cryptic to the 'casual observer'.
Thanks again.
  #25   Spotlight this post!  
Unread 02-02-2010, 15:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Program Pnuematics

Quote:
Originally Posted by sparks-1784 View Post
Ok. Thanks for the help.

Unfortunately, the more magic that happens 'behind the scenes', the less one is able to understand how things work - especially for debug. I did open 'down' into each vi to try and understand what each was doing. Sometimes the vi's look a bit cryptic to the 'casual observer'.
Thanks again.
Our team is new to LabVIEW this year too.

I think how the "magic" works (Alan please correct this if wrong) is that when the compressor code is initialized in Begin vi, it sets up an event-driven task. This task is triggered by an external hardware interrupt.

So for example, when the pressure sensor detects the compressor pressure has reached a certain level, the pressure sensor sends a discrete signal (perhaps by grounding the line) to one of the IO ports of the cRIO. This IO port is configured to sense this change and interrupt the cRIO processor and run the compressor task mentioned above. The compressor task asserts the cRIO IO that triggers the relay to shut off the compressor.

When the pressure drops below min operating level, the pressure sensor sends another signal (perhaps by un-grounding the line) which generates another interrupt, which runs the compressor task again, which turns the compressor back on.

What I've described above is sometimes referred to as "event-driven programming". You can see why there is no need to put any code in teleop vi, because the task is event-driven and does not need to be "called" periodically.

The teleop vi is also a form of event-driven task, but in this case it is not driven by an external event but rather by an internal clock. Every 20 milliseconds an internal clock in the cRIO generates an interrupt which runs the teleop task one time.

This is probably documented somewhere but I haven't found it yet. If my explanation here is redundant or incorrect I certainly welcome input.

We haven't gotten to the compressor code yet so any info is appreciated.


~
  #26   Spotlight this post!  
Unread 02-02-2010, 16:11
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 Pnuematics

Quote:
Originally Posted by Ether View Post
I think how the "magic" works (Alan please correct this if wrong) is that when the compressor code is initialized in Begin vi, it sets up an event-driven task. This task is triggered by an external hardware interrupt.
I don't have the detailed understanding of the system to be able to give a confident answer, but I thought the compressor control was essentially a hardware task, handled entirely by the FPGA.
  #27   Spotlight this post!  
Unread 02-02-2010, 16:16
Homsar66 Homsar66 is offline
Registered User
AKA: Ryan
FRC #0122 (NASA Knights)
Team Role: Human Player
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Virginia
Posts: 31
Homsar66 will become famous soon enough
Re: Program Pnuematics

Quote:
Originally Posted by Ozomalti View Post
Thanks that helped. but there is no way to control the psi with labview?
Sure. The longer the compressor is on, the higher the PSI!

Or for what you're really looking for, you'd have to attach a motor to a regulator and control the position of the servo/motor.
  #28   Spotlight this post!  
Unread 02-02-2010, 16:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Program Pnuematics

Quote:
Originally Posted by Alan Anderson View Post
I don't have the detailed understanding of the system to be able to give a confident answer, but I thought the compressor control was essentially a hardware task, handled entirely by the FPGA.
Aha. Thanks. I hadn't thought of that. If I ever find some docs I'll post links here.


~
  #29   Spotlight this post!  
Unread 04-02-2010, 07:36
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: Program Pnuematics

Welll - minor things like "not reading directions" contributed to our not getting the compressor code to work. It is working now after properly compiling (build) and loading into the cRIO (run as startup).

More code and integration of the hw/sw and in 8 or 9 weeks, we'll be done.


Thanks again for the help.
  #30   Spotlight this post!  
Unread 04-02-2010, 21:09
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,753
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: Program Pnuematics

I'm not magician responsible for the compressor code, but I'll take a pass at pulling back the curtains.

As mentioned, the compressor code is a bit more complex than most of the WPI code. This is because there were multiple authors writing modules, and each has their own personal style. On the one hand it means that there is a bit less consistency, but on the other, it means there are more samples to learn from.

The compressor implementation in LV demonstrates how to kick off totally asynchronous tasks which communicate with both HW and other compressor API calls.

The key to this approach is really in the Open VI. Provided there are no errors on input, the code allocates the DIO and Relay channels, creates two communication channel called RT FIFOs, Opens a reference to a reentrant VI, writes the I/O and FIFO refnums into the controls of the VI, and then invokes the Run method. Essentially pushing the Run button on the VI.

Honestly this is probably overkill for a single compressor, but the code spawns an asynchronous task so that it could handle any number of compressors, each with their own communications channels, I/O refnums, and timing loop. Again, probably overkill, but not a bad pattern for more complex entities where you have an undetermined number of instances.

To see what this spawned task does, double click on the static VI refnum, located towards the left of the diagram and looking like a document with a dog-ear tab and an alias/reference arrow. The double click will open the VI being spawned -- RunCompressor.vi.

The VI loops, but blocks waiting for the enabled FIFO to be written to or for a half-second timeout. If not enabled, it ensures that the relay is off. If enabled, it checks the pressure switch on the DI, updates the relay appropriately, and publishes the latest relay state so the API call to give compressor state has the current value. The loop terminates when the I/O is closed elsewhere and goes invalid.

The rest of the API updates the enabled FIFO, reads the relay state FIFO, etc.

The important take-aways of this code are ...

LV has a way to spawn any number of tasks, peek and poke values into the instance to act as parameters, block until completed or run asynchronously.

LV has a more efficient and more controlled data sharing mechanism than the global variable. It isn't clear that this is actually necessary for FRC robotics, but if you want to move from soft realtime towards hard realtime, this is the sort of data sharing mechanism that enables precise control of the various loops, VI instances, and parallel code.

To compare this approach to the other posts. The compressor could certainly be done in the FPGA. The FPGA would allow for polling at very high rates and would allow for a miniscule latency between the pressure switch transition and relay updates. Since there is really no need for this timing precision or loop rates, it would be relatively expensive in FPGA fabric for something that is easily done in other ways.

Similarly, interrupts could be used to have small latency response, and might make sense for a small micro, but for an I/O rich environment, you quickly run out of interrupt lines to directly tie to a switch. Again, a relatively precious resource for a task which doesn't necessarily need it.

I hope this was clear, but if not, please ask followup questions.
Greg McKaskle
Closed Thread


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
Pnuematics? Dylan FIRST Lego League 9 07-11-2006 13:49
pnuematics great_one411 Pneumatics 1 16-02-2003 11:50
Pnuematics Manual ark_1230 Pneumatics 2 09-09-2002 18:29
Pnuematics archiver 2001 4 23-06-2002 22:55
Pnuematics Travis Covington Pneumatics 2 22-01-2002 22:09


All times are GMT -5. The time now is 17:57.

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