For the last few months, I’ve been putting together a tiny workshop at my desk at Orbital and planning the next actuator test. I think this is it: the setup that will make it into my first robotic drum prototype.
Third test: solenoid with duty cycle
I’ve finally gleaned enough electronics know-how to set up an Arduino with a MOSFET that switches a cheap 12V 1A push solenoid, and not fry everything in the process. (RIP pin 13, though.)
This circuit can use digital on/off signals to control the solenoid, but it can also use the Arduino’s analog output to apply a duty cycle. This means the solenoid’s armature can be extended with varying force!
The Arduino takes input values from 0 to 255 (where 0 is off and 255 is constantly on). It outputs pulse-width modulation at 490Hz to an analog pin.
It turns out that there’s a minimum duty cycle required to keep the armature extended. Above that threshold, the solenoid can indeed strike at a range of velocities.
Solenoid duty cycle: observations
- 255: Strong and solid.
- 127: Armature extends, but it’s easier to push back. Strong enough to extend upward (against gravity).
- 111: Feels pretty sturdy. Works with the solenoid oriented horizontally, but not pointing upward.
- 95: Doesn’t extend upward. Extends and stays extended down (with help from gravity).
- 87: Just barely extends fully when facing down. Doesn’t quite compress the end of the recoil spring.
- 79: Needs a slightly longer on-signal. Needs to work with gravity. Doesn’t quite overpower the spring.
- 63: Can stay extended if put into position with outside force, but mostly bounces back.
- No movement behavior below this; only a soft buzz.
For a solenoid positioned above a drum head and striking a short distance downward, it looks like there is a useful control range between 95 and 255. MIDI velocity ranges from 0 to 127, so that means it can operate at full resolution!
This is promising. The solenoid armature can play really quickly and expressively, which seems like it will even work well for subtle movements like playing grace notes.