Difference between revisions of "Applying Low Pass Filter on Master Source"
(AXY: new links) |
|||
Line 33: | Line 33: | ||
== See Also== | == See Also== | ||
− | * [[ | + | * [[MC-Basic:element.SLAVE|SLAVE]] |
* [[MC-Basic:axis.SLAVEDISABLE|axis.SLAVEDISABLE]] | * [[MC-Basic:axis.SLAVEDISABLE|axis.SLAVEDISABLE]] | ||
* [[MC-Basic:axis.MASTERSOURCE|axis.MASTERSOURCE]] | * [[MC-Basic:axis.MASTERSOURCE|axis.MASTERSOURCE]] |
Latest revision as of 12:26, 13 September 2017
Applying Low Pass Filter on Master Source
This article explains how to add low-pass Butterworth filter [1] on the master-source signal.
Once the filter is active (MOT_LP_SET is called) it will filter any (POSITIONCOMMAND, POSITIONFEEDBACK,POSITIONEXTERNAL, TIMEPULSE,TORQUECOMMAND,TORQUEFEEDBACK,TORQUEADDITIVECOMMAND,TORQUEDRIVECOMMAND) master-source signal.
Setup
In PROTO.PRO file add the following line:
import_c MOT_LP_SET(byval as long, byval as long, byval as double) as long
Usage
Add the following line into your code:
tmp = MOT_LP_SET(<slave element id>,<number of stages>, <cut-off frequency in Hz>)
Example
MLeader_LPF is a simulated axis
MLeader is a real axis.
MLeader_LPF.opmode = TorqueMode
MLeader_LPF.MasterSource = MLeader.TDCMD
MLeader_LPF.Slave = GEAR
retVal = MOT_LP_SET(MLeader_LPF.ElementID, 1, g_Cutoff_Freq) ' (int Handle, int FilterStages, int CutOffFreq)