Building the first Electro-Mechanical Pedal Steel Guitar

I got my teensies in the mail today, one 4.1 and one LC.

Looking at the pin diagram for the teensy LC, it looks like with serial tx and rx on pins 0 and 1, I have 25 pins remaining, numbers 1-26. It looks like all the pins support digital in, and more than 8 support PWM. Each motor requires 2 digital and one PWM connection. So could I run 8 motors from this one board? Are there other limitations or connections needed that I’m not aware of?

What are the 3 signal pins? I probably missed something but I thought for bi-directional motor control using an encoder it was 4 pins:
for the motor it’s 2 for the h-bridge:
1 - direction
2 - pwm/speed

for the encoder it’s also 2 for a quadrature type:
1- chan 1/A
1- chan 2/B

DOH! Right, I was forgetting the encoder inputs, of course! Can you do it with just 4? I thought the h-bridge required two digital connections and the pwm. So yeah, need 2 LCs for 8 strings.

Is there a way to get by with just one digital in? How do you stop the motor then, just give a PW of zero? Is that a ‘true’ off? Well, it doesn’t rfeally matter, as I’ll need a second LC either way…

1 Like

I think there are some which use one pin for direction and the PWM with 0 on the PWM being stop.

got the H-bridge in. Boy that heatsink is TALL. May look for another option when it comes time to build the instrument. But this will be fine for testing. Just need the motor now. Impatient!

1 Like

I’ve used these little ones with the yellow geared motors and wheels… have a max1508 chip on them.

I recall somewhere these are limited to 10v. But they are also limited to 2.5A between the two motors. That would work with the motor I ordered, but the more powerful pololu motors are 1.5A at 6 volts. That said, they are probably around 2.5A between two of them at 10 volts… so maybe just fine. Pololu’s driver board above would also work, though pricier, maybe…

Alright, I got parts! Pretty cool to see it all put together. These motors are TINY!

First test. No way I can get the motor to move via pressure on the nut. So the device should not need any current to stay in place.

Should be able to wire up a test circuit tomorrow or the next day…

Okay, I had been researching both methods, but missed this… looks like better support for it. Seems like I can figure it out from what’s here: Teensyduino: Using the UART (real serial) with Teensy on the Arduino IDE

3 Likes

I guess for test purposes, I’m just going to use the onboard 5v, for now. This seems like a non-ideal board for my purposes eventually, but should work for now…

I guess it’s probably a good idea to disconnect the motor power supply when programming the teensy… Since I’ve only used them as midi interfaces, I haven’t had to worry about powering them, since they get it over usb.

Boy are these JST connectors fiddly. I like being able to plug and unplug, but crimping is sure no easier than soldering (yet.)

Looking ahead, it seems like I may be able to use almost all of the solution here…

So, I have been studying this project, as well as the code. It looks like I may be able to use most of this solution as-is. He has built a little daughter board that hosts a processor, so that the whole secondary board issue is taken care of:

" By stacking some small PCBs behind the motor body, it was possible to squeeze a DRV8837 DC motor driver and a pair of hall effect sensors on the first PCB layer, with the magnetic encoder nestled tightly behind it. Pin headers at the edge of the PCB connect to a second PCB bearing the microcontroller, which is based on the cheap STM32L432"

I am having a lot of trouble figuring out the process for ordering some of these boards… I can open the drawings in the editor, but I can see no place to export anything. And the forum won’t allow you to post until you’ve created a project and worked on it for an hour or more. I guess if you can’t figure out how to create a project, they don’t need your kind :wink:

In the meantime, I have everything wired up, and I need to try putting some code into the teensy… getting better at JST, down from 5 min to 30 sec a pin…

In other news, I realized the string spacing I want is wider than I had thought. One of my instruments is 11mm, the other 10.5mm. This means I could conceivably put the motors all in a row, which would take up a lot less space.

1 Like

All my experience so far is uing KiCAD locally to produce gerber files and sending them off for fabrication; I’ve never used EasyEDA before. But looking at it, I see Fabrication → One Click Order PCB/SMT as well as Fabrication → One Click Order Parts so that’s probably where you want to start.

I don’t have experience ordering assembled boards, only bare boards and components and putting them together myself. However, these boards have surface-mount components, at least two of which have solders pad under them, so a soldering iron isn’t enough; it would take a hot plate or hot air rework station to assemble. I’d definitely go with assembled.

yeah, I did some reading on SMT. I’m good with soldering the teensy ( after building a rack for the soldering iron, so I can hold it either side of the tip, instead of up at the handle–my tremor is really not soldering-friendly!) but SMT looks much more challenging. I see lots of DIY for hot plate, and I looked into getting an iron with hot air, but I think letting someone more competent do it is well worth the $$.

I’ll follow up. I got off on the wrong foot with the site, signing in with Google, which breaks everything on the site, including signing out! Got that figured out now, I think, so I’ll try again.

1 Like

Very eager for the possibility of an electronically actuated PSG. I’m a programmer not an engineer so if I were to offer help it would likely be much later in development once getting to the user interface part. I am happy to put money into this though if that would help drive progress further (no expectation to be paid back, it’s worth it just for the prospect of this becoming a reality).

