Go to Post It’s possible to make friends without agreeing on everything. - Bill Gold [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 27-02-2010, 15:05
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
need a simple motor program

I am using the basic FRC wizard to generate the program and the only modification is that i have switched the default 2 motor tank to a 4 motor arcade by simply replacing the VI's. This worked fine. i need to control a motor on the 2nd joystick y axis thru pwm 5. i understand a little about labview but i cannot figure out where to place code for this motor. does it need to placed inside the execute case struture on Teleop? do i need to set up references in the Begin part. the software gives examples but no clear explanation of where it goes. if someone could give me a simple solution and preferably a diagram, that'd be great!

Last edited by Bill Taylor : 27-02-2010 at 15:09.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-02-2010, 17:09
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: need a simple motor program

Did you find the single motor palette okay?
It can be gotten to in two different places:
WPI Robotics Library -> Actuators -> MotorControl
or
WPI Robotics Library -> RobotDrive ->Advanced -> MotorControl
----------------------------------------
Begin.vi -- open everything here
  • Motor Open (open the PWM and tell LabVIEW what it's going to be)
  • Motor Refnum Set (name your motor)
Teleop.vi -- use everything here
  • Motor Refnum Get (usually kept outside the case, so it can be used in all cases if necessary)
  • Motor Set speed (inside the Teleop Execute case)
Finish.vi -- close everything here
  • Motor Refnum Get
  • Motor Close
I removed much of the cluttering default code in these screen shots.
Attached Thumbnails
Click image for larger version

Name:	MotorExampleB.jpg
Views:	33
Size:	34.3 KB
ID:	8820  Click image for larger version

Name:	MotorExample.jpg
Views:	48
Size:	34.7 KB
ID:	8818  Click image for larger version

Name:	MotorExample3.jpg
Views:	36
Size:	34.9 KB
ID:	8819  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-02-2010 at 17:42.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-02-2010, 17:49
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
Re: need a simple motor program

thanks. i've plugged this in and its running. i've tied it to a window motor and when i push on the stick full it moves but very slow, even for a window motor. while in operator mode the driver station shows the #5 PWM feedback as only about half even though i'm pushing the stick all the way. anyway to speed it up full?

Last edited by Bill Taylor : 27-02-2010 at 17:58.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-02-2010, 18:02
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: need a simple motor program

Are you using a Victor or a Jaguar?
Make sure the Motor Open in Begin.vi is set for the correct one.

Other than that, I'd suspect the joystick wasn't doing it's best.
Make sure when you plug in the USB joystick that it's in neutral.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-02-2010 at 18:05.
Reply With Quote
  #5   Spotlight this post!  
Unread 27-02-2010, 18:04
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
Re: need a simple motor program

victor. its set in the Begin.
Reply With Quote
  #6   Spotlight this post!  
Unread 27-02-2010, 18:08
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: need a simple motor program

The Victor might need to be calibrated then.
Page 2 of this.
No, strike that. The Dashboard PWM indicator could only be fooled by the joystick input.

You can take the joystick out of the loop temporarily by changing the Motor Set Speed to use a constant (1=full backwards or -1=full forwards).
Since the window motors probably attached to something, you can pull the breaker for it and just watch the Dashboard PWM indicator to see if it goes to full.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-02-2010 at 19:26.
Reply With Quote
  #7   Spotlight this post!  
Unread 27-02-2010, 18:24
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
Re: need a simple motor program

recalibrated the victor and switched joysticks. same effect. its like its running at almost half speed. any way to double the value between the joystick vi and get speed vi?
Reply With Quote
  #8   Spotlight this post!  
Unread 27-02-2010, 18:43
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: need a simple motor program

Is the Victor status light going red when you push the joystick all the way forward-an indication of full speed?

You can certainly multiply the joystick output, but the range of the motor speed is only -1 to 1, the same as the joystick. A larger number would get cut back to 1. And calibrating the victor to the joystick range should have made it full speed no matter what.

Not a low battery, bad wire connection, or anything simple like that is it?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-02-2010 at 18:47.
Reply With Quote
  #9   Spotlight this post!  
Unread 27-02-2010, 19:30
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
Re: need a simple motor program

you're right, doubling the value didn't help. it has the same behavior. wiring and all that looks good and everything works as expected (lights, blinkies, indicators) except it is slow.
Reply With Quote
  #10   Spotlight this post!  
Unread 27-02-2010, 19:36
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: need a simple motor program

Is it a new motor, possibly damaged?
That's the only other thing that comes to mind.

At full speed you should be able to test with a multi-meter to see if the motor's receiving the full 12v or close to it. Readings at other speeds won't come out right without a more sophisticated meter.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #11   Spotlight this post!  
Unread 27-02-2010, 19:41
Bill Taylor Bill Taylor is offline
Registered User
FRC #0388
 
Join Date: Dec 2008
Location: Grundy, VA
Posts: 12
Bill Taylor is an unknown quantity at this point
Re: need a simple motor program

thats the only thing i can think of is a bad motor or controller. i'm gonna swap them out at the shop monday and see if something happens. this victor came out of an "old box" and may have went bad. might just switch it with a jaguar. thanks for the help. i really appreciate it.
Reply With Quote
  #12   Spotlight this post!  
Unread 27-02-2010, 22:30
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: need a simple motor program

Quote:
Originally Posted by Bill Taylor View Post
recalibrated the victor and switched joysticks. same effect. its like its running at almost half speed. any way to double the value between the joystick vi and get speed vi?
Doubling a value is easy, but there's obviously something unusual going on here. Let's try to figure out what's wrong before trying to patch it.

Run the code (open the Robot Main vi and click the white "run" arrow at the top) and probe the value coming out of the joystick vi. If it doesn't go full range (+1 to -1) as you move the joystick, that's a clue that the problem is in one direction. If it does go full range, that's a clue that the problem is in a different direction. What do you see?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with simple program Rob Stehlik C/C++ 2 23-10-2009 15:00
pic: Motor program Team2339 Extra Discussion 3 30-01-2009 15:56
Need a simple challenge for VEX summer camp Andrew Schuetze Math and Science 5 05-04-2008 21:46
EasyC Question regarding simple program aeasson Programming 6 14-01-2008 23:16
HELP writing simple delphi program! dave_macca Programming 1 25-03-2004 00:35


All times are GMT -5. The time now is 22:01.

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