Open PJordan2820 opened 3 years ago
- I wanted to use an Arduino Pro Micro, because I can use a USB-C port that way. Would this work?
For the MIDI-Controller code, yes.
The Motor-Controller is written for the ATmega328P specifically so it won't work on the Pro Micro without changes.
- I believe that there are some connections that are not explained since they come as obvious
Indeed, I only documented the connections specific to the Arduino code, for the non-Arduino specific connections, it's best to look at the typical application diagrams in the datasheet.
Am I missing something else that is not explained in the hardware section?
Bypass capacitors, maybe? See section 10 of the datasheet.
- Do I have to make my Arduino Uno or Nano Midi Class Compliant after I upload the code to them?
I'm not sure what you mean, the Uno and Nano do not support MIDI over USB, they only run the motor controller code. A second Arduino (e.g. Pro Micro) will run the MIDI code and communicates with the motor controller Arduino over I²C. You don't need to do anything beyond uploading the code to make the Pro Micro act as a MIDI USB device.
- Do I have to modify some of the code (comment lines, change values, etc.) to make the project work? Or should it work just uploading it as it is?
It should work as is, but you might want to change some settings in the Config
struct, e.g. enable the test reference to test the motor controller stand-alone:
Or change the pin assignments if you're using an Arduino Uno, or change the number of faders:
You'll also have to tune the PID controllers:
Use the Python script to do the tuning.
- I'm not really sure what to do with de Motor-Controller and MIDI-Controller sections though.
The Motor-Controller code should be uploaded to an Arduino Nano or Uno, and the MIDI-Controller code should be uploaded to a separate MIDI-capable microcontroller, (e.g. Pro Micro). Both microcontrollers should be connected to the same I²C bus so they can communicate the fader positions, target positions etc.
For tuning the controllers, you only need the Nano or Uno and connect it to the computer running the Python script over USB.
- Are the circuit and code basically the same?
The code is the same, but check the datasheet and Sparkfun hookup guide for the circuit. The connections to the Arduino should be similar, though.
- Is it a good idea to include a diode or transistor as protection? (just in case someone decides to plug a different power supply)
I usually don't, but that might not be a bad idea, that's up to you.
Nothing is really happening when I upload the code
The Motor-Controller code doesn't do much unless you send commands to it over I²C or Serial, or unless you enable the test_reference
option. Otherwise, it just uses zero as the target position, so it should turn on the motor when you move the fader away from zero, but it won't do much else. If it doesn't even turn on the motor, there might be something wrong with the wiring. Another reason could be that it constantly thinks that the fader knob is being touched, you might want to play with the RC time threshold. You can enable the print_controller_signals
and open the Serial Monitor of the Uno/Nano to debug, see if the position measurement of the fader works correctly, etc.
Great! Thank you for your response. I've uploaded the code to the Pro Micro and Uno boards, and connected the boards to each other.
I enabled print_controller_signals and values are changing when I touch and move the fader. But my computer isn't receiving MIDI messages from the Pro Micro. I feel that it has something to do with the communication over I²C.
I've attached a Tinkercad diagram based on my real circuit. (I've connected "A4" and "A5" (UNO) to "2" and "3" (Pro Micro, since those are the SDA and SCL ports in that board).
Now the Pro Micro is showing values in Serial Control, so I2C is working. But still, my computer isn't receiving MIDI messages. I don't have to do anything with something like Hariless MIDI, do I?
Also, how would I make the fader send MIDI CC 1? Through Sisex messages?
If you want to use MIDI over USB, you have to use a USBMIDI_Interface
:
https://github.com/tttapa/Control-Surface-Motor-Fader/blob/9b20111e7eb25f09a17da3a1a4eb6438c0d54247/MIDI-Controller/MIDI-Controller.ino#L14
Also, how would I make the fader send MIDI CC 1? Through Sisex messages?
What do you mean? How does your DAW communicate with motorized faders? Usually pitch bend is used, not CC or SysEx. You could of course change the MIDI-Controller sketch to send CC or SysEx messages instead, that's explained in the Control Surface documentation, but I don't think that would be useful.
Sorry for my late response... I found out what my problem was!
I just had to set up the Arduino as a Mackie Control device (I didn't get why the fader sent pitch bend messages until now) But I moved on just to find another problem. The response of the fader is rather clunky, and if I don't move it ridiculously slow, it starts moving up and down really fast. The only way to stop it is to move the fader in my DAW to +6db or -inf. Any position in between gives the same result.
Does it have something to do with calibration?
Found out what the problem was. Wrong bypass capacitor value. The fader is working correctly in Ableton Live 11. But I couldn't make it work in Pro Tools, a message appears saying that the DAW can't communicate with the HUI. And in Logic Pro, the fader won't reach its maximum travel when I move the fader inside the DAW, it is approximately 1cm short. Logic's MIDI monitor shows that the highest value in the output when the fader is at +6dB is 123, not 127.
Also. I'm not sure what to do with PWMA when working with the TB6612FNG. Should I just connect it to VCC? The fader gets stuck at the top if I do it that way.
a message appears saying that the DAW can't communicate with the HUI
The Mackie HUI is not the same as the MCU. Either way, it might send some SysEx messages to make sure it's connected to the right device. You can find the appropriate responses in e.g. the Logic Control user manual (for MCU), or look for reverse engineering documents of the HUI online.
Also. I'm not sure what to do with PWMA when working with the TB6612FNG. Should I just connect it to VCC?
Looking at the datasheet that would be the right thing to do, but I've never used it so I'm afraid I can't really comment on that.
Hello Pieter. I hope you are doing well!
I'm really new in the world of Arduino and programming. I want to connect 2 motorized faders with Logic Pro X and I've been investigating a lot on how to do it. I tried following the documentation in this repository, but I'm not sure how proceed. I have several questions and I hope that you could point me in the right direction.
Nothing is really happening when I upload the code,and I'm getting frustrated. I didn't expect motorized faders such a different project from non-motorized ones... There isn't that much documentation on the subject and I don't know where to keep digging.