to drive electro magnetic actuators with some velocity sensitivity i am thinking about
-instead of using 4 expensive Aout modules with the need of bipolar power:
mapping midi note on and velocity to 3 or 4 dio pins with a resistor ladder to get 8 or 16 voltage levels. I would tune the resistors to get a custom curve because solenoids need a minimum impulse to get moving (initial lowest level around 50%, then linear to 100% from there).
Is this a reasonable idea?
What Midibox App is a good starting point? Can this be done with MidiboxNG? From reading through the Manual i assume yes, but is it reasonable and fast enough for 24 3 or 4 bit outs?
(Midifying a 2 octave Glockenspiel)
Or should i start from scratch with a new mios32 app? I know a little C and i have worked through most of the tutorials… but not much more. The documentation is superb, but still i feel a little lost…
My solution is sure to have a lot of if statements, propably hard coding every velocity of every note value by hand…
Or is it necessary to program a driver for a new “Midibox Aout_4Bit” module? (<- would be the thing i feel least confident about, no idea where to start…)
As an alternative i tried using the pwm signal from dimmed LEDs in MidiboxNG, but that did not work very well bacause the pwm frequency is rather low (around 4 pulses in 10ms), to slow for very short trigger impulses.
I am really excited to getting started with 32 bit Midibox - my last build was the MB Sid, quite some years ago
Thanks! Since i need two octaves the resistor ladder cv-lc will not get me far. Using three Midibox_CV_NG would do the trick, but i consider this really overkill since i am pretty sure that i will not get more than 8, maybe 16 different amplitude levels with the solenoids and Glockenspiel. So 3 or 4 bit resolution should be ideal.
I have since been looking once more into the dout example in the mios32 programming section.
The code to adress 4 dout pins for every note to get 16 voltage levels should be very straight forward.
I am sure to get something running over the weekend. I will see if there are any general design problems with this idea.
that was easier to code than i thought. I really enjoyed learning about this.
I dont have my scope, my douts or any leds here, so i added some code to print the output pattern to the lcd.
I noticed that if i put the clear_lcd command outside any of the function blocks, i get an error during compilation. No sure how this should be done. I found a workaround though…
now i have to look into timers to get some way of resetting my pins after some ms. Solenoids don´t like to be “on” for long, and the glockenspiel needs only a short percussive hit.
If anyone is interested, this sort of works, turning off the pins/updating the lcd after a specified time. It works as in the J5 debounce tutorial 006_rtos_task.
Thanks for all the great tutorials, they really provide a good starting point for people like me!