Pot scaling and offset
hacktorious
Posts: 72
I am working on the WAM book and came across the ControlServoWithPot.bs2, chapter 5, p.155, "Measuring Rotation", and am looking for some more reading material on scaling and offsetting numbers in this particular situation. None of my math, engineering, or programming books seem to contain a section on this, and I am not able to find anything on the web.
If anyone knows of, or has any good reading material on this particular topic please post a link. Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Scott
If anyone knows of, or has any good reading material on this particular topic please post a link. Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Scott
Comments
y = mx + b
let's say your pot values are 0 to 5000, and you want to see 0 to 300 (degrees)
m = changing in output/change in input
m = (300-0)/(5000-0)
m = 0.06
Now, the BS2 doesn't like decimals, so let's make it 6, so you will get values of 0 to 30000
using·a known·points, we can solve for b:
30000 = (5000) 6 + b
b = 0 (zero interecept is easy)
output = 6 x RCTime_value + 0
so your output will be your RCTime value * 6 for a range of operation of 0 to 30000. When displayed, you can divide by 100 for 0 to 300.
Notes: Use a word variable for the output variable, RCTime is not really linear, but we are treating it as such.
Homework:
How would the equation change if we wanted a degree of range of 30 to 270 degrees? :P
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
http://www.siu.edu/~mhebel/est202/powerpoints_sp07.htm····· - Span & offset one
Though, if you've got engineering texts there, and my answers are what you are talking about, you probably slapped yourself in the forehead anyway [noparse]:)[/noparse]
Much of this is also covered in Parallax's "Process Control" text.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
Thanks, for all the good info. I have been reading a little everytime I get a chance.
Martin,
That looks like a great class.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Scott
Thanks, it's my favorite class I teach - a lot of good, real-world content for a technologist. The "Process Control" text was written around many of the applicable things I try to bring out in this course. We use PC for parts of the lab for the course.
Now, when it comes to Robotics, I wish I was better at the mechanical side of the house [noparse]:)[/noparse] I'd like to find a good book/text with a lot of common mechanical configurations for typical use that would help with robotics.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies