Go to Post The most important part of successfully solving the problem is to understand what the problem is. Elegance in engineering comes from "optimizing" your solution, not solving problems that don't really exist. Fulfill your requirements, meet your goals... - JVN [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Spotlight this post!  
Unread 16-02-2008, 02:00
duane's Avatar
duane duane is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Vacaville
Posts: 98
duane is an unknown quantity at this point
Send a message via AIM to duane
Re: Potentiometer arm control

Quote:
Originally Posted by RyanN View Post
It will not try to use floating point or just use that fraction and multiply it? I thought that would work.
As already mentioned, integers do integer method. In order to maintain precision with integer math, you want to do division with the largest numbers possible. Division will always loose precision.

What was shown will work, but you might even get a little better precision by doing...

wrist_pos = (-11*arm_pos + 1670*5) / 5;

This maximizes the numerator before dividing by the denominator.
__________________
Duane Murphy
Mentor - Software
Vanden Vikings FIRST Team 701
http://www.vandenrobotics.com
 


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
Mounting an arm potentiometer Hazmatt Technical Discussion 18 12-02-2008 21:53
P.I.D. Control for the arm skibum2490 Programming 8 27-02-2007 11:21
Slave Control Arm aaronD341 Control System 1 26-04-2005 17:13
2-Segment Arm Control Orborde Programming 1 20-01-2005 01:40
Neural Control of Robot Arm Leo M Math and Science 2 29-03-2004 13:46


All times are GMT -5. The time now is 23:53.

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