Go to Post The 3 probably stands for the number of years this season will take off your life - JohnSchneider [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 03-02-2015, 16:40
deltawar567 deltawar567 is offline
Registered User
FRC #4791 (Pandroids)
Team Role: Engineer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, IN
Posts: 7
deltawar567 is an unknown quantity at this point
Help programming motor

So we need a motor to function for an elevator. I have little experience with programming in Labview.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2015, 17:39
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,833
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: Help programming motor

Here's an example that uses the x axis of a joystick to run a single motor.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2015, 17:45
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: Help programming motor

Start with the FRC examples that were installed with LabVIEW. You can find the link to them on the Support tab of the Getting Started window. Use the Tutorials to learn how to incorporate the example code into your robot project.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2015, 22:30
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
Re: Help programming motor

Quote:
Originally Posted by Mark McLeod View Post
Here's an example that uses the x axis of a joystick to run a single motor.
I am using the "button control of motor example". What is that tan box that comes out of the Joystick Get Values box and how do I get it?

Thanks.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2015, 22:36
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Help programming motor

That is an index array. You can get that from the array palette. Both the axis and button outputs are arrays. The array that is linked to those outputs will output the axises/buttons of the joystick in chronological order. It's a neat way to visualize the functions of the joystick.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #6   Spotlight this post!  
Unread 03-02-2015, 22:39
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: Help programming motor

Quote:
Originally Posted by itwasntme455 View Post
What is that tan box that comes out of the Joystick Get Values box and how do I get it?
If you hover the mouse over anything in LabVIEW, the contextual help window will tell you a lot about it. If your help window is not showing up, press control-H to enable it.

I think you're talking about the Index Array function. You will find it in the Arrays subpalette, in the top row of the function palette that appears when you right-click on a blank spot in a vi's block diagram. Its inputs are an array of values (such as the boolean array that comes out of the Buttons terminal) and one or more integers. The output(s) give(s) you the value(s) in the specified location(s) of the array.
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2015, 23:13
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
Re: Help programming motor

I put that in the Teleop.vi. Now i'm confused, how does it know what button and PWM slot the motor is plugged into. We are also using a Logitech controller and would like L2 to make the motor spin one way and R2 the other way.

http://www.walmart.com/ip/16419686?wmlspartner=wlpa&selectedSellerId=0&adid= 22222222227000769916&wl0=&wl1=g&wl2=c&wl3=40880497 232&wl4=&wl5=pla&wl6=78810873152&veh=sem
Reply With Quote
  #8   Spotlight this post!  
Unread 03-02-2015, 23:44
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: Help programming motor

The right half of Team358's Single Motor Example, the part labeled "Teleop.vi", goes in the Teleop vi. The left half, labeled "Begin.vi", goes in the Begin vi. The other examples assume the same Begin.vi code.

The enumerated constant wired to the input of the Motor Open function defines which PWM channel is being controlled. The index numbers wired to the Index Array pull the associated button values from the array. I think the L2 button on a Logitech gamepad is number 6, and R2 is button number 7, but you can find out for yourself by setting a probe on the Buttons array coming out of the Joystick Get Values.
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2015, 16:06
deltawar567 deltawar567 is offline
Registered User
FRC #4791 (Pandroids)
Team Role: Engineer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, IN
Posts: 7
deltawar567 is an unknown quantity at this point
Re: Help programming motor

Quote:
Originally Posted by Alan Anderson View Post
The right half of Team358's Single Motor Example, the part labeled "Teleop.vi", goes in the Teleop vi. The left half, labeled "Begin.vi", goes in the Begin vi. The other examples assume the same Begin.vi code.

The enumerated constant wired to the input of the Motor Open function defines which PWM channel is being controlled. The index numbers wired to the Index Array pull the associated button values from the array. I think the L2 button on a Logitech gamepad is number 6, and R2 is button number 7, but you can find out for yourself by setting a probe on the Buttons array coming out of the Joystick Get Values.
Where do we find the probe?
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2015, 16:13
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: Help programming motor

Quote:
Originally Posted by deltawar567 View Post
Where do we find the probe?
Right-click a wire. One of the commands in the pop-up menu is "Probe". That will add a line to the Probe Watch Window which will show you the current value on the wire when the code is running.

You need to "Run" the Robot Main vi using the white Run arrow at the left end of the toolbar (as opposed to "Build" and "Run as startup") in order for the interactive debugging to be available.
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2015, 16:46
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
Re: Help programming motor

How do you change the max speed of the motor?
Reply With Quote
  #12   Spotlight this post!  
Unread 04-02-2015, 21:09
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: Help programming motor

Quote:
Originally Posted by itwasntme455 View Post
How do you change the max speed of the motor?
In the Button Control of Motor Example, the numbers with orange outlines are the values that get sent to the motor. You can change the "1" to whatever value you want to set when the "forward" button is pressed, and the "-1" to the "backward" value. (You can even change the "0" for the motor to run at some speed when neither button is pressed, but that's probably not what you want.)
Reply With Quote
  #13   Spotlight this post!  
Unread 04-02-2015, 21:49
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
Talking Re: Help programming motor

Quote:
Originally Posted by Alan Anderson View Post
In the Button Control of Motor Example, the numbers with orange outlines are the values that get sent to the motor. You can change the "1" to whatever value you want to set when the "forward" button is pressed, and the "-1" to the "backward" value. (You can even change the "0" for the motor to run at some speed when neither button is pressed, but that's probably not what you want.)
Thank you so much for all the help. We got it all programmed and working. Team 4791 Thanks you.
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 21:23.

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