beautypg.com

Sensoray 518 User Manual

Page 19

background image

18

Set Filter Time Constant

This command establishes a software single-pole low-pass filter for the specified channel. The
second command byte specifies a filter factor F that may have any value from 0 to 255,
inclusive. The approximate relationship between F and filter percentage P is:

P = F
2.55

All filter constants default to 0 after a reset. This effectively disables the software filters, thereby
maximizing the frequency response of all channels. A non-zero factor in electrically noisy
environments may help to reduce measurement noise.

Rather than computing the theoretical value of filter constants, we recommend that you
experiment with different filter constants to find the best response-time/noise-immunity tradeoff
point. Some applications require knowledge of the filter time constant. This function describes
the approximate relationship between time constant and filter factor:

where: t is the time constant in seconds
F is the filter factor in the range 0 to 255
N is the number of active channels.

COMMAND: (96 + CHAN), (FILTER CONSTANT)
RESPONSE: NONE

EXAMPLE:

‘ Set up channel 4 with a 12.5% low-pass filter. |

Channel% = 4
Opcode% = 96 ‘command opcode
FilterPercent% = 12.5 ‘filter percentage
FilterConstant% = FilterPercent% * 2.55 ‘compute filter constant

CALL Send518Byte (BasePort%, Channel% + Opcode%) ‘send channel & opcode to 518
CALL Send518Byte (BasePort%, FilterConstant%) ‘send filter constant to 518