ForceBoard.com Posted December 16, 2017 Share Posted December 16, 2017 Hello, I'm using a LabJack U3 to read a hall sensor in my DF (non-streaming) application. Now the thing is that whilst the actual pulse counter works just fine in DaqF the time difference, dt, between two pulses I can resolve at low speeds looks stable but at higher speeds (the hall sensor monitors a DC motor shaft) the dt becomes pretty shaky (ranging from 0.342sec up to 0.387sec) but the frequency of the motor is stable (~2.7Hz at the highest speed) so it's not really a high speed. Any ideas on how to improve the dt stability would be much appreciated, preferable without switching to streaming or using averaging... My sequence for the speed calculation looks like: while (1) private theTime=Wear_sensor_mm.Time // Wear_sensor_mm is a FIO channel not related to the motor speed from where I "borrow" the time stamp travel=rev_counter*195/1000 distance.AddValue(insertTime((travel),theTime,0)) // distance is a just test channel which monitors the total travel of the motor if (temp_rev_counter<rev_counter) if (rev_counter%2==1) // on every other turn of the motor the delta_T1 is set and on every other turn delta_T2 is set delta_T1=Wear_sensor_mm.Time else delta_T2=Wear_sensor_mm.Time endif speed.AddValue(insertTime((0.19468/Abs(delta_T2-delta_T1)),theTime,0)) // speed calculation which is stable for really slow speeds but (delta_T2-delta_T1) is shaky at "higher" speeds temp_rev_counter=rev_counter endif // Hall sensor code AddRequest(ID,LJ_ioGET_COUNTER,0, 0, 0, 0) . GoOne(ID) GetResult(ID,LJ_ioGET_COUNTER,0,@rev_counter) delay(1/sampling_frequency) // sampling_frequency set to 40Hz endwhile Thanks, Marcus Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.