📄 encoder_ratio.9
字号:
.TH ENCODER_RATIO "9" "2007-01-16" "EMC Documentation" "HAL Component".de TQ.br.ns.TP \\$1...SH NAMEencoder_ratio \- an electronic gear to synchronize two axes.SH SYNOPSIS.B loadrt encoder_ratio [num_chan=\fIN\fB].SH DESCRIPTION\fBencoder_ratio\fR can be used to synchronize two axes (like an "electronicgear"). It counts encoder pulses from both axes in software, and produces anerror value that can be used with a PID loop to make the slave encoder trackthe master encoder with a specific ratio.This module supports up to eight axis pairs. The number of pairs is set by themodule parameter \fBnum_chan\fR..SH FUNCTIONS.TP.B encoder-ratio.sampleRead all input pins. Must be called at twice the maximum desired count rate..TP.B encoder-ratio.update (uses floating-point)Updates all output pins. May be called from a slower thread..SH PINS.TP.B encoder-ratio.\fIN\fB.master-A\fR bit in.TQ.B encoder-ratio.\fIN\fB.master-B\fR bit in.TQ.B encoder-ratio.\fIN\fB.slave-A\fR bit in.TQ.B encoder-ratio.\fIN\fB.slave-B\fR bit inThe encoder channels of the master and slave axes.TP.B encoder-ratio.\fIN\fB.enable\fR bit inWhen the enable pin is FALSE, the error pin simply reports the slave axisposition, in revolutions. As such, it would normally be connected to thefeedback pin of a PID block for closed loop control of the slave axis.Normally the command input of the PID block is left unconnected (zero), so theslave axis simply sits still. However when the enable input goes TRUE, theerror pin becomes the slave position minus the scaled master position. Thescale factor is the ratio of master teeth to slave teeth. As the master moves,error becomes non-zero, and the PID loop will drive the slave axis to track themaster. .TP.B encoder-ratio.\fIN\fB.error\fR float outThe error in the position of the slave (in revolutions).SH PARAMETERS.TP.B encoder-ratio.N.master-ppr\fR unsigned rw.TQ.B encoder-ratio.N.slave-ppr\fR unsigned rwThe number of pulses per revolution of the master and slave axes.TP.B encoder-ratio.N.master-teeth\fR unsigned rw.TQ.B encoder-ratio.N.slave-teeth\fR unsigned rwThe number of "teeth" on the master and slave gears..SH SEE ALSO\fBencoder(9)\fR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -