controlling individually 40 output

Hi,

I am doing research in neuroscience. Recently I have developed with a colleague a novel methodology to look at sleep and arousal in fruit fly. Basically we not only look at immobility duration - as it has been done over the last decade by the field - but also responsiveness to mechanical stimulations. We hope to accomplish a paradigm shift with our new methodology.

Our methodology has been published (How deeply does your mutant sleep? Probing arousal to better understand sleep defects in Drosophila | Scientific Reports) and we created a dedicated website explaining how it works (http://web.qbi.uq.edu.au/dart/).

Technically what we do is controlling with our software 2 motors with a DAC device, the USB-1208-LS from Measurement Computer. However what I would like to do is to independently control more motors (in my dreams, 40! So technically 40 outputs) so I can individually wake up flies.

However, I haven't found any Digital to Analog converter that would allow me so much freedom. I hope this is the correct topic.

Thanks a lot for your reply

Ben

one DAC output per motor.

you can get multiple channel DAC so one chip can control a couple motors.

the beauty of an arduino is that you could create an 8 channel unit for example, then just make 5 duplicate units for 40 channels.

you did not offer if you needed 10 bit or 16 bit resolution
and what DAC you are currently using so it is impossible to offer a solution, only ideas.

if you want to control more from one Ardino, you can connect them with one of the available serial busses, depending on your chip selection and speed of response needs.

First look up motor control in the learning zone. You do not use a DAC to control a motor as it is just not needed - see PWM. After that just about any Adruino can be used. But to keep things very simple use a Mega. But get rid of the DAC!

Mark

Seems the unit used now has 10-bit PWM outputs.

page 19
A PCA9685 breakout board from Adafruit does 16 channels of 12-bit PWM.

And you can chain multiple boards (upto 960 motors).
There is no info in OP's links about motor size, drivers, etc.
Leo..

These motors, right?
https://catalog.precisionmicrodrives.com/order-parts/product/312-101-12mm-vibration-motor-3mm-type

They seem to have a nice linear response to voltage, but using a 10bit DAC to drive them does seem a bit ... overkill.

Thanks for all your comments, I will try to answer as best as I can. I am only a biologist and have only very little knowledge for all technical comments.

1- to "westfw":
yes you are correct. These are the motors we use. However, I can normally plug whatever I want: motors for mechanical stimuli, a magnet to create a climbing assay, something that rotates in order to only rotate the tube (and put the flies upside down to wake them up), or lights for visual stimuli or doing precise optogenetic, speakers etc...
Concerning the "10bit DAC to drive them" I don't really know what to say. In our program we can modify some parameters such as the sample rate or the maximum intensity delivered to the motors.

2- to "dave-in-nj":

  • One DAC output per motor => do you mean using 40 DAC?
  • you can get multiple channel DAC so one chip can control a couple motors => Technically we have run some test with several DAC device (up to 6), but we lose some efficiency and it ends up being expensive. That's why I would like to have 1 DAC or whatever that could (PCA9685, Mage busse and PWM) control precisely and independently several output
  • the beauty of an arduino is that you could create an 8 channel unit for example, then just make 5 duplicate units for 40 channels => Could you direct me to this unit?
  • you did not offer if you needed 10 bit or 16 bit resolution and what DAC you are currently using so it is impossible to offer a solution, only ideas => As stated I am using the USB-1208-LS from Measurement Computer. But I don't know if I need 10 or 16 bit resolution.
  • if you want to control more from one Ardino, you can connect them with one of the available serial busses, depending on your chip selection and speed of response needs => which busse?

3- to"holmes4":
I would like to get rid off the DAC too. It's expensive for what it seems to simply do. However I have no idea of what a PWM could be but it seems pretty fast. If using PWM can I control motors or light at the level or millisecond? That would be incredible as I can accurately reproduce brain signal activity.
If I get it correctly, I can connect the mega busse to the computer get it recognised by our program, and them connect several PWM to the Mega busse, right?

4- to "Wawa":
Does PCA9685 simply replace the DAC?

Thanks a lot for your comments. Impatient to hearing your answers

Ben

seems you are on a steep learning curve.

as you know we perceive in analog, a rotating bicycle wheel moves in analog.
an electric motor on the other hand moves in pulses, or digital.

your part, the *USB-1208-LS *seems to be an analog INPUT device so you can read and input.and has multiple INPUT channels and 2 OUTPUT channels.

putting your project aside for a moment

a DAC is a digital input, Analog output circuit, device or chip. digital to analog.

if you want to light an light bulb, you can use a microcontroller like the Arduino send out pulses.
imagine that if over the course of 1 second, you sent out 1,000 pulses. the pulses where high half of that second.
if you were controlling a lamp, then the lamp would be lit for half of the time. it would appear to be half bright.
it would get the full power, in pulses, but only half the time. the pulses would be so fast you would not perceive that the light was off half the time.

this is digital. we can control the PULSE, and if we always use 1,000 pulses per second, and we have each pulse ON for half the time and OFF for half the time, then the average would be 50%

If we control the width of that pulse and make the pulses ON for 3/4 of the time, then the apparent output would be be 3/4

Compare that to taking the same lamp and just giving it half the voltage. It would appear to be half bright.
give it 3/4 voltage then it would appear to be 3/4 bright.

======================

to get those pulses the Arduino has that built it. called PWM or pulse width modulation. the number of pulses are fixed, we just modulate how wide they are.

to get that half voltage, you need lots of circuitry or special chips. that is a Digital to Analog Converter.

=================================

lots and lots of things can work with PWM.
some things require analog.

in our world , PWM is preferred, and easy to do, built in, free if you will.

DAC is specialized, requires more stuff and expensive.

==============================

this was a very casual explanation, lights are not exactly half bright at exactly half voltage or 50% pulses....
sometimes being casual makes it easier to understand the general concept.

as for your project, it may be super simple to use PWM.
if you have an output for a motor, we can tune that PWM to that motor, but it might not work for a light or a different type of motor, it may need to be re-tuned, or just incompatible.

the great thing is that lots of motors can take either PWM or variable voltage and work exactly the same.

To dave-in-nj

Thanks a lot for the detailed answer. Our software, DART, has been written with Matlab and after a little quick search it appears that the Arduino circuit board can be supported by Matlab:

Therefore, in theory, it should be able to be supported by Matlab and hence DART. Currently, the program only detects Measurement Computing and National Instrument devices which is why we use the USB-1280 LS from MC, but could be readily expanded to incorporate Arduino devices (when the main programer will be back from his around the world trip).

That say, we can potentially control the PWM. So here is my next question: do I need something "between" the PWM and the computer? How many output can I control with 1 PWM (I am sure it depends on the model)?

Thanks again

PS: can I have millisecond temporal control?

bennko:
PS: can I have millisecond temporal control?

I hope that one of the guru's on here can tell you how to slow the arduino down enough to get 1 millisecond control.

IIRC, there are 1,000 microseconds in 1 millisecond.

we usually use millisecond timing for LED's and such.

As mentioned before. Adafruit has a $15 PCA9685 breakout board that connects to any Arduino via a 2-wire interface.
If you can build/solder 16 mosfets, 16 resistors, 16 diodes, and 16 screw terminals on a piece of veroboard.
And supply the motors e.g. with a 3.3volt Pololu buck converter.
Then you have 16x 3-volt motor controllers with 12-bit speed resolution.
Default PWM frequency of that chip is 200hz, but it can be set with one command to anything upto 1khz.
The Arduino only gives commands to the chip, and is then free to do other things.
Three of those Adafruit boards plus mosfet boards can control 48 motors. Many more if needed.
Leo..