Hello everyone!
As Miniscope V4 outputs head orientation signal, it is possible to use it to make a cheap active commutator that does its job reasonably well. Here is how I made it:
The basic construction is very simple: passive slip-ring commutator (smth
like this) + stepper motor connected with a rubber band, everything is attached to the metal bar.
To control the stepper I used EZHR17EN driver (and Labview software is written for this driver). USB commands are first converted to UART commands via USB-UART converter before reaching the driver.
The idea of the code is that stepper turns with the fixed speed (that can be changed on the panel) to the angle equal to the difference between two consecutive sampled yaw angles.
Besides extracting just head orientation signal, I implemented the very basic image capture of the miniscope image and the control of its parameters (LED, gain, etc.). This can be used as the base platform for creating setups with more or less complex control loops, e.g. using head orientation signal to control something else besides commutator.
The interface looks like this:
Code is located here:
Hope someone finds it helpful.
Roman