Go to Post It’s not that we don’t have the time to teach first principals; it’s more that we (FIRST) don’t need to. - Jack Jones [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 14-12-2010, 15:35
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
HELP with TANK DRIVE PROGRAMMING

I am new with programming ,and I wanted to know how to turn down the motor speed if you are using the tank drive example in Labview ?
Reply With Quote
  #2   Spotlight this post!  
Unread 14-12-2010, 15:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by dcarswell View Post
I am new with programming ,and I wanted to know how to turn down the motor speed if you are using the tank drive example in Labview ?

Short answer: Move your joystick toward the neutral position.

If that's not what you are asking, please explain what you mean by "turn down the motor speed". Do you mean you want to limit the maximum speed? If so, just divide the output from each "joystick get axis" by 2 (or whatever factor you desire) before feeding them to the "tank drive" vi.

Note that this will not only limit your maximum speed, it will also limit the maximum force with which your robot can push.

Tell us what you are trying to accomplish and a better answer can be provided.




Last edited by Ether : 14-12-2010 at 15:48.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-12-2010, 15:46
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: HELP with TANK DRIVE PROGRAMMING

In the code the speed is being based off of how much you push the joystick forward,(of course) what I am asking is...is there a way to turn the motors speed down to say like 25% of its full power , so when you press the joysticks to the maximum position the motors will move 25% instead of the full 100%.
Reply With Quote
  #4   Spotlight this post!  
Unread 14-12-2010, 15:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by dcarswell View Post
In the code the speed is being based off of how much you push the joystick forward,(of course) what I am asking is...is there a way to turn the motors speed down to say like 25% of its full power , so when you press the joysticks to the maximum position the motors will move 25% instead of the full 100%.
Yes. See my previous post, as edited.

You will have to experiment with what factor to divide by to get your desired reduction to 25%

Again, please note that this severely limits the robot's maximum pushing force. So if you go uphill, or downhill, or the robot's friction changes, or you are pushing something, the max speed will change accordingly.

If you want to reduce maximum speed without affecting max pushing force, you will need to sense speed and create a controller to limit the speed. Are you interested in doing that?




Last edited by Ether : 14-12-2010 at 15:55.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-12-2010, 15:57
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: HELP with TANK DRIVE PROGRAMMING

The whole point of even limiting the speed was to take our last years robot and show the newbies how to drive it in tank drive mode...and we wanted to limit the damage that they might cause .
Reply With Quote
  #6   Spotlight this post!  
Unread 14-12-2010, 16:01
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: HELP with TANK DRIVE PROGRAMMING

Are than any steps you can give me or a help guide that is in labview that will show me how to divide functions?
Reply With Quote
  #7   Spotlight this post!  
Unread 14-12-2010, 16:11
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,713
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 with TANK DRIVE PROGRAMMING

Stay on topic or start a new thread. This cocktail party isn't helping the original poster...

Quote:
Originally Posted by dcarswell View Post
Are than any steps you can give me or a help guide that is in labview that will show me how to divide functions?

Here's an example for a single motor of what Ether is suggesting.
The 0.25 constant is the percentage of max power.
For tank drive you'd multiply both speed inputs to the Tank Drive vi.

You can also replace that fixed constant with an input from the throttle to make your power adjustable, so you can change it on-the-fly until you get the value you feel is right.

P.S.
Not that you've said you have this issue, but if turning at low power is a problem with your robot you can also do something in software that doesn't require adding sensors, physically changing the gearing, or swapping out sticky wheels for slicks.
In your code you can avoid applying the power reduction to any turning component or make just turning a higher percentage. For example, if one of your joysticks is forward and the other is backward, then don't reduce the power to the joysticks. If they are both forward but to varying degrees, so you get a curved driving path, then leave the difference between the sticks alone and only reduce the straight component.
Attached Thumbnails
Click image for larger version

Name:	Joystick_Restriction.jpg
Views:	54
Size:	11.1 KB
ID:	9496  Click image for larger version

Name:	Joystick_Throttle_Restriction.jpg
Views:	47
Size:	12.6 KB
ID:	9498  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 15-12-2010 at 12:44.
Reply With Quote
  #8   Spotlight this post!  
Unread 15-12-2010, 13:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by Mark McLeod View Post
P.S.
Not that you've said you have this issue, but if turning at low power is a problem with your robot you can also do something in software that doesn't require adding sensors, physically changing the gearing, or swapping out sticky wheels for slicks.
In your code you can avoid applying the power reduction to any turning component or make just turning a higher percentage. For example, if one of your joysticks is forward and the other is backward, then don't reduce the power to the joysticks. If they are both forward but to varying degrees, so you get a curved driving path, then leave the difference between the sticks alone and only reduce the straight component.

Here's one possible implementation of what Mark has suggested:

Let Y1 be the left joystick command and Y2 be the right joystick command.

Then compute these modified joystick commands:


Y1' = [(a+1)*Y1 + (a-1)*Y2]/2

Y2' = [(a-1)*Y1 + (a+1)*Y2]/2


where "a" is your speed adjustment factor, e.g. 0.25

Then send the modified Y1' and Y2' commands to the tank drive vi.



This transformation yields Y1' and Y2' values which are always in the range -1 to +1 (assuming that Y1 and Y2 were in that range).

It also handles cases where [(Y1>0) and (Y2<0)] or [(Y1<0) and (Y2>0)], so no conditional logic is required.



Reply With Quote
  #9   Spotlight this post!  
Unread 15-12-2010, 18:49
Cyberphil's Avatar
Cyberphil Cyberphil is offline
That Guy
AKA: Phil
FRC #0103 (Cybersonics)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Kintersville
Posts: 753
Cyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud ofCyberphil has much to be proud of
Send a message via AIM to Cyberphil
Re: HELP with TANK DRIVE PROGRAMMING

Now, I do not know about your robot at all, but rather than doing this with the programming, why don't you just change the gear ratio of the DT? This will probably save a lot of headache (If your DT is anything like ours). It will, in turn, give you more power, but in most robot destruction cases I have seen in the past 4 years, it has been because of the speed of the bot.

If this is not what you are looking for, then please just disregard this! Hope this helps!
Reply With Quote
  #10   Spotlight this post!  
Unread 15-12-2010, 20:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by Cyberphil View Post
why don't you just change the gear ratio of the DT? It will ... give you more power
i.e. , if you gear it down further, it will reduce the top speed, and increase the pushing force.





Last edited by Ether : 15-12-2010 at 21:11.
Reply With Quote
  #11   Spotlight this post!  
Unread 14-12-2010, 16:00
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,624
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Additionally, if the drive wheel base & wheel friction aren't designed properly, the drive train will have a very hard time turning at 25% power output. I'd recommend a slightly more advanced program that allows a bit more power output so long as sensor feedback doesn't exceed the desired straight-line speed (as Ether is eluding to). Another way to solve it would be to change the gearing on the sprockets to a much lower speed so you don't have to mess with the programming at all. If the robot will never see a competition field, parade, football game, or other long-distance movement ever again, I'd say that it's a safe move.

Or you could put the bumpers on and get into a more open area. You could also stipulate that intentional damage will result in immediate dismissal from the team ... that tactic works most of the time on our team.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub

Last edited by JesseK : 14-12-2010 at 16:04.
Reply With Quote
  #12   Spotlight this post!  
Unread 14-12-2010, 16:03
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,601
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by Ether View Post
Note that this will not only limit your maximum speed, it will also limit the maximum force with which your robot can push.
At the risk of veering off topic, why is this the case?
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #13   Spotlight this post!  
Unread 14-12-2010, 16:06
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,624
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by Chris is me View Post
At the risk of veering off topic, why is this the case?
The controllers limit the voltage (or current?), thereby limiting the torque outputs of the motors.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote
  #14   Spotlight this post!  
Unread 14-12-2010, 16:12
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,055
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by JesseK View Post
The controllers limit the voltage (or current?), thereby limiting the torque outputs of the motors.
Neither... the controllers pulse a voltage (12v in our case). http://homepages.which.net/~paul.hil...llersBody.html Has a little more info.

Edit: Thinking more on it. JesseK is "correct" as far as I can tell. Because of the pulsing of the output you are limiting the amount of current which limits the amount of torque. He is correct but I wanted to make sure there was no confusion about how an ESC worked.
__________________




.

Last edited by Andrew Schreiber : 14-12-2010 at 16:21.
Reply With Quote
  #15   Spotlight this post!  
Unread 14-12-2010, 16:21
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

You may need a multiplier of 0.35-0.4 at a minimum in order to get the drive motors working well.
__________________
Jon Mittelman

Senior Judge Advisor New England & Israel 2014-2015
Infinite Loop Mentor 2011-2015
TechnoTicks Mentor 2000-2011
Championship Chairman's Award 2009 Team236 TechnoTicks
Judge 2010-2015 Championships
Senior Judge Advisor New England District Championship 2014-2015
Judge Advisor Tel Aviv Regional 2007-2015
Judge Advisor Pine Tree Regional 2013
Maine Regional Planning Committee
New England District Planning Committee
Lead Inspector Microsoft Tel Aviv Regional 2006-2008
Judge & Lead Inspector GM/Technion Tel Aviv Regional 2006
Judge UTC Hartford Regional 2006
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
Need help with tank drive nickcvet89 NI LabVIEW 16 02-02-2010 16:35
Problem with tank drive Mr. E NI LabVIEW 6 27-01-2009 16:59
Help with programing Tank Drive in Lab View zackcool123 NI LabVIEW 3 18-01-2009 19:49
EASY C PRO help tank drive issues!!! can any 1 solve this programming issue? mayazk Programming 2 16-02-2008 02:17
Tank Drive help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Idaman323 Programming 3 18-02-2005 15:17


All times are GMT -5. The time now is 08:26.

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