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.

Continue reading “Motors Make The Best Knobs With SimpleFOC”

Musical Motors, BLDC Edition

This should count as a hack: making music from a thing that should not sing. In this case, [SIROJU] is tickling the ivories with a Brushless DC motor, or BLDC. 

To listen to a performance, jump to 6:27 in the embedded video. This BLDC has a distinctly chip-tune like sound, not entirely unlike other projects that make music with stepper motors. Unlike most stepper-based instruments we’ve seen [SIROJU]’s BLDC isn’t turning as it sings. He’s just got it vibrating by manipulating the space vector modulation that drives the motor — he gets a response of about 10 kHz that way. Not CD-quality, no, but plenty for electronic music. He can even play chords of up to 7 notes at a time.

There’s no obvious reason he couldn’t embed the music into a proper motor-drive signal, and thus allow a drone to hum it’s own theme song as it hovers along. He’s certainly got the chops for it; if you haven’t seen [SIROJU]’s videos on BLDC drivers on YouTube, you should check out his channel. He’s got a lot of deep content about running these ubiquitous motors. Sure, we could have just linked to him showing you how to do FOC on an STM32, but “making it sing” is an expression for mastery in English, and a lot more fun besides.

There are other ways to make music with motors. If you know of any others, don’t hesitate to send us a tip.

Continue reading “Musical Motors, BLDC Edition”

Paddling Help From Electric-Assisted Kayak

Electric-assisted bicycles, or ebikes, are fundamentally changing the way people get around cities and towns. What were once sweaty, hilly, or difficult rides have quickly turned into a low-impact and inexpensive ways around town without foregoing all of the benefits of exercise. [Braden] hoped to expand this idea to the open waters and is building what he calls the ebike of kayaking, using the principles of electric-assisted bicycles to build a kayak that helps you get where you’re paddling without removing you completely from the experience.

The core of the project is a brushless DC motor originally intended a hydrofoil which is capable of providing 11 pounds (about 5 kg) of thrust. [Braden] has integrated it into a 3D-printed fin which attaches to the bottom of his inflatable kayak. The design of the fin took a few iterations to get right, but with a working motor and fin combination he set about tuning the system’s PID controller in a tub before taking it out to the open water. With just himself, the battery, and the motor controller in the kayak he’s getting about 14 miles of range with plenty of charge left in the battery after the trips.

[Braden]’s plans for developing this project further will eventually include a machine learning algorithm to detect when the rider is paddling and assist them, rather than simply being a throttle-operated motor as it exists currently. On a bicycle, strapping a sensor to the pedals is pretty straightforward, but we expect detecting paddling to be a bit more of a challenge. There are even more details about this build on his personal project blog. We’re looking forward to seeing the next version of the project but if you really need to see more boat hacks in the meantime be sure to check out [saveitforparts]’s boat which foregoes sails in favor of solar panels.

Continue reading “Paddling Help From Electric-Assisted Kayak”

Photograph of a BLDC motor controller circuit board

Take A Ride Through The Development Of A Custom BLDC Motor Controller

The folks over at the [Barkhausen Institut] are doing research into controlling autonomous fleets of RC cars and had been using off the shelf electronic speed controllers (ESCs) to control the car motors. Unfortunately they required more reliable feedback for closed loop control of the motors, so they created their own open source hardware brushless DC (BLDC) controller.

The motor controller they developed uses an STM32 microcontroller that talks to a TMC6140 3 phase MOSFET driver to drive 6 IRLR 2905 MOSFETs. The [Barkhausen Institut] researchers went with the SimpleFOC library as the basis to program the STM32, with installed hall effect sensors indicating motor orientation for their closed loop control.

Designing a functioning BLDC and ESC controllers can be subtle, and their post goes into details about the problems and solutions they came up with to deal with with what was ultimately improper isolation of the MOSFETs interfering with the power rail for the STM32. The source for their BLDC motor controller is available through their GitLab page. For more information on the parent project that uses the BLDC driver, be sure to check out their work on a connected convoy of RC cars.

There’s now a wealth of open source BLDC drivers and projects, many of which we’ve featured in the past, like the Moteus and haptic smart knob, and it’s nice to see other projects explore different options.

Motor-Driven Movement Modernizes POV Toy

Just as we are driven today to watch gifs that get better with every loop, people 100+ years ago entertained themselves with various persistence of vision toys that used the power of optical illusions to make still images come to life. [jollifactory] recently recreated one of the first POV devices — the phenakistoscope — into a toy for our times.

The original phenakistoscopes were simple, but the effect they achieved was utterly amazing. Essentially a picture disk with a handle, the user would hold the handle with one hand and spin the disk with the other while looking in a mirror through slits in the disk. Unlike the phenakistoscopes of yore that could only be viewed by one person at a time, this one allows for group watching.

