Building the first Electro-Mechanical Pedal Steel Guitar

Here’s a 15mm motor… don’t know if this is any better. Just assuming a larger motor is more powerful? It’s cheaper, not that it matters at this price point:

I like the mounting bracket.

1 Like

Bingo. Servo motors with encoders generally cost more, so I was looking for ways that could possibly make sense with a stepper for cost management.

There are two kinds of documentation on using steppers with arduino: Those that show you how to directly control full steps with an H-bridge, and those that use a stepper driver. You are looking for two things, I think:

  • Using a stepper driver
  • More specifically, using a serial interface (instead of STEP/DIR/EN) controls for a Trinamic stepper driver.

Here’s one of a great many resources.

I would use a 3.3V 32-bit card instead of a 5V 8-bit card to control it. It opens up so many options, and they are cheap these days, even in the midst of chip shortages. For example, the Teensy boards go up to 600MHz and are simply not expensive. Here’s a library that works on arduino on Teensy and ESP32, though for this purpose I would probably go with the Teensy.

Absent clearer specs, current and lead together should give you at least some sense of power. They are unlikely to be horribly different in efficiency I think.

Well, I’m comfortable with the teensies, so that’s good news… I’ll put in an order for a couple more. And thanks for the link. Got lots of reading to do now!

2 Likes

Well, when I talked about cost effective, I’m not thinking retail margins. Reading your explanation of stepper motors above, I see:

Using this feedback, the motor can be controlled more smoothly (and typically much more precisely) than a simple stepper motor. Servo motors are much more sophisticated in design than stepper motors and tend to be more expensive, which is why steppers are often used instead.

I want to keep costs down to some degree, but I certainly don’t need a 3-5 dollar solution… if servo technology is better, I feel like I should be looking in that direction, even if it’s a steeper learning curve and more expensive. I mean–how much more expensive are we talking? One thing that would be expensive is putting a lot of time and energy into a second-rate solution to the problem… of course, a large part of that learning will be applicable to the next-gen solution, so maybe no big deal, and start cheap.

Searching, searching…

These are cheap:
https://www.aliexpress.com/item/1005002591809404.html

Do have to figure out the lead screw…

Yeah, when I was thinking about expensive, I was thinking more about things like https://odriverobotics.com/ because I was also thinking of things with pre-packaged servo controllers. Also my interests in servos has been machine control where I’d be replacing NEMA17 or NEMA23 steppers typically. And those packages have come down to the $50-$100 each range in the past few years. But @dougl’s post about controlling cheap servo motors that he linked to above demonstrates how to control h-bridge chips from an arduino, if you have enough channels, with the kind of motor you found! L298N breakout boards with heat sinks are a few dollars each.

Another benefit of servo over stepper is that the servo won’t consume as much power. Classically, steppers have always consumed the same amount of power regardless of whether they are moving. The trinamic drivers allow you to reduce current when they aren’t moving for applications where backdriving forces are minimal, but they still need meaningful current to avoid losing steps, and that current turns into heat. I’d guess orders of magnitude less current to hold for servos than even trinamic-controlled steppers.

A quadrature encoder on a motor doesn’t give you absolute position feedback, so you would still need a homing sensor; for example, a microswitch at one end of travel for each finger, and when you powered up the PSG it would have to sense the home position for each string before being able to count revolutions to keep aligned. Driving a lead screw to limit backdriving, you might be able to get away with “trapezoidal” motion planning instead of a full PID controller, I don’t know. The “trapezoidal” motion planning solution is basically the “P” in PID with a maximum value. There’s probably enough friction in the system to avoid the need for at least the D term, maybe even the I term. That’s gut feeling not science.

Okay, latest re-think.

Looking for servo motors, I kept running into the 180 or 270 degree servos used for RC cars, and there are a ton of them, and they have a lot of torque, up to 50 kg, looks like. (how is this measured? I do not know!) Shouldn’t need near that, but I can get a few samples and see what is needed. It’s what the guy in the first imgur link used for his telecaster mod… My concern was always their bulk. But I decided to address the bulk issue, and it’s not that bad. It looks like I can actually fit them in the space I need:

Not sure if I should use Rods or cable for the pulls. Have to look into what kinds of hardware are available, and what the tolerances are, as I won’t want too much play in the mechanism:

I can’t make all the pulls perfectly right-angle, but I can come quite close:

This is all sketchup, so of course very approximate, but it does prove the concept can work… thoughts?

Are these real servos, not steppers? Will the positioning be precise enough?

The middle two pulls will have the least torque, as I’ll have to use longer levers. But I could just use a stronger servo for those…

Edit: Looks like really precise servos are expensive:

Not quite prohibitive, though…

1 Like

If someone has actually made that work, that’s cool! My concern was that plucking the strings will change the tension and move the lever and cause the motor to react. If I were trying that, I’d definitely use cables instead of rods.

They are real servos, not steppers. Because they have classically used an internal potentiometer for position command, they wear out by wiper wear over time. Basically, you command the position by feeding it a voltage. It turns until the voltage at the potentiometer wiper is equal to the command voltage; it uses the difference between the two voltages as feedback. The change is proportional to how far it is away from the commanded angle (P in PID). Some may have an RC circuit inside as a fixed integrator (I in PID) to reduce “hunting,” I don’t know? Or they might actually use digital logic!

The Dynamixel looks interesting because it says it is programmable with an internal microcontroller! That would be better than the classic inexpensive RC servos. And that could very likely let you avoid reacting to plucking strings by careful parameter tuning.

Note that this kind of servo arrangement will consume power like a stepper, because it is going to have to fight being back-driven all the time; the servos that wouldn’t consume power would be because they are turning a screw. On the other hand, this kind is absolutely positioned, so you wouldn’t have to re-home the fingers every time you turn on power!

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: BIGTREETECH BTT Octopus Pro V1.0/V1.1 For 3D Printer – Biqu Equipment 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