|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Joysticks
Quote:
The reason to fix this in software instead of the speed controller is in the cases of autonomous or feedback control. If the speed controllers that handle your arm joint are calibrated for a smaller range of 30-245 (typical values I've seen for the y-axis) then your feedback code is only effective over that range. Any numbers outside the range will not make the arm drive faster, and if your feedback routine wants to drive the arm slightly slower than full reverse (say a pwm value of 20) it will still be going full reverse. |
|
#2
|
||||
|
||||
|
Re: Joysticks
Quote:
if (P2y > 135 && P2Y <= 145) PWM02 = 140 if else (P2Y > 145 && P2y <= 155) PWM02 =150 etc. etc. etc. As you can see, not too smooth a response. So the question is, what code would you use to linearly map one range to another? |
|
#3
|
|||||
|
|||||
|
Re: Joysticks
Quote:
Take the input value x, multiply it by a factor m, and add an offset b to yield the output value y. The factor can be a floating point value, or to save time you can multiply by an integer and divide by another integer. To determine the m and b constants, use algebra to solve the pair of equations for the known input and output values. |
|
#4
|
||||
|
||||
|
Re: Joysticks
Quote:
Thank You Alan I knew it would be a relatively simple solution. My years removed from Algebra are many, too many in fact, so some portions of my memory need a little refresh. This will help tremendously. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2004-2005 Joysticks | kjohnson | Control System | 3 | 11-04-2005 23:39 |
| Pressure sensative Joysticks | Validius | General Forum | 1 | 15-03-2005 13:59 |
| number of joysticks | Waste | General Forum | 21 | 27-01-2005 15:04 |
| need joysticks! | Tom Bottiglieri | General Forum | 14 | 24-02-2004 09:36 |
| AVB joysticks..and other analogue joysticks | tml240 | Kit & Additional Hardware | 6 | 07-02-2004 12:45 |