Table of Contents
1 Pico PPMC
Pico Systems has a family of boards for doing servo, stepper, and pwm control. The boards connect to the PC through a parallel port working in EPP mode. Although most users connect one board to a parallel port, in theory any mix of up to 8 or 16 boards can be used on a single parport. One driver serves all types of boards. The final mix of I/O depends on the connected board(s). The driver doesn't distinguish between boards, it simply numbers I/O channels (encoders, etc) starting from 0 on the first card.
Installing:
loadrt hal_ppmc port_addr=<addr1>[,<addr2>[,<addr3>...]]
The port_addr parameter tells the driver what parallel port(s) to check. By default, <addr1> is 0x0378, and <addr2> and following are not used. The driver searches the entire address space of the enhanced parallel port(s) at port_addr, looking for any board(s) in the PPMC family. It then exports HAL pins for whatever it finds. During loading (or attempted loading) the driver prints some usefull debugging message to the kernel log, which can be viewed with dmesg.
Up to 3 parport busses may be used, and each bus may have up to 8 devices on it.
1.0.1 Pins
In the following pins, parameters, and functions, <board> is the board ID. According to the naming conventions the first board should always have an ID of zero. However this driver sets the ID based on a pair of jumpers on the baord, so it may be non-zero even if there is only one board.
- (s32) ppmc.<port>.encoder.<channel>.count -- Encoder position, in counts.
- (s32) ppmc.<port>.encoder.<channel>.delta -- Change in counts since last read.
- (float) ppmc.<port>.encoder.<channel>.position -- Encoder position, in user units.
- (bit) ppmc.<port>.encoder.<channel>.index-enable -- Connect to axis.#.index-enable for home-to-index.
- (bit) ppmc.<port>.pwm.<channel>.enable -- Enables a PWM generator.
- (float) ppmc.<port>.pwm.<channel>.value -- Value which determines the duty cycle of the PWM waveforms. The value is divided by pwm.<channel>.scale, and if the result is 0.6 the duty cycle will be 60%, and so on. Negative values result in the duty cycle being based on the absolute value, and the direction pin is set to indicate negative.
- (bit) ppmc.<port>.stepgen.<channel>.enable -- Enables a step pulse generator.
- (float) ppmc.<port>.stepgen.<channel>.velocity -- Value which determines the step frequency. The value is multiplied by stepgen.<channel>.scale, and the result is the frequency in steps per second. Negative values result in the frequency being based on the absolute value, and the direction pin is set to indicate negative.
- (bit) ppmc.<port>.in-<channel> -- State of digital input pin, see canonical digital input.
- (bit) ppmc.<port>.in.<channel>-not -- Inverted state of digital input pin, see canonical digital input.
- (bit) ppmc.<port>.out-<channel> -- Value to be written to digital output, seen canonical digital output.
1.0.2 Parameters
- (float) ppmc.<port>.enc.<channel>.scale -- The number of counts / user unit (to convert from counts to units).
- (float) ppmc.<port>.pwm.<channel-range>.freq -- The PWM carrier frequency, in Hz. Applies to a group of four consecutive PWM generators, as indicated by <channel-range>. Minimum is 153Hz, maximum is 500KHz.
- (float) ppmc.<port>.pwm.<channel>.scale -- Scaling for PWM generator. If scale is X, then the duty cycle will be 100% when the value pin is X (or -X).
- (float) ppmc.<port>.pwm.<channel>.max-dc -- Maximum duty cycle, from 0.0 to 1.0.
- (float) ppmc.<port>.pwm.<channel>.min-dc -- Minimum duty cycle, from 0.0 to 1.0.
- (float) ppmc.<port>.pwm.<channel>.duty-cycle -- Actual duty cycle (used mostly for troubleshooting.)
- (bit) ppmc.<port>.pwm.<channel>.bootstrap -- If true, the PWM generator will generate a short sequence of pulses of both polarities when it is enabled, to charge the bootstrap capacators used on some MOSFET gate drivers.
- (u32) ppmc.<port>.stepgen.<channel-range>.setup-time -- Sets minimum time between direction change and step pulse, in units of 100nS. Applies to a group fof four consecutive PWM generators, as indicated by <channel-range>.
- (u32) ppmc.<port>.stepgen.<channel-range>.pulse-width -- Sets width of step pulses, in units of 100nS. Applies to a group fof four consecutive PWM generators, as indicated by <channel-range>.
- (u32) ppmc.<port>.stepgen.<channel-range>.pulse-space-min -- Sets minimum time between pulses, in units of 100nS. The maximum step rate is 1/( 100nS * ( pulse-width + pulse-space-min )). Applies to a group fof four consecutive PWM generators, as indicated by <channel-range>.
- (float) ppmc.<port>.stepgen.<channel>.scale -- Scaling for step pulse generator. The step frequency in Hz is the absolute value of velocity * scale.
- (float) ppmc.<port>.stepgen.<channel>.max-vel -- The maximum value for velocity. Commands greater than max-vel will be clamped. Also applies to negative values. (The absolute value is clamped.)
- (float) ppmc.<port>.stepgen.<channel>.frequency -- Actual step pulse frequency in Hz (used mostly for troubleshooting.)
- (bit) ppmc.<port>.out.<channel>-invert -- Inverts a digital output, see canonical digital output.
1.0.3 Functions
- (funct) ppmc.<port>.read -- Reads all inputs (digital inputs and encoder counters) on one port.
- (funct) ppmc.<port>.write -- Writes all outputs (digital outputs, stepgens, PWMs) on one port.