Go to Post Truly good teasers should give people a good place to start guessing, while still leaving some mystery and uncertainty. - Travis Covington [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 26-01-2013, 14:00
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Set the rate of acceleration

How can I set the rate of acceleration so when I drive the robot forward it doesn't do a wheeling all the time. My teammates are young and like to hit the joystick hard. I don't want to limit the max speed, but rather set a rate of acceleration so it's a nice slow increase in speed. A visual would be awesome I'm a newbie
__________________
Ben
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2013, 14:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Set the rate of acceleration

Quote:
Originally Posted by BPtigers View Post
How can I set the rate of acceleration so when I drive the robot forward it doesn't do a wheeling all the time. My teammates are young and like to hit the joystick hard. I don't want to limit the max speed, but rather set a rate of acceleration so it's a nice slow increase in speed. A visual would be awesome I'm a newbie
What you want is a rate limit on your joystick command.

You want the LabVIEW equivalent of something like this:

Code:
o = joystick;
if  (o > op+d) o = op+d;
else if (o < op-d) o = op-d;
op = o;
... where

"joystick" is the present value of the joystick command
"o" is the output to the motor controller
"op" is the previous output to the motor controller
"d" is the maximum change you want to allow each iteration


Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2013, 14:14
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Re: Set the rate of acceleration

So how would I do that in labview?
__________________
Ben
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2013, 15:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Set the rate of acceleration

By the way, there are lots of goodies that ship with LabVIEW that aren't in the FRC palette. In this example, there is an Output Rate Limiter. It basically does what Ether described, but is already coded up.

It is in vi.lib/addons/control/pid/pid.llb. You probably want to wire the input from the joystick, the output to the motor, and use the output rate to control how much it will allow the output to change in a given time period. The units it uses may not be obvious, but numbers in the range of 100 to 1000 are likely what you are looking for.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2013, 22:06
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Re: Set the rate of acceleration

I believe I found the pid thing, but I'm not sure which one it is, or how to hook it up to what? Also I have no idea what your talking about the 100 to the 1000 thing where is that? I am newbie Sorry for any frustrations, Thanks
Attached Thumbnails
Click image for larger version

Name:	pid.JPG
Views:	89
Size:	42.6 KB
ID:	13692  
__________________
Ben
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2013, 23:24
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: Set the rate of acceleration

Quote:
Originally Posted by BPtigers View Post
I believe I found the pid thing, but I'm not sure which one it is, or how to hook it up to what?
You want the PID Output Rate Limiter.vi (it's the bottom one of the three in your image). As with any LabVIEW function, its inputs and outputs are described in the popup help. The only inputs you need to be concerned with are "input" and "output rate", and the output is called "output".

Just insert it on the wire where you want to limit the rate of change of a value, with the source connected to "input", the destination connected to "output", and a number representing the maximum rate of change connected to "output rate". You can use a front-panel control as the source of the rate number, so you can change it while the program is running. Just remember to either replace it with a constant or "make current value default" when you determine the rate you want.

Quote:
Also I have no idea what your talking about the 100 to the 1000 thing where is that? I am newbie Sorry for any frustrations, Thanks
The output rate is in units of "EGU per minute". Since you probably want to limit the motor rate of change to go from full scale reverse to full scale forward in about a half second (give or take an factor of two or so), that's something like 4 per second, which is 240 per minute. Start there and tweak it up or down until you get a value that works for you.
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2013, 20:51
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Re: Set the rate of acceleration

Okay I have it hook up but I'm a little hazy yet with the EGU what does that mean? So lets say the acceleration was at 100% before this which was too fast. What would be the setting for say 75% acceleration. So do I limit it in the EGU dot or what dot do I exactly limit it thanks. visuals are awesome, but are not necessary.
Attached Thumbnails
Click image for larger version

Name:	pid.JPG
Views:	71
Size:	52.2 KB
ID:	13707  
__________________
Ben
Reply With Quote
  #8   Spotlight this post!  
Unread 29-01-2013, 07:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Set the rate of acceleration

EGU stands for engineering units. It is vague because the limiter is just a mathematical operation, sorta like averaging. It can work on anything you want to control, temperature, voltage, current, etc. In this case it is the 0 to 1 motor controller value.

Leaving it set to 1 will, I believe, limit it to a one unit change per minute. Seems a bit timid. A setting of 60 will take one second to let it change by one unit. 120 will ramp from 0 to one in half a second, and so on.

Since the speed controllers in your teleop are running 50 times per second, and the code could currently change the value instantaneously from -1 to 1 in a adjacent calls, the equivalent value of the original system was 60*50*2, or 6000.

To your question of what value to use, why don't you make a numeric control on the panel of teleop. Set the initial value to 100. Run RobotMain using the run button. Carefully drive the robot a bit, on blocks or on the ground, and see that it is spongey. The throttle doesn't instantly change the robot speed. With the robot still running, change the value to 6000. It should be the original acceleration. Now try 1000, 500, and explore a bit.

When you are done, make the value permanent by either making the value a constant on the diagram or by right clicking and going to Data Operations>>Make Current Value Default.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 30-01-2013, 12:45
BenGrapevine's Avatar
BenGrapevine BenGrapevine is offline
Head Programmer
AKA: Tony Simmering
FRC #2549 (Millerbots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Minneapolis, Minnesota
Posts: 46
BenGrapevine is an unknown quantity at this point
Re: Set the rate of acceleration

My team wanted a non-linear approach to acceleration that would add a deadzone so we could control our driving.

I went off and played with the joystickget.vi located in the teleop.vi and came up with this:


That 'x**3' is x^3 which looks like this on a graph:


The blue represents the normal linear acceleration in which there is no dead zone and what you press is what you get. The red is the x**3 which adds a deadzone that, in my team's case, helped people driving not crash into walls right away. The functions are wired into the axis (x and y for driving). I don't know if that's really what you are asking for but I hope this helps.

EDIT: I also noticed you are from MN; What city?
__________________
Millerbots Team 2549
orange and blue

Last edited by BenGrapevine : 30-01-2013 at 12:47. Reason: just a lil side note
Reply With Quote
  #10   Spotlight this post!  
Unread 30-01-2013, 13:36
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Set the rate of acceleration

I wrote this for 2009 Lunacy. It describes a few ways to limit acceleration rates in LabVIEW.
Reply With Quote
  #11   Spotlight this post!  
Unread 05-02-2013, 15:55
andrew paradis andrew paradis is offline
Registered User
FRC #4976
 
Join Date: Jan 2013
Location: boston, ma
Posts: 1
andrew paradis is an unknown quantity at this point
Re: Set the rate of acceleration

Quote:
Originally Posted by Ether View Post
What you want is a rate limit on your joystick command.

You want the LabVIEW equivalent of something like this:

Code:
o = joystick;
if  (o > op+d) o = op+d;
else if (o < op-d) o = op-d;
op = o;
... where

"joystick" is the present value of the joystick command
"o" is the output to the motor controller
"op" is the previous output to the motor controller
"d" is the maximum change you want to allow each iteration


where in labview would i put this
Reply With Quote
  #12   Spotlight this post!  
Unread 05-02-2013, 16:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Set the rate of acceleration

Quote:
Originally Posted by andrew paradis View Post
where in labview would i put this

You wouldn't. You'd have to take that logic and do something equivalent in LabVIEW.

Do a search for "rate limit". I'm pretty sure there are threads showing how to do that in LabVIEW.

Here's an article by Eric:
http://thinktank.wpi.edu/article/140

... look at the section named "slew rate"



Last edited by Ether : 05-02-2013 at 16:50. Reason: added link
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 04:11.

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