Go to Post Everyone better enjoy the broadcast, Dave had to cancel a shuttle launch to make it happen :D - The Lucas [more]
Home
Go Back   Chief Delphi > Technical > National Instruments LabVIEW and Data Acquisition
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 19-01-2009, 16:06
Joshamuffin Joshamuffin is offline
Programmer
FRC #1723 (FBI)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Missouri
Posts: 24
Joshamuffin will become famous soon enough
Send a message via MSN to Joshamuffin
Splitting RobotDriveDevRef into separate motor references.

Can you split RobotDriveDevRef into separate motor references? I tried unbundle by name. I get DevStatus, Motors[], Sensitivity, and Square Inputs. I tried using Motors[] for a Motor/Get-Speed Function. Wrong data match. I tried splitting Motors[] using unbundle by name. Wrong data match. The other programmers are using Drive functions that use RobotDriveDevRef in their autonomous code they are developing. I could change all of the autonomous code to use separate motor openings and Motor/Set-Speed functions. However, I would prefer to avoid it. It's vastly easier to use the drive functions.

BTW, we are using a Drive/Open-2-Motor function to open. We are using two motors to drive the back wheels independently. The kind of drive system that is conveniently done by tank drive.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2009, 23:58
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: Splitting RobotDriveDevRef into separate motor references.

Motors[] is an array, not a cluster, so you can't unbundle it. You can use the "Array to Cluster" tool to turn it into a cluster that can then be unbundled, or you can use other array tools to select specific items from the array directly.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2009, 07:54
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 744
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: Splitting RobotDriveDevRef into separate motor references.

I use motors[] and then "index array" to strip out the motors I want. Don't forget the first motor is index 0.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2009, 09:37
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Splitting RobotDriveDevRef into separate motor references.

I've been using LabVIEW for so long that I never bothered to learn a really cool trick about "index array" - you can resize it by extending the bottom or top edges to extract multiple items from the array without having to plop down multiple copies. Very nifty trick. I think that there are even provisions for automatically incrementing the index based on an initial value.

Russ
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2009, 20:25
Joshamuffin Joshamuffin is offline
Programmer
FRC #1723 (FBI)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Missouri
Posts: 24
Joshamuffin will become famous soon enough
Send a message via MSN to Joshamuffin
Re: Splitting RobotDriveDevRef into separate motor references.

I got it to work finally. I was having trouble with something else, also. Once I fixed the program, I ran out of the school with a chair above my head and shook it at passing cars for a couple minutes without a coat. I eventually went back in, frozen. It was something that shouldn't have made a difference. I was combining the values into a tank drive statement with the original Drive Reference connected. I went through at least 5 different methods of increasing complexity to get the motors to transition towards what the joystick was telling it to do. I eventually came up with a way that was far simpler than my first. It was unquestionably logically sound. I still couldn't get it to work. I decided it was LabVIEW's fault. I started messing around with other statements to make sure it was fine. It should have been. I eventually, in a fit of desperation, deleted the Tank Drive and replaced it with two Motor/Set-Speed's. It worked. The Tank Drive should have done the same thing.

Also, here is what I did in the C++ equivalent. I actually write it in C++ before I do it in LabVIEW because I pretty much think in C(++). Note that the variables are not copy/pasteable.

Code:
speedMax = speed + maxChange;
speedMin = speed - maxChange;

if(command > speedMax)
{
	motor = speedMax;
}
else
{
	if(command < speedMin)
	{
		motor = speedMin;
	}
	else
	{
		motor = command;
	}
}
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
Pointers/References? htwiz2002 Programming 7 29-01-2007 22:21
Separate Processor & Robot Rules JoeXIII'007 Control System 7 20-01-2006 19:59
Fisher Price Motor Into Drill Gearbox Chris Technical Discussion 11 21-04-2004 09:09
Please help asap.. Where do the victor motor 3 pin wires plug into 1166 Electrical 10 16-02-2004 12:07


All times are GMT -5. The time now is 18:30.

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