Log in

View Full Version : how do I ramp up the wheels slowly


seanl
12-02-2009, 09:32
I am trying to create some code in Labview so i can ramp up and ramp down the speed of the wheels but i don't know where to start. like to slowly go from the value of 0 to the max speed of -1. i tried to do this with a while loop but failed because i could not find a variable such as x. any suggestions?

EricVanWyk
12-02-2009, 09:34
http://thinktank.wpi.edu/article/140

Hopefully this document will help.

seanl
12-02-2009, 10:02
this is for the drive of a motor without the use of a joystick, i am using a button to drive the whole robot forward but i need it to ramp up. but thanks for the information on making the joysticks smoother.

Russ Beavis
12-02-2009, 10:22
I haven't read Eric's article but the use of filters isn't limited to floating point joystick position readings. You can also take a boolean value, convert it to a floating point 1 or 0 ("boolean to 1:0") and then pass the value through a point-by-point or similar lowpass filter (this is probably one of Eric's suggestions). The filter cut-off frequency would dictate the response time.

You could also pass the 1:0 value through a leaky integrator (if 1 then add a little bit (clamp to max value), else decrement a little bit (clamp to a min value)).

Russ

EricVanWyk
12-02-2009, 10:40
I've attached a picture of a leaky integrator.

I used the boolean select to convert a boolean to one of two floating point values - in this case, how much to add or subtract each time the code is executed.

I used a feedback node (the arrow) to remember the last value.

I used the coerce and in range to limit the max forward or reverse speed.

seanl
12-02-2009, 17:00
Eric, i tried what you stated in your paper and it looks like it could work, can you or someone else check and see if it is right. i put a constant of 1 instead of the "input from joystick". theoretically this should allow the robot to slowly back up.

P.S. the code is attached to this post.

dmcguire3006
12-02-2009, 18:57
Use a PID Controller:
http://en.wikipedia.org/wiki/PID_controller

There provided as a VI in Labview.

seanl
12-02-2009, 19:11
Use a PID Controller:
http://en.wikipedia.org/wiki/PID_controller

There provided as a VI in Labview.

are there any documentation on using a PID controller being that i am a novice at labview programming. And is there an advantage to using a PID controller over the method stated above?

EricVanWyk
12-02-2009, 19:26
are there any documentation on using a PID controller being that i am a novice at labview programming. And is there an advantage to using a PID controller over the method stated above?

PID controllers are very powerful, but in this case they are probably over-kill.

I would recommend using one here in place of a leaky integrator only for the learning experience - you will find it very helpful in the future. That being said, leaky integrator is probably the way to go here if you are aiming for simple.

chmp09
13-02-2009, 00:13
are there any documentation on using a PID controller being that i am a novice at labview programming. And is there an advantage to using a PID controller over the method stated above?

I use a lead-lag PID controller to control our ramping, and it works really well. It will take some tweaking, but it is not that difficult.

For basics, just set you output range to -1 and 1. Set you gain to 1. Set your lag time to whatever you find is best (ours is .2); this changes how fast it ramps. Set lead time to zero. Set dt to -1(sets it to milliseconds). You may want to tell it to reinitialize at values of zero because it will also ramp down.

The code attached was made for ramp code on a tank drive robot.