OpenPedal

Electronics & Control

A short history lesson

Below is a diagram of how a traditional double-action harp changes the pitch of a string. When a disc contacts the string, many people believe it’s the extra tension that raises the pitch. That’s partially true, but the biggest change actually comes from shortening the length of string that vibrates, which raises the pitch. In other words, the disc is acting like the lever on a lever harp.

Diagram of a double-action pedal harp string in three positions. Left: both discs clear of the string. Middle: the upper disc turned so its two pins grip the string. Right: both discs gripping the string, shortening its vibrating length again.

Left to right: flat, natural and sharp.

Math time! To raise a string one half step, you only need to shorten its vibrating length by about 6%, but you’d need about 12% more tension to get the same change by tension alone. That’s why the disc shortening the string does most of the work. This doesn’t take into account variations between string types, or core and wrap materials.

What about twisting harder?

Diagram of a servo standing in for a disc. Left: the two pins on the servo horn are clear of the string, which runs straight down from the bridge pin. Right: the servo has turned so both pins grip the string, shortening its vibrating length the way a disc does.

Now you might be thinking (because I did, and still am): what if we simply twist one disc harder? Can we tension, or “bend”, the note to a higher pitch? The quick answer is yes, and the long answer is not well.

Let’s say we use a motor to go from the flat to the sharp position, in the same spot it would be on a traditional mechanical harp action. When the posts on the disc make contact with the string, they need to hold just enough tension for a few subtle things to happen:

Diagram of a servo disc in three positions. Left: pins clear of the string. Middle: turned to grip the string for one half step. Right: turned further to add tension, where the blue line shows the over-twisted string pulled sideways out of line and the dashed black line shows where the string should sit.

When you only try to raise the pitch a half step by shortening the string, this works well enough. But when you increase the rotation and tension to raise the pitch another half step, you run into two barriers. In the diagram you now see a dashed black line and a blue line. The dashed black line is where the string should sit, and the blue line is where it ends up - the string becomes so twisted in the motor that it begins to aggressively affect string spacing. The other issue is that holding a servo or motor under tension creates heat, especially with small motors that are also at their stall torque.

From pedal to servo

A servo uses something called PWM to know what angle to rotate to. PWM stands for pulse-width modulation. The microcontroller sends the servo a quick electrical pulse about 50 times a second, and the length of each pulse sets the angle: a shorter pulse turns it one way, a longer pulse turns it the other, and everything in between lands somewhere in the middle.

Using microswitches, the harp base knows which position each pedal is in and sends that to the microcontroller, which has saved presets for each string and turns that into the right PWM signal for each servo.

Wiring diagram: the servo’s red power wire runs to a power supply, its black wire to ground, and its blue PWM signal wire to the microcontroller. The microcontroller is connected to the pedal box, shown side-on with the pedal resting in the flat notch above the natural and sharp notches.

In the flat position the disc isn’t touching the string, so the motor only generates a small amount of heat. Or even better, the microcontroller can simply turn the PWM signal off, and the gear train will generally have enough friction to hold the disc in place. In the latest revision of the servo firmware, it re-sends the PWM signal in waves up the harp every 30 seconds while in the flat position, to keep everything aligned.

The heat problem

The same wiring diagram with the pedal moved down to the natural notch. The servo horn has turned to grip the string, and heat lines rise off the servo.

The trouble starts when the servo has to hold tension on a string that is pushing back. It can’t turn and then relax - it has to keep pulling against the string to stay where it is, and that constant effort comes out as heat.

How much of a problem this is depends on how far down the harp you are. In my experience with Injora 2065 micro servos, the strings near the top are fine. From about A3 and below they are not, because those strings need more tension before the note will sit cleanly without rattling. Down there, once the pedal is in the natural position, the servo is holding hard against the string and starts building heat.

I spent a lot of time ignoring this problem initially because there wasn’t really a good solution. My hacky solution is to be very careful to only command the servo angle just enough to not hear a rattle.

The second solution I’ve been experimenting with is logic-level N-channel MOSFETs switching the servo’s power, driven by another PWM output from the microcontroller. I’ve found you can “get away with” reasonably lazy power cycling. The Injora servos handle this well because when you power cycle them, they don’t reset or glitch too much. This is not a solution, and in my opinion only a fun experimental band-aid, because they still make noise and glitch from time to time.

The same wiring diagram with a logic-level N-channel MOSFET added in the servo’s ground line. A purple Power PWM wire runs from the microcontroller to the MOSFET gate, so the microcontroller can switch the servo’s power on and off. The pedal is still in the natural notch and heat lines rise off the servo.

A logic-level N-channel MOSFET was chosen for its low voltage loss and higher power handling (originally a transistor was used - simply because it was what was lying on my bench to test this idea). While the system works, it has been abandoned from further development.