Motors Make The Best Knobs With SimpleFOC

The worst thing about a volume knob is that, having connected it to a computer, it might be wrong: if you’ve manually altered the volume settings somewhere else, the knob’s reading won’t be correct. [I Got Distracted] has a quick tutorial on YouTube showing how to use a BLDC, a hall effect sensor, Pi Pico and the SimpleFOC library to make a knob with active haptic feedback and positioning.

We covered the SimpleFOC library a few years ago, but in case you missed it, it’s, well, a simple library for FOC on all of our favorite microcontrollers, from Arduino to ESP to Pico. FOC stands for field-oriented control, which is a particular way of providing smooth, precise control to BLDCs. (That’s a BrushLess DC motor, if the slightly-odd acronym is new to you.) [I Got Distracted] explains exactly how that works, and shows us just how simple the SimpleFOC project is to use in this video.  Why, they even produce their own motor controllers, for a fully-integrated experience. (You aren’t restricted to that hardware, but it certainly does make things easy.)

The haptic feedback and self-dialing knob make for an easy introductory project, but seeing how quick it hacks together, you can doubtless think of other possibilities. The SimpleFOC controller used in this video is limited to relatively small motors, but if you want to drive hundreds of kilowatts through open source hardware, we’ve covered that, too.  

Arguably, using a motor as a knob isn’t within the design spec, and so could almost qualify for our ongoing Component Abuse Challenge, had [I Got Distracted] thought to enter.

17 thoughts on “Motors Make The Best Knobs With SimpleFOC

  1. my old stereo had a similar construction so when you changed the volume with the remote the physical knob would turn appropriately.

    1. Other than a labelled dial that goes to 11, why not just use a rotary encoder? Then pressing up or down on the remote is the same as turning left or right on the knob. ..shrug..

      1. pressing up or down on the remote was the same as turning the console knob left or right. Not sure why you would want/need a rotary encoder. The knob is where the knob is. You push up the motor turns the knob, you press down the motor turns the knob the other way. You use your fingers to turn the knob the knob moves whichever way you want. In every case the volume responds predictably in a 1-50 labelled scale. ….shrug…

      2. Those stereos were old and used an actual stereo potentiometer to attenuate the analog signal before it reached the amplifier circuit, there was no digital volume control that could have been controlled with a rotary encoder. So the motor just blindly spun the potentiometer and knob in whatever direction the remote told it to. If you reached max or min volume but still held the button, the motor would just keep spinning and slipping.

    1. The real star of the show is SimpleFOC, which made this project a lot quicker and easier than when Scott published his. Really, the video is about the SimpleFOC library, with the fancy knob serving as a demo of what can be done quickly and easily using it.

  2. Eh, this is an old thing.
    I remember being a kinda young dude and coming up with this idea (but with a remote – not a computer per se (ignoring that a remote is a computer and all that)) and being told that the amplifier i just saw did indeed have that feature already…
    That was 25 years ago. It should be standard now IMO, the cost of a stepper motor + magnet and a cheap rotational Hall-effect sensor is like nothing for most devices.

  3. I saw a similar implementation a few years back for a thermostat somewhere. Likely also on hackaday! I love this so much and want to use it somewhere where it really makes sense and shines (i.e. is worth the price of admission long term). Very well done!

  4. I like the 2 way interaction. What if the computer mixer sets one level and punks turn it to 11
    will it break the knob off?

    1. Worst case, it “misses” some steps and your knob becomes unaligned with where the software thinks it is…it’d still work after you stopped forcing it, but with a different sense of where 0 is

  5. And when you switch off the amplifier through remote, I expect the on-off switch will be moved by motor too. And also the input selection buttons etc…
    No way, the encoder knob is better solution. But someone sometimes cannot resist for little bit over engineering (me too:)

    1. Better in what way? You cannot change detent angles on the fly. You cannot change haptic feedback. You cannot add rotation limits (well, they are not limits per se, but these can make an elastic limit that springs the knob back to the set limit). It’s got many features that you cannot do with a simple rotary encoder, but it’s obviously not needed for any device

      1. “Obviously not needed for any device” reminds me of one of the greatest joys i experience in software development….when i finally prove after years of intermittently hacking at the code around it that this piece of code / special case is actually unused and can be deleted. Always delightful to get rid of extra functionality :)

        Unnecessary function has become one of my greatest bugaboos. Just speaking as a software maintainer.

      2. Better in Keep It St*pid Simple way. For volume knob job. But yes, there can exist applications where the haptics and other antics are in need.

  6. This reminds me of BMW iDrive back in 2001 BMW 7 series (E65). The knob had several DOF, “force feedback”(?) and the whole unit was ridiculously big and heavy. Users hated it (I don’t remember why exactly).

    Later versions had less DOF and no force feedback. They were used even in BMW 1 series.

Leave a Reply to MatiasCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.