Go to Post Engineering is a big, big type of fishing to teach. Inspiring kids to study it in college might be more practical. - connor.worley [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 13-01-2009, 17:11
the_waterboy the_waterboy is offline
Registered User
FRC #1095
 
Join Date: Feb 2008
Location: Chatham, VA
Posts: 7
the_waterboy is an unknown quantity at this point
Slow acceleration (LabView)

Our team is trying to code our robot to accelerate slowly, regardless of the joystick's position(The driver slams the joystick full forward, but the robot takes off slowly). We are doing this to keep the robot from spinning the tires on the slick floor and hopefully to gain better traction at take-off. We are using the Get Motor subVI, Set Motor, and Get Joystick. We subtract the value of the motor from the value of the Joystick, divide the result by a set number(currently 10,000), add this quotient to the motor value, then set the motor to that value. We are quite sure that Get Joystick, Set Motor, and Get Motor all use decimal values from -1.0 to 1.0, but if someone knows otherwise, please tell us. The code works when the joystick is being pressed in one direction, but not when it is being pressed in the opposite direction. We have also noticed that the motor is in the deadband until it reaches the maximum value. If anyone has any information on creating a code like this, please speak up, as it has halted our coding from going any farther for the time being.
__________________
So what if I'm crazy?
Reply With Quote
  #2   Spotlight this post!  
Unread 13-01-2009, 18:20
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,587
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Slow acceleration (LabView)

It would help immensely if you could post your code, or a snapshot of the relevant portion of your code. As it is, my questions are, which divide function are you using, floating point divide, or "Quotient and Remainder"? Also, your code as described, will accelerate faster at the beginning and slower towards the end. I don't want to think of how long it'd take your robot to get up to the joystick's command doing it that way. It'd be a very long time, however.

The usual way to do this is to pick a specific number to add to the motor command every loop, until you get to the joystick command. So you'd just add (or subtract), say, 0.001 to the motor command on every loop, and then make sure it's not larger (or smaller) than the joystick value.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #3   Spotlight this post!  
Unread 13-01-2009, 18:47
Tanner's Avatar
Tanner Tanner is offline
Registered User
FRC #1261 (Roblions)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Suwanee, GA
Posts: 311
Tanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to beholdTanner is a splendid one to behold
Re: Slow acceleration (LabView)

One thing that we've learned certainly aids in the debugging process is probes and the button I like to call "data flow". I'm sure there is specific technical LabView documentation on this somewhere, but this is what I know. Click on any wire while the program/code is running, and you'll get a look into what that wire is carrying at the moment (might be real time, but I can't remember). Another nice thing is there is a button at the top of the screen that looks kinda like a light bulb (aka "data flow" as I call it). If you press it, you will see the data flow across the screen (no serious, like electrons do in wires in animated movies) along with numbers showing up for where actions occur. Be warned though that "data flow" SEVERELY slows down your code execution for the time is takes the data to flow through your entire VI, and may cause robot damage if you do any motor movement that isn't changed until later in the VI.

Cheers
-Tanner
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2009, 15:00
Jim Wagner Jim Wagner is offline
Registered User
FRC #1676 (Pascack Pi-oneers)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Pascack Pi-oneers
Posts: 8
Jim Wagner is an unknown quantity at this point
Send a message via Yahoo to Jim Wagner
Re: Slow acceleration (LabView)

Here is something you can try. You don't need a cRIO to run it and play with it. It uses a mouse (horizontal movement), but you get the idea, we may use something like this for our robot, we may also add feedback. You will need to change the upper limit to something greater than 100, like 1600, do this in the front panel before you run it.

jim
Attached Files
File Type: vi LeadLagEx.vi (36.4 KB, 135 views)
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
Acceleration of Fisher Price Motor Boco Gear Motors 2 06-01-2009 11:39
Limiting acceleration in easyC Neurovirus Programming 13 02-02-2008 12:50
Moderating Acceleration / Deceleration Tom Line Programming 7 15-02-2007 13:39
Acceleration Curve EricWilliams Programming 5 01-02-2006 16:27
How slow is too slow? Joe Ross Rules/Strategy 23 12-10-2004 20:23


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

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