Go to Post High heels on a Segway takes quite a bit of adjustment - as I learned the hard way. - Jessica Boucher [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

 
 
 
Thread Tools Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #15   Spotlight this post!  
Unread 14-02-2011, 19:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Acceleration based on position


Let XU be the upper position limit.

Let XL be the lower position limit.

Let X be the current position, between those limits.

Let K be the size of the "speed zone" near either limit, where speed gets reduced.

Let J be the joystick command, between -1 and +1, where +1 commands a speed toward the upper limit.

Then:

Code:
if ( (X>XU-K) && (J>(XU-X)/K) ) J=(XU-X)/K;
else
if ( (X<XL+K) && (J<(XL-X)/K) ) J=(XL-X)/K;

Reply With Quote
 


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 20:37.

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