Building the first Electro-Mechanical Pedal Steel Guitar

Reading here:

Looks like you can get better precision, but you’d still need some external sensing, to control the timing?

Even the expensive robotics servo above has .29 degree precision, which gives about 180 steps of precision over 60 degrees… that’s nowhere near 10 bits.

Well, he was not trying to hold a position in the middle. Forgot about that. Doh! He went endstop to endstop. Not sure how he tuned it though. And nobody has heard from him since he posted 6 it years ago, so it’s hard to ask questions.

I’m realizing these are slow, and probably that’s why they have so much torque… I imagine they all have similar motors inside.

I’m back to thinking about the motors with built-in encoders. Couldn’t find one with a lead screw… wondering how difficult it is to attach a screw… I assume there are adaptors for that sort of thing.

Time to stop Ali diving and mock up this string, so I have a sense of how much power I will need.

Typically you use a lovejoy aka spider aka finger coupling to tolerate imperfect alignment. I assume they are available in very small sizes, but I don’t really know, I haven’t looked.

I definitely don’t know how fast the RC servos are, but if even the most precise aren’t precise enough for you, that puts the nail in this coffin…

If you end up using a stepper, I’d suggest that you consider buying a 3D printer control board with enough channels, rather than building your own hardware. Here’s one with 8 stepper channels: https://www.biqu.equipment/products/bigtreetech-octopus-pro-v1-0-chip-f446 You can get it with 8 TMC2209 stepper drivers for another $20 or so; that seems like a really good deal to me. Looks like the v1.0, v1.1 and pro all share the same firmware, so you can see how Marlin, Klipper, and RepRap are configured for the Octopus and work from there to build custom firmware for it.

I wired up the string tester, but broke my first string. I used the highest string, as suggested by the steel players, but then I found this:

So I can get a particular tension on any string. They are all pretty similar. I think the highest string, being thinnest, is most likely to break. So I’ll be working with a thicker string…

1 Like

Okay, some real-world data, finally. Here’s the test bed:

As my mother used to say, when confronted with something like this: “A thing of beauty is a joy forever!”

Here’s a side view showing the mechanism:

With a 36 gauge string tuned to a low A, there is about 21 lbs of pressure on the bridge. This is near the maximum you would need. It’s pretty well balanced with the spring in the picture. The leverage is about 3:1. Deflection for the desired pitch range is about 1.5 cm, and requires about 3 lbs of pressure. The string returns to center fairly accurately, and it takes more pressure to lower the string than to raise it, 2 lbs vs. 3. My knife edge leaves a bit to be desired, so it’s possible these figures could be lowered a little bit. But it’s a good ballpark.

So now I need to think through the math to figure out how much torque a motor would need to drive a lead screw to move the bridge. With a t5 2 screw with a 1mm thread the mechanical advantage would be… (pi * 5):2, IIRC, or around 8:1…

The encoder motor mentioned previously lists torque figures:
[EDIT: 750 rpm is not in the table, but is available]

If I use the fastest gearing, thats .027 kg.cm. Would it just be 4x the torque at .25 cm from the center of the shaft? If so, that gets us up to about 0.1 kg. If our screw gives us 8:1, then that’s .8 kg, or about 2 lbs. A little shy. But a t5 1 screw or a slower motor gearing could get us there… are those rpm figures at 12v? Can you get more speed with more voltage?

[EDIT: figures are at 6v, and double the speed at 12v!!]

Actually, I think I made my speed calculations based on a 1mm thread, so the slower motor might work just fine with a t5 2 screw, and get us up to about 6 lbs of pressure, which seems like enough margin… I’m not accounting for friction, for example… but these motors are cheap enough I could buy several different gearings. Should buy 2 of each also, in case one is defective…

As far as having to center each time I start up, I don’t think I’d need to. Barring a power outage, the pedals should all be disengaged when power is cut, and the screws will just stay in position until the next power up. You can presume that to be a zero point, and the player will tune the strings based on those positions. Then you can compute the other positions from there, based on the encoder. Seems like it could work. Of course even if it does, it may prove to be less reliable than absolute position sensing, so there might be an upgrade needed eventually.

