Machinekit

Machinekit

Machinekit Documentation

HAL Component — GEARCHANGE

INSTANTIABLE COMPONENTS — General

All instantiable components can be loaded in two manners

Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)

NAME

gearchange — Select from one two speed ranges

SYNOPSIS

The output will be a value scaled for the selected gear, and clamped to the min/max values for that gear. The scale of gear 1 is assumed to be 1, so the output device scale should be chosen accordingly. The scale of gear 2 is relative to gear 1, so if gear 2 runs the spindle 2.5 times as fast as gear 1, scale2 should be set to 2.5.

USAGE SYNOPSIS

The output will be a value scaled for the selected gear, and clamped to the min/max values for that gear. The scale of gear 1 is assumed to be 1, so the output device scale should be chosen accordingly. The scale of gear 2 is relative to gear 1, so if gear 2 runs the spindle 2.5 times as fast as gear 1, scale2 should be set to 2.5.

FUNCTIONS

gearchange.N.funct ( OR <newinstname>.funct (requires a floating-point thread) )

PINS

gearchange.N.sel bit in ( OR <newinstname>.sel bit in ) - Gear selection input

gearchange.N.speed-in float in ( OR <newinstname>.speed-in float in ) - Speed command input

gearchange.N.speed-out float out ( OR <newinstname>.speed-out float out ) - Speed command to DAC/PWM

gearchange.N.dir-in bit in ( OR <newinstname>.dir-in bit in ) - Direction command input

gearchange.N.dir-out bit out ( OR <newinstname>.dir-out bit out ) - Direction output - possibly inverted for second gear

gearchange.N.min1 float io (default: 0.0) ( OR <newinstname>.min1 float io (default: 0.0) ) - Minimum allowed speed in gear range 1

gearchange.N.max1 float io (default: 100000) ( OR <newinstname>.max1 float io (default: 100000) ) - Maximum allowed speed in gear range 1

gearchange.N.min2 float io (default: 0.0) ( OR <newinstname>.min2 float io (default: 0.0) ) - Minimum allowed speed in gear range 2

gearchange.N.max2 float io (default: 100000) ( OR <newinstname>.max2 float io (default: 100000) ) - Maximum allowed speed in gear range 2

gearchange.N.scale2 float io (default: 1.0) ( OR <newinstname>.scale2 float io (default: 1.0) ) - Relative scale of gear 2 vs. gear 1 Since it is assumed that gear 2 is "high gear", \fBscale2\fR must be greater than 1, and will be reset to 1 if set lower.

gearchange.N.reverse bit io (default: 0.0) ( OR <newinstname>.reverse bit io (default: 0.0) ) - Set to 1 to reverse the spindle in second gear

LICENCE

GPL