Here’s a somewhat “out there” idea to consider. A power washer doesn’t produce pressure when you press the handle, rather it builds up pressure automatically and stops when it gets to a certain PSI. When you press the handle, the pump works to bring the pressure back up to its desired PSI as the pressure drops from water coming out. Could this methodology be applied to pulling force? Would it be possible to have one motor that builds up a “bank” of tension which could then be moved to any of the 10 strings when needed? Would that have any advantages?

For me, the main criteria for an electronic PSG are going to be latency, accuracy and reliability.

2 Likes

It might. However from a mechanical standpoint it’s far beyond anything I can do, or even imagine… a 10-wheel transmission that can deliver power to any combination of 10 wheels in either direction?

Electric motors are quite torquey from 0 rpm, so I’m not sure it would be necessary… actual latency in the system will be negligible, but the rate of change IS going to be limited by the power and speed of the motor. That said, my calculations suggest the low power motor I have will be sufficient to change the string pitch in about 50ms/semitone. There is a more powerful motor that might cut that in half. I don’t know how fast you (or I) can stomp a pedal down, but it’s got to be at least 20-30 ms, so I think we are getting in the ballpark. But it remains to be seen how it will feel. I know that 10ms of latency on a keyboard is not negligible at all. However, in the case of the steel, you never get a pure square wave type change of pitch, nor do you want it. And the string itself has a response time that is limited! But also, you are continuously tracking the pedal position, so it’s not going to have latency in getting to pitch unless your foot really moves faster than the motor can.

But since you are a programmer, maybe you can help with this… I’ve uploaded the following code to the teensy, taken from a tutorial on using the L298N, and the motor is correctly responding in both directions. However, the speed control is not working. Do I need to tell the teensy that the PWM output is PWM?? Can you see other issues with this code?


int pwmPin = 17;
int motor1pin1 = 18;
int motor1pin2 = 19;
int wiperPin = 16;
int value = 0;


void setup() {
  // put your setup code here, to run once:
  pinMode(motor1pin1, OUTPUT);
  pinMode(motor1pin2, OUTPUT);
  pinMode(pwmPin, OUTPUT); 
  pinMode(wiperPin, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:   
  //value = analogRead(wiperPin);
  //Controlling speed (0 = off and 255 = max speed):
  analogWrite(pwmPin, 4); //still seems to be full speed....

  //Controlling spin direction of motors:
  digitalWrite(motor1pin1, HIGH);
  digitalWrite(motor1pin2, LOW);
  delay(1000);

  digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, HIGH);
  delay(1000);
}

One more general teensy quesion. I’ve set the type to NO USB, because this needs to function without usb. However that means I don’t have a console to look at data… Can I safely run power to the teensy from the 298 board and via usb? When I disconnect the voltage from the 298 it doesn’t work, even with the USB connected… (EDIT: but I didn’t change the teensy to a USB interface, so maybe that’s it…)

I’m redoing my wiring more robustly, in case that is the culprit…

You might try an external pull-down resistor on that pin? I’d put something between 2K and 10K between that pin and ground and see if that changes anything. It might be floating high if there is nothing to pull it low.

Also, pinMode() shouldn’t be needed for analogWrite() I think.

Do you have an oscilloscope, or a multimeter that measure frequency? This is all logic level, so even a cheap logic analyzer like Open Bench Logic Sniffer - DP might end up helping to see what’s happening on wires.

Thanks for the detailed reply, it does seem like the individual motors are cheap/capable enough. I can’t comment on the code since it is mostly just configuring the teensy, nothing immediately jumps out.

this needs to function without usb

Do you mean it cannot function with usb or do you mean the final version needs to work independent of a computer? For initial testing USB seems fine.

1 Like

Rewired, it works with either external PS or USB power… I’ll look into the pulldown resistor, I do have some of those handy. I’ll also look at what my multi-meter can do.

Here’s something wierd: running from usb, I get bi-directional motor movement. When I power from an external supply with USB disconnected, the motor only runs in one direction… ???

I’ll mess with it more…

That’s fun! :crazy_face:

When you are running from USB, is the external supply disconnected and everything is powered by USB, or are both USB and the external supply connected?

For running in only one direction, does it run in one direction regardless of what direction you commanded, or does one direction work and the other direction just not run at all?

Been a while since I used pwm on arduino so I’m rusty.
I don’t think you should need a pulldown, I never have. My guess is something else is wrong.

Seems like a very small value (4) for being fully on?
Doesn’t that produce a pretty small pulse that is 4/256 (.015) of the cycle.
Fully on should be 256??

As @mcdanlj suggests I would put a DVM on that signal at full on, 1/2 on , 1/4 on and see what you get

I was wondering whether the driver board was missing a pulldown or something like that, remembering once having a case where I was controlling a FET and had forgotten to install the necessary pulldown (oops), and the floating voltage meant that I saw a similar symptom. Just grasping at straws here…

… Is a schematic available as to how you are wired up?

1 Like