something like this?

hmmm, that’s as expensive as the motor :wink:

1 Like

Oh, I thought you were going to use a compression spring on the far side of the bridge. But using a longer spring makes a lot of sense for having a similar amount of force through the whole travel!

Yes, all other things being equal, increasing voltage should increase speed.

One more consideration in favor of a stepper motor here…

A stepper motor is a form of brushless motor. Brushless motor voltage ratings are based on current and constant use. You could very likely use 24V to run a stepper motor, but this gear encoder motor is probably brushed, so I wouldn’t go much over the listed 12V. I think that brush wear increases with voltage, but I don’t know if that’s true. With the stepper motor you could probably even go to 28V (the max for the TMC2209) to go even faster. To go over 28V you would have to use TMC5160 which can go all the way to 60V, but is also more expensive. The Octopus Pro can support 60V motor voltage for the TMC5160. I’d definitely try the cheaper TMC2209 first though. (Note that over 50V is considered high voltage, though, so in practice with the TMC5160 I’d stick to a 48V power supply.)

One of the 10mm steppers with integrated shafts I listed above is rated at 6 mN-M at 500PPS at 10 pulses per revolution at 5V, so 50 revolutions per second, and at .5mm lead that’s about 1 inch per second. That’s about .06 kg-cm of torque, which by your calculations definitely isn’t enough. But all other thing being equal, a wider motor has higher torque, and take a look at this 15mm unit, where the force is measured in linear thrust, at 0.5kg:

https://www.aliexpress.com/item/4000834477859.html

That’s 500mA at 9V I think.

We’re getting close to the thrust you need here. Since the current rating is a heat limit and assumes 100% duty, and you aren’t going to be running these constantly, and you can use very low holding current with a modern trinamic stepper controller, it’s not insane to consider running them at substantially more current momentarily. You could very likely safely run 1.5A through them for a few seconds as long as they rest long enough to cool. A 24V system could give you that. With the trinamic drivers, you could ask for 1.5A running current and .1A resting current. It might actually work.

Yeah, or you can have the firmware keep track of the current position for each string in non-volatile storage, and as long as power doesn’t flicker while you are in the middle of a move you are OK.

With the trianamic stepper drivers, they have the ability to sense if they run up against a barrier (by back EMF) and raise a pin to report it. So as long as there is a physical stop fo the fingers at max travel, they could just push the finger until the DIAG signal is raised and use that as an end stop without any switch at all. On 3D printers this is called “sensorless homing” and I have used it on one of the printers I built.

I suppose you could do the same thing with the encoder motors, though! Just drive them until the encoder stops reporting changes for some amount of time, and then you know you’ve hit the end and have homed it; you don’t even need to measure EMF! Sorry I didn’t think of this before…

That’s just a straight hard coupling. And while that seems expensive for a hard coupling, it costs about what I’d expect for a lovejoy / finger / jaw / spider copuling. Wikipedia has a picture at Jaw coupling - Wikipedia

One more reason to consider the steppers that have the integral shaft! :smiling_face:

When the motor shaft is sufficiently smaller than the screw minor diameter, it’s possible to mate them by drilling a matching hole in the end of the screw using a lathe, and then using permanent thread locker like loctite 271 to fix the motor shaft in the hole. But I don’t think that’s the case here? And a metal lathe is more expensive than the motor for sure. :rofl: Similarly, it would be possible to make a small permanent coupling with a lathe and some aluminum stock, and fix it with loctite 271 instead of screws. Do you by any chance have a friend with a lathe? This is a really easy project! Bore a piece to minor diameter long enough for all the parts, then alternate drilling a few mm at wider diameter and parting off through all the pieces you need.

Well, because I was already seeing delivery times moving post-newyears in China (which is a month-long break mid jan to mid feb) I just bought a couple of the encoder motors. EDIT: I got two of the 500 rpm, which do 750 rpm with 12 volts under load. The couplings on Ali were 45 cents each, so I bought 8, which cost $7 to ship. Not committed to this, but I will be able to test if they have the torque needed. I also have T5x2 lead screws in my Amazon basket. There is a video of the motor, and it is remarkably quiet.

