Arduino DAW Controller Motorized Fader

Hello Community,
this is my first post here.

I am working on another Midi controller for my DAW, in my case Logic Pro X.
I would be happy to hear some ideas from you about my plan to build this thing.

So let me introduce you to my Project:

My plan is to build a Midi controller Like a Mixing console.
for the beginning about 8 Channelstrips with each Channelstrip having following Components:

  • 1 Motorized Fader
  • 3 Potentiometer
  • 1 Button
  • 2 LEDs

to measure and controll this thins I want to use one Arduino nano per Chanelstrip and I need one L298N H-Bridge to Controll the Motor of the fader since the one I have needs about 9V.

Reading out a poti is on of the basic lessons...
Controlling an LED too and since I only want it for Cliping signal, only needs On/Off.

Now the Fader: I found some good Tutorials on how to programm an Motorized fader and adoptetd these to an library with touchsense and and the function to slow the motor down over the H-Bridge via PWM as the fader gets Closer to its final Value.

So I have one channelstrip working on its own... no connection to a PC and only just one.
So now to the plans and ideas I have for the future:

To start of I want to connect the singel Channelstrip to the PC via an Midi to usb adapter or via serial and an little software tool.

After I got this working I have to find a way to connect several Channelstrips to the PC.
So my plan was to have one Arduino as an Master for an I2C Bus who gets the Values from all the other Arduinos and gives them to the PC.
My first approach will be, and I already have done some Latency tests, to let the Master get the values from the Slaves via an Request and let the slaves allways answer with all data in an array(about 6 to 8 Byte) since, at least in my mind, it is less effort to send out all data then to check what has changed and only send that, and i would have no idea how to send change the size of the I2C message at runtime.

Additionally to the frequent request fom the master there need to be a way for the master inform the slave if something from the PC has changed.

I have done it with an easy Wire.beginTransmission(x) and an onRecevie Function.

But there are still some concerns about all this:

First: I have heared, that it is not realy smooth working with an direct midi connection between DAW and arduino so many are using this mackie Protocoll (MCU or how its called). So thats still open for the PC Connection.

Second: Is the Classic I2C connection fast enought? I dont realy know how much Latency is ok. with two slaves I am between 2 to 5 ms for one master loop.

Third: will an Arduino Uno Or Nano be fast enough or do I have to take a Due or even another Micocontroller?

I hope I find some interested people for this Topic.

Feel free to ask or to tell me where I can do better or diffrent.

I will try to Organize all my Code pieces and throw them up here later.

SPI can be much faster than I2C -- just set the Nano's up in slave mode at the full 8MHz and make sure the
interconnect is short as poss.

Thanks for the fast Reply

Yeah I will definitely try that. But with SPI I have the limitation of the Arduinos pins since I need one per Slave.
I mean easier to extend the amounts of Digital pins on an Arduino with an Multiplexer or similar things, then the Analog ones.

Yeah I will definitely try that. But with SPI I have the limitation of the Arduinos pins since I need one per Slave.

No.
If you use an MCP23S17 then you can get 8 of these on an SPI bus with no extra pins used. Each chip will give you 16 I/O pins. If you want more then for each extra pin you use you can get another 8 devices. Or using n pins and a decoder chip you get 2n extra groups of 8 chips.

Now the Fader: I found some good Tutorials on how to programm an Motorized fader and adoptetd these to an library with touchsense and and the function to slow the motor down over the H-Bridge via PWM as the fader gets Closer to its final Value.

