Skip to content

Instantly share code, notes, and snippets.

View bencholmes's full-sized avatar

Ben Holmes bencholmes

View GitHub Profile
@bencholmes
bencholmes / log-pot-law.m
Created November 25, 2017 17:19
Versatile logarithmic potentiometer law model.
% travel is the location of the wiper along the pot from 0 to 1
travel = linspace(0,1,1000);
% Define the factor of resistance at the middle pot position
mid = 0.15;
% b is the base of the exponential equation
b = (1/mid - 1)^2;
% a is the multiple and also the offset