Go to Post The flux capacitor should have been allowed under the flowchart as long as it met the single component maximum cost. I did check with Digikey and they no longer carry the line. - Al Skierkiewicz [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 11-02-2011, 20:23
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Autonomous-Analog Signals?

We are trying to get a potentiometer to turn on a motor when a potentiometer voltage is 4.8V. Our problem is the ANALOG CHANNEL_GET VOLTAGE VI only gets the voltage from the potentiometer once. We need it to keep reading the voltage until it reaches 4.8V.
Attached Thumbnails
Click image for larger version

Name:	autonomous.jpg
Views:	32
Size:	90.4 KB
ID:	10071  
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2011, 05:49
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,752
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: Autonomous-Analog Signals?

Assuming this is in Autonomous, put a small loop around the Read Voltage and the compare.

You may also want to consider other conditions which would stop the loop and turn off the motor. In other words, is there a time limit that makes sense, or should the motor run no matter what until the switch is hit. You may also want a small delay in the loop -- check every 10ms or so.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2011, 09:18
baronep's Avatar
baronep baronep is offline
Student President
FRC #2848 (Jesuit All-Sparks)
Team Role: Leadership
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Dallas TX
Posts: 167
baronep is on a distinguished road
Re: Autonomous-Analog Signals?

Careful with the above suggestion. Using a while loop should work fine in autonomous but realize that you cannot reuse this code in teleop mode. You cant use these loops in teleop mode because while you are evaluating the loop, the cRIO isn't updating any of the PWM ouputs. This will consequently cause a watchdog error. Instead there is a block under timing which evaluates a set time and outputs a boolean when it has elapsed and can be easily reset.

Hope this helps,
baronep
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2011, 10:51
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Autonomous-Analog Signals?

Thanks! I inserted while loops and now the autonomous code runs beautifully. I also ran the DS practice mode and had no problem (watchdog errors) transitioning from autonomous to teleop.

Thanks All!
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:31.

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