Running motor loop in parallel with data acquisition
Posted: Thu Jul 19, 2018 9:56 pm
I want to move my stepper in a reciprocating motion (45 degrees to -45 degrees)
While simultaneously measuring data through a DAQ.
I have my DAQ sampling frequency set to 600[hz]
Currently I'm running the stepper in a loop something like this
motor.setTargetPosition(45)
while motor.getismoving():
acquireData()
time.wait(1)
motor.setTargetPosition(-45)
while motor.getismoving():
acquireData()
time.wait(1)
My data looks like it's being sampled at 50[Hz]. Is this because the motor phidget is checking if it's currently moving at 50[Hz]?
Is there a way to easily loop my stepper for 100000 cycles while acquiring data?
While simultaneously measuring data through a DAQ.
I have my DAQ sampling frequency set to 600[hz]
Currently I'm running the stepper in a loop something like this
motor.setTargetPosition(45)
while motor.getismoving():
acquireData()
time.wait(1)
motor.setTargetPosition(-45)
while motor.getismoving():
acquireData()
time.wait(1)
My data looks like it's being sampled at 50[Hz]. Is this because the motor phidget is checking if it's currently moving at 50[Hz]?
Is there a way to easily loop my stepper for 100000 cycles while acquiring data?