From what I understand... A motorized fader is usually a dual-potentiometer with one of the pots used for positional-feedback. So, you are essentially building a servo (with a control-input that's different from a normal servo). The feedback pot should be linear, and the audio pot will usually be audio-taper.

Of course, if it's just a controller (no analog audio) a single fader will do it.

PWM might work, but typically you slow-down a servo by "stepping" it. And of course you can make very small steps, but more steps is more MIDI data. (Presumably, the motor is geared-down so it can't move crazy-fast.)

First: I have heared, that it is not realy smooth working with an direct midi connection between DAW and arduino so many are using this mackie Protocoll (MCU or how its called). So thats still open for the PC Connection.

I'm not sure why that would be... The Arduino isn't powerful enough for digital signal processing, but I assume it's fast-enough for MIDI. MIDI basically works at "human speed".

Controlling an LED too and since I only want it for Cliping signal, only needs On/Off.

Where is the clipping signal coming from? Will Logic Pro give you that? ...Most DAWs work in floating-point so they don't clip "internally". ...You can clip your ADC (recording) or your DAC (recording/playback) and WAV files and CDs are also hard-limited to 0dBFS.

P.S.
I really LIKE the idea of a channel strips... A lot of people dive-in and try to make a huge controller all at once. It's a lot more manageable (and testable and debuggable) if you can modularize it.

From what I understand... A motorized fader is usually a dual-potentiometer with one of the pots used for positional-feedback. So, you are essentially building a servo (with a control-input that's different from a normal servo). The feedback pot should be linear, and the audio pot will usually be audio-taper.

In my case it is only for it is only one poti with a DC Motor and all I am doing is check the Value of the Poti and moving it to the value it sould by. while doing that I look at the difference of the actual position and the goal position and as the fader gets nearer to the goal pos I slow it down and so far it works quite good despide the fact that I have to use a tollerance of +/-5 and that on the 8-Bit ADCs with an 100mm fader...
The Fader I use a the moment ist this one:

https://www.alps.com/prod/info/E/HTML/Potentiometer/SlidePotentiometers/RSN1M/RSA0N11M9A0J.html

Where is the clipping signal coming from? Will Logic Pro give you that? ...Most DAWs work in floating-point so they don't clip "internally". ...You can clip your ADC (recording) or your DAC (recording/playback) and WAV files and CDs are also hard-limited to 0dBFS.

Yes I know but logic as well as Cubase have these litte red clipping marks on their Channelstrips and as far as I know they send it out via Midi.

P.S.
I really LIKE the idea of a channel strips... A lot of people dive-in and try to make a huge controller all at once. It's a lot more manageable (and testable and debuggable) if you can modularize it.

I am happy to hear that. The benefits I see with this is that if this overall plan works in an small format factor I can try to use more Channelstrips just by building some more of them and just change the master code a little bit. The problem that I see there is that the Uno or nano as master could be to slow
with the checking or you reach the I/O limitations but this could be solved with another master. but its just an idea.

Another idea to extend this Controller, if I will get it ready one day, is to make a Controll block with Start, Stop, Pause Buttons and an LCD with cursor possition so you replace this navigation bar in the daw.

The problem that I see there is that the Uno or nano as master could be to slow

No not too slow at all. Do not have a second master just use port extender chips like I told you about if you want more pins.

yeah thanks Mike,
I will definitely try but if you say this, I have no doubt that it doesn't work.
But this was just a thought for the Future. For now I try to get it work in a small form factor.

Yesterday I had some time and I started reorganizing my Fader Control.

But I wasn't happy with the way the fader slows down as it gets near to its goal, since sometime it will overshoot just a litte bit and I had a Toleranz of +/- 15 (0-255)so I tried to improve it and after some trying I had a better way to control the speed.

I use a Lab-bench Power Supply and tried to use 9V even if the datasheeds recommended Voltage is 10V. But I thought it would be easier to build with 9V specialy in the Audio area since so many effect Pedals use 9V Power supplies.
The Power Consumption I still have to measure.

My last attempt just had some if statements with which I broke down the possible distance in 4 speed areas.

Now I tried to use some Function to calculate the distance...
In my case I do it withe a Value range from 0 to 255. I know that Midi only uses 0 to 127 but I still can map it and with 255 I have the hope that I have a more precise control.

The function I wrote is following:

int mygetSpeed(int val)
{
  float speed = (-exp(-val/10)*200+255)+0.5;
  return speed;
  }

with this function I have an toleranz of +/- 5 when using 0-255 Values.

I still want to test if it makes any difference when I change this to 0-127.

But if Mike sees this I'm sure he has an answer for this. :wink: :smiley: (joke)

Basically wat you need to do is constant to look at the pot readings and calculate the distance and direction you need to go at. Then adjust the direction and PWM value. Now most of the time the direction will be the same but when you get overshoot it will spring back.

The fastest way for the pot to move is what we were taught to call “critical damping” but it seems that means something else these days. My old definition for the fastes way to move was to have one overshoot only. These days the term seems to refer to the case where you have no overshoot, which I was taught was called under damped.

I think you might be confusing damping factor and Q factor - critical damping has no overshoot and corresponds to a Q of 1/2.
A Q of 1.0 has slight overshoot, damping factor is 1/2Q so this is underdamped with a damping factor of 0.5

critical damping also corresponds to degenerate roots of the complementary function of the ODE, which
means the oscillatory part of the solution vanishes as the roots become real rather than complex.

There is no strictly fastest way to reach the target as all the solutions are exponentially decaying and never reach the target, mathematically speaking - you have to specify settling time in terms of a tolerance, but critical damping is usually taken to be fastest and the ideal behaviour in many situations.

Yes I agree that is what is taught now. But I have my University notes from 1969 and that is not what I was taught.

I guess one person's "critically" is anothers "slight overshoot"... Use the numbers and there's no confusion.