TeensyStep – Fast Stepper Library For Teensy

The Teensy platform is very popular with hackers — and rightly so. Teensys are available in 8-bit and 32-bit versions, the hardware has a bread-board friendly footprint, there are a ton of Teensy libraries available, and they can also run standard Arduino libraries. Want to blink a lot of LED’s? At very fast update rates? How about MIDI? Or USB-HID devices? The Teensy can handle just about anything you throw at it. Driving motors is easy using the standard Arduino libraries such as Stepper, AccelStepper or Arduino Stepper Library.

But if you want to move multiple motors at high micro-stepping speeds, either independently or synchronously and without step loss, these standard libraries become bottlenecks. [Lutz Niggl]’s new TeensyStep fast stepper control library offers a great improvement in performance when driving steppers at high speed. It works with all of the Teensy 3.x boards, and is able to handle accelerated synchronous and independent moves of multiple motors at the high pulse rates required for micro-stepping drivers.

The library can be used to turn motors at up to 300,000 steps/sec which works out to an incredible 5625 rpm at 1/16 th micro-stepping. In the demo video below, you can see him push two motors at 160,000 steps/sec — that’s 3000 rpm — without the two arms colliding. Motors can be moved either independently or synchronously. Synchronous movement uses Bresenham’s line algorithm to plan motor movements based on start and end positions. While doing a synchronous move, it can also run other motors independently. The TeensyStep library uses two class objects. The Stepper class does not require any system resources other than 56 bytes of memory. The StepControl class requires one IntervallTimer and two channels of a FTM  (FlexTimer Module) timer. Since all supported Teensys implement four PIT timers and a FTM0 module with eight timer channels, the usage is limited to four StepControl objects existing at the same time. Check out [Lutz]’s project page for some performance figures.

As a comparison, check out Better Stepping with 8-bit Micros — this approach uses DMA channels as high-speed counters, with each count sending a pulse to the motor.

Thanks to [Paul Stoffregen] for tipping us off about this new library. Continue reading “TeensyStep – Fast Stepper Library For Teensy”

Music Box Plays “Still Alive” Thanks To Automated Hole Puncher

Custom hole punch and feed system

Most projects have one or two significant aspects in which custom work or clever execution is showcased, but this Music Box Hole Punching Machine by [Josh Sheldon] and his roommate [Matt] is a delight on many levels. Not only was custom hardware made to automate punching holes in long spools of paper for feeding through a music box, but a software front end to process MIDI files means that in a way, this project is really a MIDI-to-hand-cranked-music-box converter. What a time to be alive.

The hole punch is an entirely custom-made assembly, and as [Josh] observes, making a reliable hole punch turns out to be extremely challenging. Plenty of trial and error was involved, and the project’s documentation as well as an overview video go into plenty of detail. Don’t miss the music box version of “Still Alive”, either. Both are embedded below.

Continue reading “Music Box Plays “Still Alive” Thanks To Automated Hole Puncher”

Turning And Burning With A CNC Pyrography Machine

With CNC machines, generally the more axes the better. Three-axis machines with a vertical quill over a rectangular workspace are de rigueur, and adding an axis or two can really step up the flexibility of a machine. But can only two axes be of any use? Sure can, as witnessed by this two-axis CNC wood burning machine.

As [tuckershannon] tells the tale, this was a newbie build aided by the local hackerspace. Axis one is a rotary table of laser-cut wood gears powered by a stepper. Axis two is just a stepper and lead screw sitting on a couple of blocks of wood. A Raspberry Pi under the hood controls the motors and cycles the pyrography pen on and off as it scans across a piece of wood on the rotary table, burning a spiral pattern that makes for some interesting art. Hats off to [tuckershannon] for figuring out the math needed to adapt to the changing speed of the pen over the wood as the diameter gets bigger.

We love this build, can’t help but wonder if some clever gearing could eliminate the need for the second stepper. And perhaps an upgrade from the standard resistive wood burner to an arc lighter pyrography pen would improve resolution. Still, it’s hard to argue with results, and this is a great hack.

[via r/raspberrypi]

Thanks to [Liz] for the tip!

Steampunk-Inspired Art Clock!

Getting paid to do what you enjoy is a special treat. A machinist and fabricator by trade — hobbyist hacker by design — [spdltd] was commissioned to build a mechanical art installation with a steampunk twist. Having complete creative control, he convinced his client to let him make something useful: a giant electro-mechanical clock.

