Friday, April 15, 2011

DAQ Triggers in Matlab

I'm writing a program that detects the speed of a object by hall effect sensors that are run into MATLAB through a DAQ (MCC USB-1408FS)

The problem that has arisen is that I'm using a non-stop scan technique to detect the state of one of 3 sensors. Unfortunately this means that unless the object is rotating past each sensor at the exact rate the program runs, I will see an instantaneous speed (done by comparing the time between two sensors) of zero.

I need the sensors to signal the program to count when they are hit, instead of constantly scanning for the signal. How can this be done?

From stackoverflow
  • Are you running the 1408FS in the continuous scan mode as opposed to the software paced mode (1408FS user manual - page 3-1)? Either way, it sounds like that your sampling rate is too slow to catch the signal from your sensor. Also are you using MATLAB's DAQ toolbox?

    Another point that comes to my mind, from your description it sounds like you have MATLAB logging the difference in time between signal from each of your three sensors (which are at known positions). Again if your sampling rate is too slow it will appear as if your object has moved instantaneously from one sensors to the next. Perhaps, you could use the external trigger on your DAQ with one of your sensors.

    I am having some difficulty in imaging the type of signal you receive from your sensors. I image it is some sort of step function. That is the sensor is will read zero and the pulse for a short time as the object passes it. Something like

    • data sensor 1: ... 0, .25, .5, .75, 1, 1, 1, .75, .5, .25, 0, 0, 0, 0, 0...
    • data sensor 2: ... 0, 0, 0, .25, .5, .75, 1, 1, 1, .75, .5, .25, 0, 0, 0 ...

    as the object passes the sensor the signal increases and then decreases back to zero. In this case the sensors might be too close together for the speed of your object. Since the signal from the two sensors overlap.

    just my 2c.

0 comments:

Post a Comment