pluto_servo − Hardware driver and firmware for the Pluto-P parallel-port FPGA, for use with servo machines.
loadrt pluto_servo [ioaddr=N] [ioaddr_hi=N] [epp_wide=N] [watchdog=N] [test_encoder=N] |
ioaddr [default: 0x378]
The base address of the parallel port.
ioaddr_hi [default: 0]
The secondary address of the parallel port, used to set EPP mode. 0 means to use ioaddr + 0x400. -1 means there is no secondary address. The secondary address is used to set the port to EPP mode.
epp_wide [default: 1]
Set to zero to disable the "wide EPP mode". "Wide" mode allows a 16- and 32-bit EPP transfers, which can reduce the time spent in the read and write functions. However, this may not work on all EPP parallel ports.
watchdog [default: 1]
Set to zero to disable the "hardware watchdog". "Watchdog" will tristate all outputs approximately 6ms after the last execution of pluto-servo.write, which adds some protection in the case of emc crashes.
test_encoder [default: 0]
Internally connect dout0..2 to QA0, QB0, QZ0 to test quadrature counting
Pluto_servo is an emc2 software driver and associated firmware that allow the Pluto-P board to be used to control a servo-based CNC machine.
The driver has 4 PWM channels, 4 quadrature channels with index pulse, 18 digital outputs (8 shared with PWM), and 20 digital inputs (12 shared with quadrature).
Encoders
The encoder pins and parameters conform to the
’canonical encoder’ interface described in the
HAL manual. It operates in ’x4 mode’.
The sample rate of the encoder is 40MHz. The maximum number quadrature rate is 8191 counts per emc2 servo cycle. For correct handling of the index pulse, the number of encoder counts per revolution must be less than 8191.
PWM
The PWM pins and parameters conform to the ’canonical
analog output’ interface described in the HAL manual.
The output pins are ’up/down’ or
’pwm/dir’ pins as described in the documentation
of the ’pwmgen’ component.
Internally the PWM generator is based on a 12-bit, 40MHz counter, giving 4095 duty cycles from -100% to +100% and a frequency of approximately 19.5kHz. In PDM mode, the duty periods are approximately 100ns long.
Digital
I/O
The digital output pins conform to the ’canonical
digital output’ interface described in the HAL
manual.
The digital input pins conform to the ’canonical digital input’ interface described in the HAL manual.
pluto-servo.read (requires a floating-point thread)
Read all the inputs from the pluto-servo board
pluto-servo.write (requires a floating-point thread)
Write all the outputs on the pluto-servo board
pluto-servo.encoder.M.count
s32 out (M=0..3)
pluto-servo.encoder.M.position float out
(M=0..3)
pluto-servo.encoder.M.velocity float out
(M=0..3)
pluto-servo.encoder.M.reset bit in
(M=0..3)
pluto-servo.encoder.M.index-enable bit io
(M=0..3)
encoder.M corresponds to the pins labeled QAM, QBM, and QZM on the pinout diagram
pluto-servo.pwm.M.value
float in (M=0..3)
pluto-servo.pwm.M.enable bit in
(M=0..3)
pwm.M corresponds to the pins labeled UPM and DNM on the pinout diagram
pluto-servo.dout.MM bit in (MM=00..19)
dout.0M corresponds to the pin labeled OUTM on the pinout diagram. Other pins are shared with the PWM function, as follows:
Pin |
Shared | ||
Label |
with | ||
dout.10 |
UP0 | ||
dout.10 |
UP0 | ||
dout.12 |
UP1 | ||
dout.14 |
UP2 | ||
dout.18 |
UP3 | ||
dout.11 |
DOWN0 | ||
dout.13 |
DOWN1 | ||
dout.15 |
DOWN2 | ||
dout.19 |
DOWN3 |
pluto-servo.din.MM
bit out (MM=00..19)
pluto-servo.din.MM-not bit out
(MM=00..19)
For M=0 through 7, din.0M corresponds to the pin labeled INM on the pinout diagram. Other pins are shared with the encoder function, as follows:
Pin |
Shared | ||
Label |
with | ||
din.8 |
QZ0 | ||
din.9 |
QZ1 | ||
din.10 |
QZ2 | ||
din.11 |
QZ3 | ||
din.12 |
QB0 | ||
din.13 |
QB1 | ||
din.14 |
QB2 | ||
din.15 |
QB3 | ||
din.16 |
QA0 | ||
din.17 |
QA1 | ||
din.18 |
QA2 | ||
din.19 |
QA3 |
pluto-servo.encoder.M.scale
float rw (M=0..3) (default: 1)
pluto-servo.encoder.z-polarity bit rw
Set to TRUE if the index pulse is active low, FALSE if it is active high. Affects all encoders.
pluto-servo.pwm.M.offset
float rw (M=0..3)
pluto-servo.pwm.M.scale float rw (M=0..3)
(default: 1)
pluto-servo.pwm.M.max-dc float rw (M=0..3)
(default: 1)
pluto-servo.pwm.M.min-dc float rw (M=0..3)
(default: 0)
pluto-servo.pwm.M.pwmdir bit rw (M=0..3)
(default: 0)
Set to TRUE use PWM+direction mode. Set to FALSE to use Up/Down mode.
pluto-servo.pwm.is-pdm bit rw
Set to TRUE to use PDM (also called interleaved PWM) mode. Set to FALSE to use traditional PWM mode. Affects all PWM outputs.
pluto-servo.dout.MM-invert bit rw (MM=00..19)
If TRUE, the output on the corresponding dout.MM is inverted.
pluto-servo.communication-error u32 rw
Incremented each time pluto-servo.read detects an error code in the EPP status register. While this register is nonzero, new values are not being written to the Pluto-P board, and the status of digital outputs and the PWM duty cycle of the PWM outputs will remain unchanged. If the watchdog is enabled, it will activate soon after the communication error is detected. To continue after a communication error, set this parameter back to zero.
pluto-servo.debug-0 s32
rw
pluto-servo.debug-1 s32 rw
These parameters can display values which are useful to developers or for debugging the driver and firmware. They are not useful for integrators or users.
The pluto_servo section in the HAL User Manual, which shows the location of each physical pin on the pluto board.
GPL