📄 general_ref.lyx
字号:
\begin_inset LatexCommand \label{sec:CanonDigOut}\end_inset Digital Output\layout StandardThe canonical digital output (I/O type field: \family typewriter \series bold digout\family default \series default ) is also very simple.\layout SubsectionPins\layout Itemize\shape smallcaps (bit)\shape default \family typewriter \series bold out\family default \series default -- Value to be written (possibly inverted) to the hardware output.\layout SubsectionParameters\layout Itemize\shape smallcaps (bit)\shape default \family typewriter \series bold invert\family default \series default -- If TRUE, \family typewriter \series bold out\family default \series default is inverted before writing to the hardware.\layout SubsectionFunctions\layout Itemize\shape smallcaps (funct)\shape default \family typewriter \series bold write\family default \series default -- Read \family typewriter \series bold out\family default \series default and \family typewriter \series bold invert\family default \series default , and set hardware output accordingly.\layout SectionAnalog Input\layout StandardThe canonical analog input (I/O type: \family typewriter \series bold adcin\family default \series default ). This is expected to be used for analog to digital converters, which convert e.g. voltage to a continuous range of values.\layout SubsectionPins\layout Itemize(\shape smallcaps float\shape default ) \series bold value\series default -- The hardware reading, scaled according to the \series bold scale\series default and \series bold offset\series default parameters. \series bold Value\series default = ((input reading, in hardware-dependent units) * \series bold scale\series default ) - \series bold offset\layout SubsectionParameters\layout Itemize(\shape smallcaps float\shape default ) \series bold scale\series default -- The input voltage (or current) will be multiplied by \series bold scale\series default before being output to \series bold value\series default .\layout Itemize(\shape smallcaps float\shape default ) \series bold offset\series default -- This will be subtracted from the hardware input voltage (or current) after the scale multiplier has been applied.\layout Itemize(\shape smallcaps float\shape default ) \series bold bit_weight\series default -- The value of one least significant bit (LSB). This is effectively the granularity of the input reading.\layout Itemize(\shape smallcaps float\shape default ) \series bold hw_offset\series default -- The value present on the input when 0 volts is applied to the input pin(s).\layout SubsectionFunctions\layout Itemize(\shape smallcaps funct\shape default ) \series bold read\series default -- Read the values of this analog input channel. This may be used for individual channel reads, or it may cause all channels to be read\layout SectionAnalog Output\layout StandardThe canonical analog output (I/O Type: \family typewriter \series bold adcout\family default \series default ). This is intended for any kind of hardware that can output a more-or-less continuous range of values. Examples are digital to analog converters or PWM generators.\layout Subsection*Pins\layout Itemize(\shape smallcaps float\shape default ) \series bold value\series default -- The value to be written. The actual value output to the hardware will depend on the scale and offset parameters.\layout Itemize(\shape smallcaps bit\shape default ) \series bold enable\series default -- If false, then output 0 to the hardware, regardless of the \series bold value\series default pin.\layout SubsectionParameters\layout Itemize(\shape smallcaps float\shape default ) \series bold offset\series default -- This will be added to the \series bold value\series default before the hardware is updated\layout Itemize(\shape smallcaps float\shape default ) \series bold scale\series default -- This should be set so that an input of 1 on the \series bold value\series default pin will cause 1V \layout Itemize(\shape smallcaps float\shape default ) \series bold high_limit\series default (optional) -- When calculating the value to output to the hardware, if \series bold value\series default + \series bold offset\series default is greater than \series bold high_limit\series default , then \series bold high_limit\series default will be used instead.\layout Itemize(\shape smallcaps float\shape default ) \series bold low_limit\series default (optional) -- When calculating the value to output to the hardware, if \series bold value\series default + \series bold offset\series default is less than \series bold low_limit\series default , then \series bold low_limit\series default will be used instead.\layout Itemize(\shape smallcaps float\shape default ) \series bold bit_weight\series default (optional) -- The value of one least significant bit (LSB), in volts (or mA, for current outputs)\layout Itemize(\shape smallcaps float\shape default ) \series bold hw_offset\series default (optional) -- The actual voltage (or current) that will be output if 0 is written to the hardware.\layout SubsectionFunctions\layout Standard(\shape smallcaps funct\shape default ) \series bold write\series default -- This causes the calculated value to be output to the hardware. If enable is false, then the output will be 0, regardles of \series bold value\series default , \series bold scale\series default , and \series bold offset\series default . The meaning of \begin_inset Quotes eld\end_inset 0\begin_inset Quotes erd\end_inset is dependent on the hardware. For example, a bipolar 12-bit A/D may need to write 0x1FF (mid scale) to the D/A get 0 volts from the hardware pin. If enable is true, read scale, offset and value and output to the adc (\series bold scale\series default * \series bold value\series default ) + \series bold offset\series default . If enable is false, then output 0.\layout Section\begin_inset LatexCommand \label{sec:CanonEncoder}\end_inset Encoder\layout StandardThe canonical encoder interface (I/O type field:\family typewriter \series bold encoder\family default \series default ) provides the functionality needed for homing to an index pulse and doing spindle synchronization, as well as basic position and/or velocity control. This interface should be implementable regardless of the actual underlying hardware, although some hardware will provide \begin_inset Quotes eld\end_inset better\begin_inset Quotes erd\end_inset results. (For example, capture the index position to +/- 1 count while moving faster, or have less jitter on the velocity pin.)\layout SubsectionPins\layout Itemize\shape smallcaps (s32)\family typewriter \series bold \shape default count\family default \series default -- Encoder value in counts.\layout Itemize\shape smallcaps (float)\shape default \family typewriter \series bold position\family default \series default -- Encoder value in position units (see parameter \begin_inset Quotes eld\end_inset scale\begin_inset Quotes erd\end_inset ). \layout Itemize\shape smallcaps (float)\shape default \family typewriter \series bold velocity\family default \series default -- Velocity in position units per second.\layout Itemize\shape smallcaps (bit)\shape default \family typewriter \series bold reset\family default \series default -- When True, force counter to zero.\layout Itemize\shape smallcaps (bit)\shape default \family typewriter \series bold index-enable\family default \series default -- (bidirectional) When True, reset to zero on next index pulse, and set pin False.\layout StandardThe \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset pin is bi-directional, and might require a little more explanation. If \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset is False, the index channel of the encoder will be ignored, and the counter will count normally. The encoder driver will never set \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset True. However, some other component may do so. If \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset is True, then when the next index pulse arrives, the encoder counter will be reset to zero, and the driver will set \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset False. That will let the other component know that an index pulse arrived. This is a form of handshaking - the other component sets \begin_inset Quotes eld\end_inset index-enable\begin_inset Quotes erd\end_inset True to request a index pulse reset, and the driver sets it False when the request has been satisfied.\layout SubsectionParameters\layout Itemize\shape smallcaps (float)\shape default \family typewriter \series bold scale\family default \series default -- The scale factor used to convert counts to position units. It is in \begin_inset Quotes eld\end_inset counts per position unit\begin_inset Quotes erd\end_inset . For example, if you have a 512 count per turn encoder on a 5 turn per inch screw, the scale should be 512*5 = 2560 counts per inch, which will result in \begin_inset Quotes eld\end_inset position\begin_inset Quotes erd\end_inset in inches and \begin_inset Quotes eld\end_inset velocity\begin_inset Quotes erd\end_inset in inches per second.\layout Itemize\shape smallcaps (float)\shape default \family typewriter \series bold max-index-vel\family default \series default -- (optional) The maximum velocity (in position units per second) at which the encoder can reset on an index pulse with +/- 1 count accuracy. This is an output from the encoder driver, and is intended to tell the user something about the hardware capabilities. Some hardware can reset the counter at the exact moment the index pulse arrives. Other hardware can only tell that an index pulse arrived sometime since the last time the read function was called. For the latter, +/- 1 count accuracy can only be achieved if the encoder advances by 1 count or less between calls to the read function.\layout Itemize\shape smallcaps (float)\shape default \family typewriter \series bold velocity-resolution\family default \series default -- (optional) The resolution of the velocity output, in position units per second. This is an output from the encoder driver, and is intended to tell the user something about the hardware capabilities. The simplest implementation of the velocity output is the change in postion from one call of the read function to the next, divided by the time between calls. This yields a rather coarse velocity signal that jitters back and forth between widely spaced possible values (quantization error). However, some hardware captures both the counts and the exact time when a count occurres (possibly with a very high resolution clock). That data allows the driver to calculate velocity with finer resolution and less jitter. \layout SubsectionFunctions\layout StandardThere is only one function, to read the encoder(s). \layout Itemize\family typewriter \noun on (funct)\noun default \series bold read\family default \series default -- Capture counts, update position and velocity.\the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -