It is currently Fri Apr 26, 2024 12:07 am


DIY MIDI - first steps

Building organ consoles for use with Hauptwerk, adding MIDI to existing consoles, obtaining parts, ...
  • Author
  • Message
Offline

MikeB

Member

  • Posts: 13
  • Joined: Thu Jul 10, 2014 5:54 pm

Re: DIY MIDI - first steps

PostMon Jul 20, 2015 4:10 pm

Nick:I found an arrangement like this worked well for me.

Ah, I see what you mean, Nick. Neat trick if you've got space for the IDC connectors above the board, and you want to parallel together a load of lines across the boards.

I'm not running a standard matrix arrangement. Each 16way board has a pair of 8:1 analogue multiplexers, which are feeding a pair of analogue lines back to the motherboard. Originally, I was going to use 10way headers, so there wouldn't have been enough wires to parallel them all together (3 address, 5v, 0v, 8 analogue returns). So I decided on a star topology, where each board connects directly back to the motherboard. I later upgraded to 20way headers, but didn't change my overall topology. But thinking about it now, I could have daisy chained them together like you've done. But I think I might have struggled for space. My sensors are at the extreme rear of the manual, and the next manual up has solid wood just above the sensors. So I'm very tight for space above, but have plenty of space below (when I wire up the console, I'll do the IDC headers the other way round so the cable exits directly downwards - there's no point in prototypes if you don't learn from them :wink: ).

wave.jaco: I am very interested in some more details thereof if you would not mind sharing

Sounds like you're on a similar mission ? Do you have any particular aspects in mind ? The circuit diagram of the sensor board is pretty straightforward, as is the motherboard (which is primarily connecting the various sensor boards to the TIVA microcontroller). Happy to share these when I get a spare moment ( :? ). The real work happens in the TIVA software - that's very much a work in progress at the moment, so not really in a shareable state at the moment, I'm afraid. But maybe in the future ...

Mike.
Offline
User avatar

NickNelson

Member

  • Posts: 880
  • Joined: Tue Dec 20, 2005 10:31 am
  • Location: Yorkshire, UK

Re: DIY MIDI - first steps

PostMon Jul 20, 2015 4:11 pm

organtechnology wrote:It seems that Kingbright no longer makes that type of device. You have some idea of a modern equivalent?


Hi Thomas,

I didn't know that Kingbright have stopped making these. The nearest alternative I have found so far is the LTR-5986D. It looks to be sufficiently equivalent electrically (but not mechanically). I haven't tried these as yet, nor do I know what would be the matched IR emitter. If you want some of the L-610MP4BT/BD and KM-4457F3C devices, my UK supplier has a thousand or so available (http://www.rapidonline.com/Electronic-Components/Kingbright-L-610MP4BT-BD-Phototransistor-72-8968). I have a few (hundred) in stock, PM me you would like me to send some.

Nick
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostThu Jul 23, 2015 2:43 am

NickNelson wrote:...It's slightly easier to chain multiple boards if the ribbon cable runs parallel to the long axis of the boards. Also, it's useful if cutting off the unnecessary sensor positions for the board at the treble end is easy...


Hi Nick. How do you cut the last PCB on the upper treble side to length? Do you make provision for that in the PCB design, like eg. having holes / perforation of some sorts drilled? Or do you just cut them to length with a saw blade?
Offline
User avatar

NickNelson

Member

  • Posts: 880
  • Joined: Tue Dec 20, 2005 10:31 am
  • Location: Yorkshire, UK

Re: DIY MIDI - first steps

PostThu Jul 23, 2015 3:44 am

wave.jaco wrote:Hi Nick. How do you cut the last PCB on the upper treble side to length? Do you make provision for that in the PCB design, like eg. having holes / perforation of some sorts drilled? Or do you just cut them to length with a saw blade?


I have a band saw which makes it rather easy. Cutting by hand using a hacksaw, and filing to the line would work just as well.

Nick
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostThu Jul 23, 2015 6:33 am

NickNelson wrote:I have a band saw which makes it rather easy. Cutting by hand using a hacksaw, and filing to the line would work just as well.


Aha, that makes it rather easy. I have thought about some more industrial methods such as V-scoring, but quickly realised that it will be a bit of a hassle due to the V-scoring that will sever the PCB traces. You would then have to physically connect the scored parts of the board that should remain to each other, which is actually also possible, but unnecessarily tedious.
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostWed Aug 05, 2015 4:28 pm

I have been pondering about the idea of using Hall-effect switches for keyboard scanning and MIDIfying for a while now. I am currently struggling a bit to understand how one would do the actual scanning of the matrix with Hall-effect sensor inputs to the matrix.

In particular, I am investigating the power supply to each row (which is sequentially provided to the rows with the use of shift registers). Since the scanning matrix only scans the columns for one specific active row at a time, it can be concluded that the Hall-effect switches cannot just be all provided constant power - there will be no way of knowing which rows are corresponding to the columns being scanned. One possibility that I considered is that each of the rows act as the power supply to the Hall-effect sensors tied to that row (i.e. the Vcc-pin of the Hall-effect switch is connected to the shift register output, similar to how you would do it with reed switches). I have tried a basic test with this method using an Arduino and just toggling a digital output port at a rate of about 500 Hz. Since the Hall-effect switch has an open collector configuration (I am using the Allegro A3144 Hall-effect switch), the output will be active low. I prefer active high outputs, so I connected each switch output to a logic inverter (74HC04N) so that I get a logic High for every switch of the Hall-effect sensor. It works perfectly if I just provide a stable and constant power supply to Hall-effect switch. However, it seems to not work very well when I connect the Vcc-pin of the Hall-effect switch to the shift register output - instead of a clean 0 to 0.2 Volts output on the inverter when the Hall-effect switch is still open (with a constant 5 V power supply to the switch), it fluctuates quite a lot around 0.3 up to 2.4 Volts (I checked this on my multimeter, so unfortunately I do not have info on what the output does exactly). The logic inverter output tends to eventually settle at around 2.4 V when the Hall-effect switch is still open, after which it occasionally fluctuates a bit and eventually settles again at 2.4 V. Therefore I do not consider this a stable output to use in a scanning matrix.

So what I would like to find out is how you would do the scanning of the matrix when using Hall-effect sensors. Could someone please explain to me how this is done?
Offline
User avatar

NickNelson

Member

  • Posts: 880
  • Joined: Tue Dec 20, 2005 10:31 am
  • Location: Yorkshire, UK

Re: DIY MIDI - first steps

PostThu Aug 06, 2015 1:00 am

wave.jaco wrote:I have been pondering about the idea of using Hall-effect switches for keyboard scanning and MIDIfying for a while now. I am currently struggling a bit to understand how one would do the actual scanning of the matrix with Hall-effect sensor inputs to the matrix.


I explained one way here: http://forum.hauptwerk.com/viewtopic.php?f=15&t=13824&p=102515#p102494

One possible issue with Hall sensors is the power up time. The A3144 devices seem to be fast enough, but I have looked at the specifications of others that take several mS to stabilize. If you need to invert signals, the more elegant (but power hungry) approach would be to keep the Hall sensors permanently powered and use octal inverting line drivers to select which bank is being sampled. Don't try switching these on and off altogether from the matrix; instead use the signals from the matrix to control the output enable of the drivers. For a non inverting buffer something like the 74VHC541 would do. I'm sure there is an inverting equivalent.

I don't think there is any way that a shift register output on its own could source enough current to drive 8 Hall sensors (about 40mA + the collector currents of any sensors that are 'on').

Nick
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostThu Aug 06, 2015 2:20 am

NickNelson wrote:I explained one way here: http://forum.hauptwerk.com/viewtopic.php?f=15&t=13824&p=102515#p102494

One possible issue with Hall sensors is the power up time. The A3144 devices seem to be fast enough, but I have looked at the specifications of others that take several mS to stabilize. If you need to invert signals, the more elegant (but power hungry) approach would be to keep the Hall sensors permanently powered and use octal inverting line drivers to select which bank is being sampled. Don't try switching these on and off altogether from the matrix; instead use the signals from the matrix to control the output enable of the drivers. For a non inverting buffer something like the 74VHC541 would do. I'm sure there is an inverting equivalent.

I don't think there is any way that a shift register output on its own could source enough current to drive 8 Hall sensors (about 40mA + the collector currents of any sensors that are 'on').

Nick


Hi Nick. Thanks for that link. I am very sure that it is the power up time that is the issue here. It feels a bit "wrong" to switch the Hall-effect sensor's power supply at a high rate.

I never thought of the octal line drivers! :shock: However, just after posting my previous post, I was actually busy working on a discrete solution that did exactly what the line driver does! :lol: My solution was to connect each output of the inverters to the source of an NMOS transistor. The drain of the transistor would then be connected to the column line of the matrix for that particular sensor and the gate would be connected to the shift register output (which is the row of the matrix in this case). When the shift register enables the row, the transistor is switched on and its output is then connected to the column line. Now that I look at the octal line driver, it does exactly the same! I can just use an octal line driver for each column in the 8x8 matrix.

The MC74HC540A is the inverting equivalent to the non-inverting octal line driver. I think it is a better choice in my case, since I can then leave out the discrete NMOS transistors and the logic inverters and just use the shift register outputs to control the OE lines of the octal line drivers (although it would be an active low control signal instead of active high, if I completely leave out the logic inverters).

When using the Hall-effect sensors, it seems that it is inevitable that they will be permanently powered, so it is a rather power-hungry method indeed. The datasheet for the A3144 indicates that at 5 V supply voltage, the highest input current is around 6 mA (depending on the applied magnetic field strength). If you do the calculation, 61 Hall-effect sensors would then require a current of 0.366 mA, which totals to (0.366 mA) * (5 V) = 1.83 W of power dissipation for only keeping the sensors happy! Then there is also the power dissipated by the octal line drivers, which could be 8 column-lines at the worst-case (for those with long enough fingers to play such a big augmented fifth chord :D ).

When considering power usage, how much influence does this really have on the system? Sure, if you used reed switches instead of the Hall-effect switches, that would be about 2 W less power used for each scanning matrix. However, for a complete MIDIfying system that extra 2 W power used should be well within the capability of a "standard" DC power supply. So maybe the power-hungriness of the matrix configuration shouldn't be so much of an concern...?
Offline
User avatar

NickNelson

Member

  • Posts: 880
  • Joined: Tue Dec 20, 2005 10:31 am
  • Location: Yorkshire, UK

Re: DIY MIDI - first steps

PostThu Aug 06, 2015 10:00 am

wave.jaco wrote:I am very sure that it is the power up time that is the issue here. It feels a bit "wrong" to switch the Hall-effect sensor's power supply at a high rate.


This set me thinking, so I went back to look at the work I did in the spring with the 3144 devices. Here are the results, the yellow trace is the switched 5V supply, the blue is the output at the emitter-resistor common point:

Image
With a 1k resistor and the magnet beyond the switching point the output is readable about 1uS after the device is powered up.

Image
With a 1k resistor and the magnet beyond the switching point the output is readable about 1uS after the power is removed.

Image
With a 1k resistor and the magnet within the switching point there is a small glitch but the output is readable about 500nS after the power is applied.

Image
With a 1k resistor and the magnet within the switching point the output is readable immediately after the power is removed.

The problems arise when the emitter resistor has a high value. Due to (I think) the output transistor's junction capacitance the response is stretched significantly (and in proportion to the increase in resistance).

Here are the equivalent traces using a 22k resistance. You can see that it would be necessary to wait 6 uS or more (depending on the thresholds for '0' and'1') before reading the devices.

Image

Image

Image

Image

I am currently working on characterising these devices in terms of the switching points for various sizes of magnet, the effect of mounting the magnets on the end of a steel adjusting screw (this is looking to be quite significant) and the interfering effects (if any) of adjacent magnets. Also the variation in sensitivity between individual devices (the 3144 isn't particularly tightly specified for this - hence the interest in adjusting screws).

Results to follow - but not in the next few days I'm afraid.

Nick
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostThu Aug 06, 2015 4:09 pm

Thanks for the very informative post, Nick.

That surely is very interesting - especially the effect that the higher resistance value has on the response. It has the tell-tale sign of some R-C time constant. Perhaps some intrinsic capacitance on the internal transistor within the Hall-effect switch?

However, even 6 us is still a rather short time considering the rate at which it is truly necessary to scan all the keys in a matrix setup. So one should be able to drive the Hall-effect sensors' power supply pins rapidly with the shift registers (and also transistors to supply ample current) and read the outputs reliably. I would, however, be very interested in seeing what the output of the Hall-effect switch is if you pulse its power supply very rapidly (eg. with a shift register or toggling digital I/O pin on a microcontroller with a transistor). My Hall-effect sensor was not very happy when I did that...

Looking forward to those results!
Offline
User avatar

NickNelson

Member

  • Posts: 880
  • Joined: Tue Dec 20, 2005 10:31 am
  • Location: Yorkshire, UK

Re: DIY MIDI - first steps

PostFri Aug 07, 2015 3:03 am

wave.jaco wrote:However, even 6 us is still a rather short time considering the rate at which it is truly necessary to scan all the keys in a matrix setup.


Yes, I tried one this morning with a 47k emitter resistor (pretty much the worst case for an Atmel microcontroller) and the time delay would need to be 25uS to be on the safe side. This would still mean that you could scan a full keyboard and a couple of banks of pistons in 250uS which is fast. Much faster than than you could scan a conventional diode matrix using switches (eg reed switches) where the contact bounce of around 2mS neets to be accommodated.

In principle I suppose, one could scan an entire 3m+p console with one microcontroller in a millisecond using multiplexing or your idea (which I like) of using shift registers to select the various banks of eight in sequence.

Nick
Offline

wave.jaco

Member

  • Posts: 16
  • Joined: Mon Jul 06, 2015 6:54 am
  • Location: South Africa

Re: DIY MIDI - first steps

PostFri Aug 07, 2015 4:00 am

NickNelson wrote:Yes, I tried one this morning with a 47k emitter resistor (pretty much the worst case for an Atmel microcontroller) and the time delay would need to be 25uS to be on the safe side. This would still mean that you could scan a full keyboard and a couple of banks of pistons in 250uS which is fast. Much faster than than you could scan a conventional diode matrix using switches (eg reed switches) where the contact bounce of around 2mS neets to be accommodated.

In principle I suppose, one could scan an entire 3m+p console with one microcontroller in a millisecond using multiplexing or your idea (which I like) of using shift registers to select the various banks of eight in sequence.

Nick


If I can get my hands on a digital oscilloscope then I would check what happens with my sensor and why it was not very happy that I pulsed its power supply. I was using a 10k pull-up resistor for the output pin on the sensor, so it should not have had such a great time delay. Maybe my breadboard was just cursed or bewitched :lol: Will give it a second shot anyway.

However, I just feel more comfortable with the octal line drivers. It feels like better design practice to switch the outputs with the line drivers instead of switching the power supplies to the sensors, although both should work equally well for all practical purposes. Plus that would save you some transistors as well.
Previous

Return to DIY organ consoles / MIDI

Who is online

Users browsing this forum: No registered users and 5 guests