Open RoboDoig opened 1 month ago
@filcarv here are some example flow sensor values from the rig as requested.
Expanding on the algorithm in more detail here:
Required registers (can be renamed):
float
to able to express decimal values, e.g. if we want to reduce motor speed)boolean
specifying whether direct control algorithm is utilised vs. controlling from Bonsai)float
specifying deadband for conversion from speed delta to motor immediate pulses, currently 0.000001)float
specifying maximum pulse interval value, currently 0.02)float
specifying minimum pulse interval value, currently 0.000025) Algorithm (if ENABLE_DIRECT_CONTROL): On H1:
if (abs(value) < ZERO_THRESHOLD):
return 0.0
else:
var pulseInterval = 1.0/value;
var clamp = max(min(pulseInterval, MAX_PULSE_INTERVAL), -MAX_PULSE_INTERVAL));
if (abs(clamp) < MIN_PULSE_INTERVAL):
clamp = MIN_PULSE_INTERVAL;
return clamp * 1000000;
Now that the motor control is implemented in Bonsai, we should add the option to implement the motion control algorithm via direct communication from H1 --> H2.
This basic algorithm is as follows: 1) Register to select signal source (flow sensor 1/2 X/Y) 2) Register to set gain on signal source 3) Sent via tx/rx to H2 4) H2 convert to immediate pulses and drive motor 5) Register/option to disable direct control