Go to Post MAVERICKS, do ride horses...all while building robots. They also build horses. - Corey Balint [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,065
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,065
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: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,659
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
  #7   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
  #8   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,668
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
  #9   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,659
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
  #10   Spotlight this post!  
Unread 14-12-2010, 16:11
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,795
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:	55
Size:	11.1 KB
ID:	9496  Click image for larger version

Name:	Joystick_Throttle_Restriction.jpg
Views:	48
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
  #11   Spotlight this post!  
Unread 14-12-2010, 16:12
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,060
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
  #12   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
  #13   Spotlight this post!  
Unread 14-12-2010, 16:33
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,659
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 Andrew Schreiber View Post
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.
Hmm

The second paragraph under "Theory of a Speed Controller" states that it's an 'averaged' effect of lowering the voltage by switching the full-voltage signal on and off. Later on the page, a figure shows the effect of the PWM switching on current as if the signal 'pulses' the current, thereby averaging it to a lower value as well. Rather than neither I'm inclined so say 'both' ... but really I'm just getting confused.

I'll look at it more later. Thanks for the link.
__________________

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:40
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,060
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
Hmm

The second paragraph under "Theory of a Speed Controller" states that it's an 'averaged' effect of lowering the voltage by switching the full-voltage signal on and off. Later on the page, a figure shows the effect of the PWM switching on current as if the signal 'pulses' the current, thereby averaging it to a lower value as well. Rather than neither I'm inclined so say 'both' ... but really I'm just getting confused.

I'll look at it more later. Thanks for the link.
Yeah, I'm talking with an EE who has a better understanding than and he is saying that the Jags also have the capability of being operated in a Voltage or Current mode over CAN.

I have a few other links regarding ESC design and construction if you are interested. It has been a couple years since I read them and I admit they move way beyond my understanding pretty quickly.
__________________




.
Reply With Quote
  #15   Spotlight this post!  
Unread 14-12-2010, 17:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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




If you are using a Victor, or a Jaguar with servo input (not CAN), then your command to the Victor (or Jaguar) results in an output voltage to the motor being controlled.

The motor then draws current (at that voltage) according to how heavily it is loaded. As you load the motor, the motor slows down and draws more current (according to the motor's current vs torque curve for that particular voltage).

This is variously referred to as open-loop control or voltage control.

If you limit the inputs to the tank drive vi, what you are doing is limiting the available maximum voltage supplied to the motors.

Limiting the maximum voltage to the motors limits the maximum speed of the motors, but it also limits the amount of current that can flow when the motors are trying to push something. It is current that provides torque, so this limits the motor torque and thus the robot's pushing force.

The output voltage from the Vic or Jag is modulated by a technique called Pulse Width Modulation (PWM). The voltage is alternately turned ON and OFF at a high rate of speed (15,000 times per second for the Jag and 150 times per second for the Vic). The motor sees this as if it were a steady DC voltage equal to the percent of the time the voltage is ON. For example, if the voltage is ON 75% of the time and OFF 25% of the time, the motor would think it is getting 9 volts DC (75% of 12).


Now, having said all that, there are ways to operate the motor other than voltage control. One such way is speed control. This requires that you have a sensor to sense the motor's (or the wheel's) speed.

What you can do is to feed the speed signal to the cRIO. Your software looks at the speed and says "hey, it's going slower (or faster) than what I wanted". Your software then increases (or decreases) the command until the motor is doing what you want. This is called a closed-loop control. There are many ways to do this. One very popular way is called PID. LabVIEW provides a PID vi to do this.

Another option, available on the Jag only, and only if using CAN, is to connect the speed sensor directly to the Jag instead of the cRIO. The Jag has a microcontroller inside it, with a built-in PID algorithm, and the Jag can "close the loop" for you so you don't have to do it in the cRIO. The Jag provides options for controlling speed, position, or current.





Last edited by Ether : 14-12-2010 at 17:37.
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 10:15.

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