|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
![]() |
|
#2
|
||||
|
||||
|
Re: Set the rate of acceleration
Quote:
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; "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 |
|
#3
|
|||
|
|||
|
Re: Set the rate of acceleration
So how would I do that in labview?
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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
|
|
#6
|
|||||
|
|||||
|
Re: Set the rate of acceleration
Quote:
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:
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
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? Last edited by BenGrapevine : 30-01-2013 at 12:47. Reason: just a lil side note |
|
#11
|
|||
|
|||
|
Re: Set the rate of acceleration
Quote:
|
|
#12
|
||||
|
||||
|
Re: Set the rate of acceleration
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|