Joystick Analog value Smoothing or averaging

jdoleckijdolecki Posts: 694
edited 2019-08-02 - 18:49:54 in Robotics
Is there any advantage to using a smoothing or an averaging code to read the joystick analog input values??

I'm using two 3 axis joysticks to control my robot arm

Thanks, John

Comments

  • It certainly can't hurt if you're getting jittery values from the joystick. Depending upon which smoothing algo you use, though, you could experience a lag between the joystick movement and the servo actuation.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • @jdolecki Nice bot! Looks quite rugged!
  • ercoerco Posts: 19,518
    That's a serious robot, John! Looks amazing!
    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
  • jdolecki wrote: »
    I'm using two 3 axis joysticks to control my robot arm

    In my experience joysticks don't match each other. Even the same joystick may have one axis that is less linear than the other. Every one I've used had to be individually tweaked.
    To smooth the return values from an ADC chip, I do two main things: I lower the resolution by shifting bits left. 7-bit to 5-bit resolution works well for me. In Spin I use the 'case' command which allows me to adjust the range of 'acceptable' input values for the return value I want.
    In a few cases there might be noise in the circuit but most times I don't care.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.
  • Joysticks that use optical encoders will avoid most if not all of the problems that plague potentiometer based units. Of course they are currently a bit more expensive than potentiometer based ones,
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • kwinn wrote: »
    Joysticks that use optical encoders will avoid most if not all of the problems that plague potentiometer based units. Of course they are currently a bit more expensive than potentiometer based ones,
    Wow. I've never heard of a joystick that uses optical encoders. I know the topic is about analog joysticks but absolute optical encoders would be excellent. For my project I used geared DC motors with pots on the pivot points. I made a potentiometer based controller (prototype) that mirrors the position of the robotic arm.
    Great idea. I'm always learning something new.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.
  • My 6 HB-25 that Paralllax no longer makes.
    480 x 640 - 93K
Sign In or Register to comment.