Go to Post Viva la geek! - Andy Baker [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 04-02-2015, 15:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: Mecanum wheels spinning too fast!

Quote:
Originally Posted by Bpk9p4 View Post
sorry no both ways work just as well. Just was putting out another option. We have just had good luck with this method. here is an example of how we use it http://i.imgur.com/Bq7QMuE.png
You mentioned you were using a Lookup Table for that.

Just for fun, when you have a symmetric piecewise linear curve like that with so few pieces, you can create a very simple tunable piecewise linear function.

I labeled the points (a,0), (a,b), and (c,d) on your diagram (attached).

C code for the piecewise linear code for that is quite simple:

Code:

// do the following once at initialization,
// or any time you change a ,b, c, or d on-the-fly:

m1=(d-b)/(c-a);  m2=(1-d)/(1-c);
Code:

// Let J be the abscissa and K be the ordinate on your graph.
// Here's the piecewise linear code to convert J to K:

x=fabs(J);
if (x<a) K=0;
else if (x<c) K=b+m1*(x-a);
else K=d+m2*(x-c);
if (J<0) K=-K;

Attached Thumbnails
Click image for larger version

Name:	piecewise_linear.png
Views:	53
Size:	201.0 KB
ID:	18144  
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2015, 21:34
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: Mecanum wheels spinning too fast!

LV has two nodes that assist with this approach. Interpolate is simpler and assumes a uniformly increasing second dimension. The attached image is the node that implements the more general approach.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	From Clipboard1.PNG
Views:	12
Size:	29.2 KB
ID:	18154  
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 13:35.

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