Go to Post Man, Dave always has to one up us. We build robots to play games, he build robots to go on other planets, Elgin makes CD 30 inches, you make it 63 inches. - Levin571 [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 05-03-2012, 22:55
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Programming Potentiometer for Shooter

Hey guys, I have a potentiometer that I want to program for our shooter. The basic idea is that we would have a potentiometer on our driver station with a knob (bought from radioshack ) that will control the speed of our shooter. The knob will start in a position which would have the motor off but once the knob is turned it would turn on the shooter motor and the speed would be get either faster or slower by turning the knob. This is similar to a volume control on a pair of headphones or speakers. I was wondering how I would be able to do this in Labview? We will be using the eStop robotics custom control interface to plug into the driver station because we had problems with the cypress board in the past.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 06-03-2012, 00:40
Blackphantom91's Avatar
Blackphantom91 Blackphantom91 is offline
Mentor + 4 = Stuck For Life
AKA: Malcolm Stirckland
FRC #1986 (Team Titanium)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Kansas City
Posts: 232
Blackphantom91 has a spectacular aura aboutBlackphantom91 has a spectacular aura aboutBlackphantom91 has a spectacular aura about
Re: Programming Potentiometer for Shooter

The values of the pot would be the values for the shooter it depends on how far the pot turns. if you go positive 30 degrees that's a set point from 0 to 10 in motor output, you also could scale the pot down to what ever finer values you would like. You basically have to know what the values are on your pot then from there put set points for certain motor speeds.
__________________
[img*]http://i.imgur.com/Os2oTET.jpg[/img*]
Reply With Quote
  #3   Spotlight this post!  
Unread 06-03-2012, 08:48
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 136
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: Programming Potentiometer for Shooter

Quote:
Originally Posted by nickcvet89 View Post
We will be using the eStop robotics custom control interface to plug into the driver station because we had problems with the cypress board in the past.
According to eStop Robotics, that board gets read as a joystick input on your robot. For the Joystick Open VI, choose the JoystickDevice input to match the location of your eStop CCI on the Driver Station Setup tab. For example, if your CCI is in location 2 on the DS, then your JoystickDevice input would be USB 2 in the robot code.

There is another alternative you could use. On the I/O tab of the DS, when it is set to Compatible Mode, you will see Analog Input sliders. You could read these instead of an external potentiometer. In this case you would read the values on the robot using the WPI Robotics Library>>DriverStation>>Compatibility I/O>>WPI_DriverStationGet Analog Input.vi. Then you would scale it accordingly to drive your motor.
__________________
Doug Norman
National Instruments
Reply With Quote
  #4   Spotlight this post!  
Unread 06-03-2012, 20:34
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Re: Programming Potentiometer for Shooter

Thanks for the replies, I am wondering what vi's would I use for the pot?
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 06-03-2012, 20:45
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Programming Potentiometer for Shooter

If you read one of the analog inputs from the I/O board, it will have a range of 0 volts to 3.3 volts. Your output to the motor should be in the range of 0 to 1 because you will be driving it in only one direction.

A simple division of the read analog voltage by 3.3 will yield an output in the range of 0 to 1. So, all you need to do then is feed that to the motor output.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #6   Spotlight this post!  
Unread 06-03-2012, 21:27
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Re: Programming Potentiometer for Shooter

Quote:
Originally Posted by Doug Norman View Post
According to eStop Robotics, that board gets read as a joystick input on your robot. For the Joystick Open VI, choose the JoystickDevice input to match the location of your eStop CCI on the Driver Station Setup tab. For example, if your CCI is in location 2 on the DS, then your JoystickDevice input would be USB 2 in the robot code.

There is another alternative you could use. On the I/O tab of the DS, when it is set to Compatible Mode, you will see Analog Input sliders. You could read these instead of an external potentiometer. In this case you would read the values on the robot using the WPI Robotics Library>>DriverStation>>Compatibility I/O>>WPI_DriverStationGet Analog Input.vi. Then you would scale it accordingly to drive your motor.
Would the analog input(like a potentiometer) then act as a joystick and the digital inputs act as buttons on the joystick vi's? That seems to be my understanding.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 07-03-2012, 18:38
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Re: Programming Potentiometer for Shooter

Ok so I have had success with programming this. Essentially what I did was in Teleop called the joystick vi's like you normally would when you want to do tank drive or other joystick related things and set the axis 1 as the shooting axis. The reason why I choose axis 1 is because on the board the analog inputs it gives you are call X, Y, Z, R. I assumed they all followed the the same in LV. This worked with great success but the problem I have is that when you turn the POT, you have a neutral position(zero position) where the shooter motor is not running and when you turn the knob to one side it goes forward and the other side spins the motor in reverse. Is there any way where I can take the values from from one extreme and use this as my starting position where the motor spins forward and increases the speed as you turn the knob?
__________________
Reply With Quote
  #8   Spotlight this post!  
Unread 07-03-2012, 20:40
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: Programming Potentiometer for Shooter

Joystick values range from -1 to +1. You want to run the value through a formula that produces an output from 0 to +1 before you feed that to the motor, right? That's easy: add one, then divide by two.
Reply With Quote
  #9   Spotlight this post!  
Unread 07-03-2012, 20:47
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Re: Programming Potentiometer for Shooter

Quote:
Originally Posted by Alan Anderson View Post
Joystick values range from -1 to +1. You want to run the value through a formula that produces an output from 0 to +1 before you feed that to the motor, right? That's easy: add one, then divide by two.
Ahh, thanks for this, I completely forgot about adding one and dividing by two.
__________________
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 11:21.

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