From an instrument stability standpoint, I’d really like to have zero power required to keep the fingers in position–and for that position to NOT be at either extreme of travel. Instruments really like being kept in the same tuning, and even with the steel which changes that tuning dynamically while playing, 90% of the time it’s not being played, and it will be best for overall tuning stability to keep the strings at the zeroed pitch when it’s being stored.

I think in practice, the fingers might in many cases never need to go to either extreme, so the endstops would be more of an emergency stop thing, than something that is regularly used. The force required to move the string pitch increases the further you get from center. So, if I have a string that needs a particularly long pitch shift, I could conceivably just use a thinner string there, and that would decrease the torque required. That means for some strings, you might not even have the torque to go the full distance, which would be fine if you didn’t need it. My current favorite copedant (steel word for the whole tuning mapping) has no string needing to move more than 2 semitones, which means you can use a thinner string at higher tension.

The goal of changing copedants with the touch of a button is probably only partially realizable here, just because different tuning requirements may call for different string gauges, and the balance springs will need to be adjusted when the string is retuned. But the alternative is to have really big motors. For me, it’s worth it just to have flexibility over pedal placement and resistance, and freeing up the space under the strings to make it more compact.

Rather than using a flexible coupling, my thought was to allow the motors to rotate a few degrees up and down as the screw moves, by mounting them with a bearing. There would also be a bearing connecting the lead nut with the bottom of the changer finger:

here’s how that would look in context:

I meant to suggest only that you would use the stop for establishing a reference. Basically, turn the motor until the encoder stops registering turns, then back off a known distance to the neutral position. You wouldn’t park at an extreme.

The screw is unlikely to back-drive, so you should be able to leave the current at neutral whatever the position.

So from my experience with the teensies, I know there are digital and analog inputs. I assume the encoder, since it outputs a basic square wave, would be wired to a digital input? Can the analog ins also work as outputs? There are 13 of those, which is not enough for 10 strings and 9 pedals. I guess that means multi-plexing? I avoided that with my MIDI interfaces, but I did read up on it.

I’m going to go read up more on PID. If I slam the pedal down, I’ll want to just accelerate asap to top speed, and stay there until it’s time to decelerate. Is that what you meant by a trapezoidal curve? However, if I move the pedal more slowly than the top speed of the motor, that’s when I’ll need to figure out what speed the motor should go to track the position of the pedal. Does that seem like the basic idea?

Ordered bearings (5/16 interior diameter to mount on a hardened steel bar I have from another project, and tiny ones for the motor mechanism) and a lead screw, the motors and linkages are on their way from china. I think I’m going to get one of those $300 little Genemitsu 3018 CNC machines to cut my fingers. [ouch! CHANGER fingers, I mean :wink: ] Sounds like they will do brass or aluminum if you just go slow enough. Might take all day…

What else?

Many of the pins can be either inputs or outputs. It depends on the processor, and I don’t know specifics of pinouts on the various teensies.

By “trapezoidal curve” I meant an acceleration profile. Here’s a random article I found that looks good to me at first glance:

That was for steppers. For a servo, you want to use a PID algorithm (links above).

I didn’t realize you wanted to modulate rate of change by pedal velocity, so I hadn’t been considering that at all. How were you thinking of sensing pedal velocity?

I mis-stated. I just want to track pedal position as accurately as possible.

Oh,that’s right, there are lots of teensies. I’ll check 'em out. I’ve only used the LC, but there’s much bigger ones, IIRC… I’ll want to support 9 analog inputs, and 10 outputs, for a 9 pedal 10 string. I’ll see if there’s one that big.

Edit: The teensie 4.1 has 18 analog ports, but 35 pwm. And 55 digital.

Reading this:

It looks like I’ll need motor controllers, correct? Like these?

https://create.arduino.cc/projecthub/ryanchan/how-to-use-the-l298n-motor-driver-b124c5

Looks like they use a combination of digital outs and PWM outs…

There are two different versions of this board here:
https://www.amazon.com/MELIFE-Channel-Controller-H-Bridge-Replace/dp/B08HRMWHSL/ref=sxin_13_ac_d_bv

