10k or 100k potentiometer
-
Hi
Need some advice. Which is better? 10k or 100k potentometer? Firstly for the flight controls such as the x-y axis and rudder and throttle? Secondly for altimeter and hsi course and heading dials?
Igorry
-
@igorry i’m using 100k linear and works fine
-
@igorry said in 10k or 100k potentiometer:
Hi
Need some advice. Which is better? 10k or 100k potentometer? Firstly for the flight controls such as the x-y axis and rudder and throttle? Secondly for altimeter and hsi course and heading dials?
Igorry
You should be using rotary encoders for altimeter and hsi course & heading dials, not potentiometers. Made my HSI controller on an Arduino using 20-step potentiometers, they have integrated button when pushed in as well. Happy to provide my sketch, if you want.
Best wishes and good luck with your DIY’s!!
P.S. If you want serious precision and longevity, you can use Hall Effect Sensors instead of Potentiometers for your stick / throttle axes. They are quite a bit more expensive than Potentiometers, though since you only need a handful, the tradeoff for accuracy may be worth it, depending on your budget.
-
@SemlerPDX I used SS49E in my joy, has an affordable price. I used also rotary encoder for HSI but struggle with Arduino code. If I turn it quick, it misses a lot of steps. If I turn it the speed to recognise all of the steps then slow as hell
-
@hiuuz This sketch I wrote addresses that very problem. It allows one degree per detent when moving slowly, 18 degrees per detent when moving faster, and 30 degrees per detent when moving really fast.
The function allowing this is at the bottom, “speedVal”. I am using the Joystick Library by Matthew Heironimus to emulate an Xbox controller, and the teensy Encoder Library:
/* Simple HSI Knobs Sketch for Falcon BMS / DCS / FSX * for Arduino Micro/Leonardo / Sparkfun Pro Micro or equiv. clones * by SemlerPDX June2019 * VETERANS-GAMING.COM * ( https://veterans-gaming.com/blogs/entry/32-diy-custom-game-controller-2-dial-hsi-course-and-heading-knobs/ ) * * Pins: * Rotary Encoder 1 - (OUTA-OUTB-SW) = Arduino Pins (0,1,15) * Rotary Encoder 2 - (OUTA-OUTB-SW) = Arduino Pins (2,3,6) * * Encoder Library * http://www.pjrc.com/teensy/td_libs_Encoder.html * * Joystick Library * by Matthew Heironimus * https://github.com/MHeironimus/ArduinoJoystickLibrary */ #define ENCODER_USE_INTERRUPTS #define ENCODER_OPTIMIZE_INTERRUPTS #include <Encoder.h> #include <Joystick.h> //Tell the Encoder Library which pins have encoders Encoder axisXRotation(0, 1); Encoder axisYRotation(2, 3); //Rotary Encoder Push Button Pins int buttonArray[2] = {15, 6}; //Rotary Encoder Interrupt Pins int EncoderPin0 = 0; int EncoderPin1 = 1; int EncoderPin2 = 2; int EncoderPin3 = 3; //Delay Time between loops int debounceDelay = 260; //Variables to compare current to old values int oldX = 0; int oldY = 0; int RxAxis_Value = 1; int RyAxis_Value = 1; //Intervals for Jump/Warp Speed Rotations int JumpSpeed = 18; int WarpSpeed = 30; //Set generic joystick with id 42 with 2 buttons and 2 axes Joystick_ Joystick(0x42, 0x04, 2, 0, false, false, false, true, true, false, false, false, false, false, false); void setup() { //Set Encoder Pins as Pullups pinMode(EncoderPin0, INPUT_PULLUP); pinMode(EncoderPin1, INPUT_PULLUP); pinMode(EncoderPin2, INPUT_PULLUP); pinMode(EncoderPin3, INPUT_PULLUP); //Loop through buttons and set them as Pullups for (int x = 0; x < sizeof(buttonArray); x++) { pinMode(buttonArray[x], INPUT_PULLUP); } //Set Range of custom Axes Joystick.setRxAxisRange(0, 359); Joystick.setRyAxisRange(0, 359); // Initialize Joystick Library Joystick.begin(false); } void loop() { // Loop through button pin values & set to Joystick for (int x = 0; x < sizeof(buttonArray); x++) { byte currentButtonState = !digitalRead(buttonArray[x]); Joystick.setButton(x, currentButtonState); } // Read "Heading" X Axis Rotation Encoder Knob int newX = axisXRotation.read(); if (newX > oldX) { //Determine speed of increment & set output int difX = newX - oldX; RxAxis_Value = speedVal(difX, RxAxis_Value, 1); Joystick.setRxAxis(RxAxis_Value); axisXRotation.write(newX); oldX = newX; }else if (newX < oldX) { //Determine speed of decrement & set output int difX = oldX - newX; RxAxis_Value = speedVal(difX, RxAxis_Value, 0); Joystick.setRxAxis(RxAxis_Value); axisXRotation.write(newX); oldX = newX; } // Read "Course" Y Axis Rotation Encoder Knob int newY = axisYRotation.read(); if (newY > oldY) { //Determine speed of increment & set output int difY = newY - oldY; RyAxis_Value = speedVal(difY, RyAxis_Value, 1); Joystick.setRyAxis(RyAxis_Value); axisYRotation.write(newY); oldY = newY; }else if (newY < oldY) { //Determine speed of decrement & set output int difY = oldY - newY; RyAxis_Value = speedVal(difY, RyAxis_Value, 0); Joystick.setRyAxis(RyAxis_Value); axisYRotation.write(newY); oldY = newY; } //Send Joystick info through USB Joystick.sendState(); delay(debounceDelay); } //Function to set Rotation value adjusted for the turning speed int speedVal(int dif, int val, int dir) { if (dif >= WarpSpeed) { if (dir == 1) { val = val + WarpSpeed; }else{ val = val - WarpSpeed; } }else if (dif >= JumpSpeed) { if (dir == 1) { val = val + JumpSpeed; }else{ val = val - JumpSpeed; } }else{ if (dir == 1) { val = val + 1; }else{ val = val - 1; } } //Correct Rotation within 360 deg. if (val < 0) { val = val + 360; }else if (val >= 360) { val = val - 360; } return val; }
-
@SemlerPDX Thank you! I will study that code, to use it in my project. I learned basic programming 20 years ago, never used it in practice until last year. Damn those variables. You have to keep your eyes on them because the compiler is ruthless when you make mistakes
-
Thanks guys.
I have bought quite a few 10k and 100k potentiometer. They are quite cheap. I am just unsure as to which to use.
I have tried modding the ch potentiometer using the SS49E hall sensor. The issue is knowing what magnets to use and where to put the magets. I have also tried the rotary encoder too, but there is the missing of the steps as SemplerPDX has said. I have not use Arduino as I am not sure of the programming. I am only using the Leo bodnar boards to add buttons and connect to the potentiometers of the joysticks to make the axes to be 12 bits instead of 8 bits.
Igorry
-
@igorry sorry, i told you I use pots, but I use them not for encoders as for volume comms, hmcs brightness and similar.,
-
@igorry The main difference between using a 10K versus a 100K pot is the current draw. The 100K Ohm pot will draw less current from your power supply. I would recommend the 100Ks. I use 100K pots in my home built TQS for the Radar Range and Antenna Elevation axis. They work great. Hope this helps you decide.
-
The difference in current draw between a 10k and a 100k potentiometer is typically not significant enough to be a major factor in most applications (0.05mA vs. 0.5mA @5V).
The resolution of a potentiometer is determined by the number of steps or increments between the minimum and maximum values. This is typically determined by the physical construction of the potentiometer and is not directly related to the resistance value. This can be useful for certain applications because higher resistance potentiometers have a higher resolution due to their larger range of values.