Here’s how it works: an Arduino Nano spins a BLDC motor from an old CD-ROM drive, and two strips of strobing LEDs provide the shutter effect needed to make the pictures look like a moving image.The motor speed is both variable and reversible so the animations can run in both directions.

To make the disks themselves, [jollifactory] printed some original phenakistiscopic artwork and adhered each one to a CD that conveniently snaps onto the motor spindle. Not all of the artwork looks good with a big hole in the middle, so [jollifactory] created a reusable base disk with an anti-slip mat on top to spin those.

If you just want to watch the thing in action, check out the first video below that is all demonstration. There be strobing lights ahead, so consider yourself warned. The second and third videos show [jollifactory] soldering up the custom PCB and building the acrylic stand.

There are plenty of modern ways to build old-fashioned POV toys, from all-digital to all-printable.

Continue reading “Motor-Driven Movement Modernizes POV Toy”

Model Hydroelectric Plant Is An Illuminating Educational Tool

There’s more than one way to light up a strip of LEDs. Have you tried building your own hydroelectric power plant to do it? Well, now you can. Replicating [Matic Markovič]’s entry into the 2020 Hackaday Prize is bound to teach you something, if not many things, about the way hydroelectric power is generated and the way the variables play into it.

In [Matic]’s model, water from an adjustable-height reservoir flows into a 3D-printed Pelton turbine. The water jet hits the turbine’s cupped fins at a 90° angle, causing the assembly to spin around rapidly. This mechanical energy charges a brushless DC motor that’s connected to an Arduino Nano, which rectifies the AC from the generator and uses it to light up an RGB strip like an equalizer display that represents the power being generated.

This is easily one of the coolest educational displays we’ve ever seen. The reservoir can move up and down over a 55 cm (21.6″) range with the flick of a three-way toggle, which makes it easy to see that the higher the reservoir, the more power is generated. [Matic] has the STLs and INOs in the usual places if you want to make your own. Flow past the break for a demonstration, followed by an exploded render that gets put back together by invisible hands.

Your hydroelectric setup doesn’t need to be fancy, it just needs to work. One man’s trash can be another man’s off-grid phone charger.

Continue reading “Model Hydroelectric Plant Is An Illuminating Educational Tool”

3-Phase BLDC Motor Controller Will Run You $20 In Parts

If you’re an active shopper on RC websites, you’ll find tiny motors spec’ed at hundreds of watts while weighing just a few grams, like this one. Sadly, their complementary motor controllers are designed to drive them at a high speed, which means we can only hit that “520-watt” power spec by operating in a max-speed-minimum-torque configuration. Sure, that configuration is just fine for rc plane and multicopter enthusiasts, but for roboticists looking to drive these bldc motors in a low-speed-high-torque configuration, the searches come up blank.

The days in the dust are coming to an end though! [Cameron] has been hard at work at a low cost, closed-loop controller for the robotics community that will take a conventional BLDC airplane motor and transform it into a high end servo motor. Best of all, the entire package will only run you about $20 in parts–including the position sensor!

“Another BLDC motor controller?” you might think. “Surely, I’ve seen this before“. Fear not, faithful readers; [Cameron’s] solution will get even the grumpiest of engineers to crack a smile. For starters, he’s closing the loop with a Melexis MLX90363 hall effect sensor to locate the rotor position. Simply glue a small magnet to the shaft, calibrate the magnetic field with one revolution, and–poof–a wild 14-bit encoder has appeared! Best of all, this solution costs a mere $5 to $10 in parts.

Next off, [Cameron] uncovered a little-known secret of the ATMEGA32u4, better known as the chip inside the Arduino Leonardo. It turns out that this chip’s TIMER4 peripheral contains a feature designed exclusively for 3-phase brushless motor control. Complementary PWM outputs are built into 3 pairs of pins with configurable dead time built into the chip hardware. Finally, [Cameron] is pulsing the FETs at a clean 32-Khz — well beyond the audible range, which means we won’t hear that piercing 8-Khz whine that’s so characteristic of cheap BLDC motor controllers.

Curious? Check out [Cameron’s] firmware and driver design on the Githubs.

Of course, there are caveats. [Cameron’s] magnetic encoder solution has a few milliseconds of lag that needs to be characterized. We also need to glue a magnet to the shaft of our motor, which won’t fly in all of our projects that have major space constraints. Finally, there’s just plain old physics. In the real world, motor torque is directly proportional to current, so stalling an off-the-shelf bldc motor at max torque will burn them out since no propeller is pushing air through them to cool them off. Nevertheless, [Cameron’s] closed loop controller, at long last, can give the homebrew robotics community the chance to explore these limits.