Code Monkey home page Code Monkey logo

control-surface-motor-fader's People

Contributors

tttapa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

control-surface-motor-fader's Issues

PID controller pre-calculated Ki_Ts not possible ?

Hi Pieter,

first, thanks for your great article and deep introduction to this topic.

However, I cannot quite follow you in one point, in the provided Implementation for the PID controller you are using Ki already multiplied by Ts.

For the integral, you provided the following expression:
$$e_i[k] = e_i[k-1] +T_s e[k-1] $$

In the code, the integral is computed as
int32_t newIntegral = integral + error
and then added to the PID algorithm as

bool backward = false;
int32_t calcIntegral = backward ? newIntegral : integral; // will always evaluate to integral

int_32_t output = kp* error + ki_ts * integral,
integral = newIntegral;

I don't understand how this implementation corresponds to the mathematical expression.

From my point of view, it should be implemented as follows

int32_t newIntegral = integral + error * Ts

int_32_t output = kp* error + ki * integral,
integral = newIntegral;

Maybe I'm overlooking something, could someone help me out here ?

Use on Arduino Uno

Hello,

I'm not able to compile the .cpp at Arduino development. Can you please make it easy for me, and upload the src directly for Arduino? Or instructions, what is to do.

Thank you.

Michael

Using a TB6612FNG

Hello Pieter,
I have tried implementing very basic controls for a motorized fader myself. I can't get it to stop on point like your video shows. I then saw your website, and wanted to try your library, as it looks really thought out. I already have a Sparkfun TB6612FNG (https://www.sparkfun.com/products/14451) and you mentioned the TB6612FNG (I know you meant the chip, and I can't read datasheets, but I guess it would still have more connections than a L293D) in your hardware documentation. I have one small problem though:
According to the schematic PJordan2820 made in #6, the L293D only has two serial connections to the Arduino. The TB6612FNG I am working with has 4 (AIN1, AIN2, PWMA and Standby). How would I connect that to the Arduino to make it work with your library?
Thanks for taking the time to answer (or at least reading the question)

How to connect lines?

I am a novice and try to make this project for the first time. I have read your document, but I didn't understand your wiring method. Can you give me a physical connection diagram or something like that?

I am not a native English speaker, please ignore my grammatical mistakes

thank you!

Multi controller example

Hi,

Thank you for this awesome work that you've done. I was wondering if you have already written best practices and/or a guide on how to implement/connect multiple modules of 4 faders to control faders configuration of 8, 12, 16, etc for example?

Sometimes a fader goes crazy, after hours working

Hi Pieter,
After many months working I finally can say my motorized faders are working ok, almost perfect... but I detected this issue when I was working in a musical production, mixing with cubase after 3 o 4 hours using my control surface with motorized faders... suddenly one of the faders goes crazy, it goes to the lower position and no matter what I do, the fader stay there. I move the virtual fader in the DAW and nothing happens, I move the real fader and the motor stops when is touched, so I can move it, but after release it, the fader goes again to the zero position. And the most worrying thing, is that the motor fader doesn´t stop when it is in the lower position, then it starts to heat up... very hot... So I am afraid that one day I will forget to turn it off, and this problem will occur with the consequence that the case may burn or a worse accident...

Time before I had similar problems whith all the faders, and with just after 20 minutes working... and I fix it making a pcb and connecting all the controllers (arduino pro mini) near between them... I think it was a I2C problem, because before the cables were too long... So I assume I fix almost everything about the I2C communication problem, but anyway in some moments the problem persist...

Do you have some suggestion?

The Control surface has 9 faders (8 channels and master), and 4 arduino pro-mini (3 for motor control, and master for midi interface). I use it 4.7k pull-up resistors for SDA and SCL lines. Do you think that value is ok?

Thanks!

Stuttering with L298N H-Bridge

Hey, first of all, thanks for making this amazing project open source!!! ❤️

I got the whole thing set up (single fader, test_reference, serialMIDI etc) and it somewhat works.
For touch, I had to use a 1MΩ resistor, everything else was to jittery (even with threshold adjustments).
I'm using an Arduino Nano clone with USB-C, but that shouldn't really matter.

Here's the problem though:
I'm using an L298N instead of the L293D H-Bridge and the motor movements are not smooth at all.

PIDs seem fine, it's not overshooting or anything, but it makes a rather low frequency stuttering sound and the movements are jerky.
I suspect, the L298N doesn't really like pwm on the IN1 and IN2 pins???
I drove the fader with some custom code before and it was smooth, but I used 3 pins, with one dedicated to PWM.

Since the timers for PWM seem pretty complicated to me, I'd rather have my suspicions confirmed/refuted before trying to modify any core code.

Any idea what might be happening there?

Problems using 8 motorized faders and Midi Interface

Hi Pieter! I hope you are fine...
First of all, I should say that I'm pretty new in this things, and since many days I'm trying to understand your code for motorized faders. At this point I think I learnt a lot, but there is still a huge part of your code that is too much complex for my understanding. So, please forgive me if my questions are too basic.

I was trying to run 8 motorized faders using two arduinos pro mini for the fader controller, and a mega 2560 pro (the small version of arduino mega) for the midi controller.

I took your sketch "MIDI-Controller.ino" and I modified a bit to run this 8 faders through this two slaves. I choosed the HardwareSerialMIDI_Interface for this project.
Everything was fine, the eight faders were running very good, untill I disconnected the usb from the mega... I don't know why, but when I did this appears that the master doesn`t send anything to the slaves... I am using the rx0 and tx0 pin for the midi circuit, and an external power supply.

Another sintom is that if I disconnect the second slave, I can disconnect the usb from mega without any problem, but obviously just with 4 faders.

Any suggestion about where is the problem?

Use library without touch sensitive motor faders

Hi,
first of all: It is a fantastic library and I am very happy that I found it.
One question regarding the library: Is it possible to use this library without touch sensitive motor faders?
My existing ALPS faders do not have such an "Touch" pin.

Do you have any tipps for me how to proceed? Or would you suggest that I should buy new faders.
(However, I have already 16 faders, therefor I do not really like to throw them away....)

Thanks in advance!
Best regards
Fabian

Midi Controller and Motor Fader Controller on Teensy 4.1

I'm impressed with the library you wrote. I was thinking of using the libraries for a long time wanted midi controller live mixer. I have already the QSC Touch 30. So not really a need for it ;-)). But just to have a hobby I was thinking about building one myself.

I was thinking of a modular system whereby the banks are 8 channels and upto 8 banks. As the Teensy 4.1 is 600 MHz. Do you think it is possible to use only the Teensy 4.1 ?

At start, at I2C control mode, the fader goes to zero, but the motor don't stop

Hello Peter,

at first, I'm very happy about your program. The fader moves very fast and precise. This is really great!!!
I see, your C++ is much better as my own C++ programing know how. I'm not so fit in object-oriented programming.

About the issue:
I put the controller_to_print on, that I can see, what's happen. At the moment, I use only one motor fader.
If I start the NANO, the fader moves down. He try to catch the setpoint 0. But he came only to adcval 3 or 7. So the motor try's to move the fader more. If I touch the the sensor, the motor stops. And the adcval is 0.
For me, it's looks, that he do not measure the correct analog value.

Have you an idea? and a solution?

An additional suggestion:
After start, the fader moves up and down, and find the min and max value of each fader. So all will be calibrate. Over the map function, can be expand, to the 10 bit or 12 bit value.

Motorized fader guidance

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.

  1. I wanted to use an Arduino Pro Micro, because I can use a USB-C port that way. Would this work? (I also got an Arduino Uno and an Arduino Nano)
  2. I followed the instructions in the hardware section, connecting the recommended capacitors, pullup resistors, and motor driver as indicated... I believe that there are some connections that are not explained since they come as obvious (L293D to ground, the motor terminals to Y1 and Y2, external power supply to VCC2). Am I missing something else that is not explained in the hardware section?
  3. Do I have to make my Arduino Uno or Nano Midi Class Compliant after I upload the code to them?
  4. Since I'm a beginner in programming, most of the code is really hard to understand for my level. (I'm trying to learn as much as I can). 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?
  5. I understand that the contents of the repository are: Motor-Controller, MIDI-Controller and a Python Script that allows communication over Serial to change the response of the faders. I'm not really sure what to do with de Motor-Controller and MIDI-Controller sections though. The motor controller section is conformed by 10 files. What I'm currently doing is opening "main.cpp" and uploading it to my board, making sure that the rest of the files remain in the same folder. I did the same with the "MIDI-Controller.ino" file, but I'm guessing that I have to include it in the Motor-Controller folder instead.
  6. I also got a TB6612FNG. Are the circuit and code basically the same?
  7. Is it a good idea to include a diode or transistor as protection? (just in case someone decides to plug a different power supply)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.