Pieced together from copper, brass, steel, aluminium, and stainless steel, this outlandish design uses an Arduino Yun — a combination Linux and Arduino microcontroller board — to control the stepper motor and query the internet for the local time. Upon boot, the clock auto-calibrates by rotating the clock face until a sensor detects an extra peg and uses that to zero on twelve o’clock; the Yun then grabs the local time over the WiFi and sends the stepper motor a-spinning ’till the correct time is displayed.

At first glance, you may find it hard to get an accurate read of what time it is, but an accent piece’s pegs denote the quarter hour once it lines up with the notch above each hour. At least this one doesn’t require you to match colours or do much math to check the time.

Continue reading “Steampunk-Inspired Art Clock!”

Hackaday Prize Entry: 3D Printed Linear Actuator Does 2kg+

The rabbit hole of features and clever hacks in [chiprobot]’s NEMA17 3D Printed Linear Actuator is pretty deep. Not only can it lift 2kg+ of mass easily, it is mostly 3D printed, and uses commonplace hardware like a NEMA 17 stepper motor and a RAMPS board for motion control.

The main 3D printed leadscrew uses a plug-and-socket design so that the assembly can be extended easily to any length desired without needing to print the leadscrew as a single piece. The tip of the actuator even integrates a force sensor made from conductive foam, which changes resistance as it is compressed, allowing the actuator some degree of feedback. The force sensor is made from a 3M foam earplug which has been saturated with a conductive ink. [chiprobot] doesn’t go into many details about his specific method, but using conductive foam as a force sensor is a fairly well-known and effective hack. To top it all off, [chiprobot] added a web GUI served over WiFi with an ESP32. Watch the whole thing in action in the video embedded below.

Continue reading “Hackaday Prize Entry: 3D Printed Linear Actuator Does 2kg+”

Art With Steppers And STM32

Automotive dashboards are something that largely go untouched in the average car’s life. Other than the occasional wipe with a damp cloth, they’re generally reliable for the life of the car and considered too tricky to repair as age sets in. Nevertheless, some hackers find themselves tinkering with them, and learn skills in the process, such as how to control stepper motors and talk to the CAN bus. Having done some projects in the past, [Dan] had some old tachometers lying around and decided to turn them into a piece of art.

The build is powered by an STM32 – a powerful ARM-based platform with plenty of IO and potential. [Dan] leveraged its capabilities to have the board generate music and react to its onboard accelerometer data while also driving the stepper motors from the old tachometers. The project was then completed by 3D printing a mounting plate and placing the tachometer assemblies into the back of an IKEA canvas print.

The end result is a piece of wall art that emits eerie stringed music while twitching around. It came about from [Dan]’s prior projects in working with dashboards. It’s a fun use of some well-earned hacking skills, but we reckon there’s even more potential. There’s a huge number of projects that could benefit from lightweight tiny actuators, and we’d love to see a robot made entirely out of junkyard dashboard parts.

For another dashboard hack, why not check out this beautiful Jeep desk clock?

A Command-Line Stepper Library With All The Frills

When you already know exactly where and how you’d like your motor to behave, a code-compile-flash-run-debug cycle can work just fine. But if you want to play around with a stepper motor, there’s nothing like a live interface. [BrendaEM]’s RDL is a generic stepper motor driver environment that you can flash into an Arduino. RDL talks to your computer or cell phone over serial, and can command a stepper-driver IC to move the motor in three modes: rotary, divisions of a circle, and linear. (Hence the acronumical name.) Best of all, the entire system is interactive. Have a peek at the video below.

The software has quite a range of capabilities. Typing “?” gets you a list of commands, typing “@” tells you where the motor thinks it is, and “h” moves the motor back to its home position. Rotating by turns, degrees, or to a particular position are simple. It can also read from an analog joystick, which will control the rotation speed forward and backward in real time.

Division mode carves the pie up into a number of slices, and the motor spins to these particular locations. Twelve, or sixty, divisions gives you a clock, for instance. Acceleration and deceleration profiles are built in, but tweakable. You can change microstepping on the fly, and tweak many parameters of the drive, and then save all of the results to EEPROM. If you’re playing around with a new motor, and don’t know how quickly it can accelerate, or what speeds it’s capable of, nothing beats playing around with it interactively.

Continue reading “A Command-Line Stepper Library With All The Frills”