I'm doing a project based on an incremental encoder based position sensor. In order to validate this, I'm trying to read square wave signals from a function generator (since an optical encoder produces square wave pulses as output). Is there any method to read voltage signals from a signal generator using MATLAB Simulink software?
-
\$\begingroup\$ I believe an incremental encoder outputs in quadrature. en.wikipedia.org/wiki/Rotary_encoder \$\endgroup\$Optionparty– Optionparty2013年01月04日 15:57:46 +00:00Commented Jan 4, 2013 at 15:57
1 Answer 1
You could use the Matlab Data Acquisition Toolbox, if you have access to that.
Alternately, a digital storage oscilloscope may be about to capture data in some kind of spreadsheet format that you could easily import into Matlab.
You will need to set the sampling rate high enough to avoid aliasing. For a conventional rotary encoder, that the critical time is about 0.5 ms, so you need to sample at 0.25 ms or less (4000 Hz). You'll need to ensure your data capture system is properly configured to capture these events. For your optical encoder, the sample time will be related to the maximum speed you are trying to capture and the number of positions in the encoder.
-
\$\begingroup\$ Of course, even with the data acquisition toolbox, you need some sort of interface to get the data from the encoder into your computer, and no plan for that has been described. \$\endgroup\$Scott Seidman– Scott Seidman2013年01月04日 23:09:44 +00:00Commented Jan 4, 2013 at 23:09