Do you know how the mini board gets by without a heatsink? It is a lot more compact that way.
EDIT: looks like you need the bigger board to run at 12 volts…?

I thought that the pedal positions were just binary, either pressed or not pressed. This comes from me not knowing anything about pedal steel guitars before you showed up here. :smiling_face:

I keep forgetting how awesome the Teensy 4.1 is. Here’s an extended pinout document: from GitHub - KurtE/TeensyDocuments: Some of my own Teenys documents such as XLS documents showing pin assignments and the like

Yeah, see references to the L298N above, from @dougl

Well, in the mini version it’s a different chip, and the board is the heat sink.

And yes, it looks like the MX1508 is limited to 10V.

On the L298N, It does look like you’ll want to supply 5V as well. I don’t know whether it’s compatible with 3V3 logic level. Hopefully you can supply 3V3 to it and give it 3V3 logic signals. I have not a lot of experience here. @dougl do you happen to know whether L298N can run on 3V3?

The L298 breakout boards often have their own onboard 5V regulator(jumpered) which can be used to power something like an Arduino or Teensy but you will need to watch out for any noise which might come from the motors controlled by the L298. I did an RC Powerwheels and the system would periodically glitch from too much noise on the 5V and I ended up putting a DC-DC converter directly connected to the batteries.

I don’t recall if the L298 logic will work with 3.3V but it’s over the 2.3v threshold for a H signal so should work.

1 Like

Ah, the boards that @woodslanding linked to say that you should provide your own 5V say that on-board 5V doesn’t work over 12V motor supply.

Probably because it’s a 7805 so at higher voltages it’s dropping so much voltage it’ll overheat if there’s much load on the 5V. Good catch.

Bingo, looks like a 7805. Looks like you can change a jumper to supply it yourself. I don’t know how clean the power needs to be, whether you can use a buck converter or need a linear regulator.

okay, yikes step away for a few days and I forgot half of what I was doing. Hope you all had a nice holiday!

Well, and I just learned there is a non-musical use for pulse-width modulation! Who knew?

So if I understand correctly (and that’s hardly likely) I will need 4 connections to the teensy for each motor:

Motor1 - Digital
Motor2 - Digital
MotorEnable - PWM, to set the speed.
EncoderIN - Digital, I assume, as it looks like a square wave.

This means, for an 8-string instrument (which I think this one will be… The second one might be 10, if I get that far…) I’ll need 32 connections?

The teensy has 34, great!

Except that doesn’t leave much for the 6-10 analog ins I’ll need for pedals and levers.

So I guess I will need some kind of multiplexing of those digital signals?

Encoders are usually two pins, often referred to as A and B. “Quadrature encoders” have four states, and by tracking the changes you know not only that they changed, but in what direction.

You generally need to use interrupt handling for decoding quadrature encoders. You put an interrupt service routine on both the input pins, and every time it is called, you read both pins and compare to the previous state, and then you know direction and can add or subtract one to/from the previous absolute position. Here’s one easy approach:

This might seem silly, but… One of the easiest ways to control more inputs is yet another microcontroller. An ESP32, ESP8266, or Raspberry Pi Pico are all inexpensive and you can connect them with a serial connection (typically SPI) and have them talk to each other. (Or just use another teensy, but you don’t need the 4.1’s 600Mhz processing power there) That is a form of multiplexing, but it’s more flexible than a hard-wired multiplexer.

Quadrature decoding is a great use for a secondary microcontroller. Every time the absolute position changes, it just reports the axis and the new absolute position to your main controller.

Also, using secondary microcontrollers like this makes it easy to expand to more strings; if you run out of pins, you can just add another secondary microcontroller for the additional channels you need.

1 Like

I doubt you could do all this with one controller. As @mcdanlj suggests I would put a small controller on each string channel connected on a buss like SPI or I2C. The string controllers can all run the same code leaving the main code for computing more sophisticated elements of the problem and the UI.

2 Likes

From a comment in a recent HaD post about building a stepper motor replacement from a gear motor, take a look at this library:

While it includes the ability to read STEP/DIR signals, it also has a serial protocol. It includes sensorless homing. It might be useful to read, if not directly to use.