CAROUSEL(9) | HAL Component | CAROUSEL(9) |
carousel - Orient a toolchanger carousel using various encoding schemes
loadrt carousel pockets=N[,N] encoding=ssss[,sss] num_sense=N[,N] dir=N[,N]
This component is intended to help operate various types of carousel-type toolchangers.
The component can be configured to operate with binary, binary-coded decimal (BCD) or gray-coded position feedback ('binary;, 'bcd' and 'gray' modes) It can alternatively work with an individual sensor for each tool position ('single' mode) or with a sensor at each tool position and a separate index ('index' mode). Systems using a stepper motor or quadrature encoder are also supported ('counts' mode). edge is a special case of index mode for tool changers with pockets on both the rising and falling edges of the position sensor. (Seen on at least one Denford Orac.)
Both unidirectional and bidirectional systems are supported and those that reverse against a stop when in position.
The number of carousel component instances created depends on the number of entries in the 'pockets' modparam. For example
loadrt carousel pockets=10,10,8
Would create 3 carousel instances with 10, 10 and 8 pockets. The other parameters are optional. If absent then defaults will be used. Any missing entry will assume the previous value.
When the enable pin is set to true the component will immediately set the "active" pin to true and then (for a bidirectional instance) calculate the shortest path to the requested pocket number. The appropriate motor direction output pins will then be set. Bit outputs for forward and reverse are provided as well as a three-state velocity output for driving a DC motor PWM or a velocity-mode stepgen.
The component will monitor the carousel position and, when the correct position is reached, set the motor-control pins to 0, set "active" to 0 and set "ready" to 1.
In 'index', 'edge' or 'counts'mode there is a need to find the initial home position of the carousel. The first time that the "enable" pin is set; the carousel will rotate forwards searching for a home signal. In 'index' and 'edge' mode this is when both the index and pulse inputs are true. In 'counts' mode only the index input needs to be set to set home. Additionally in 'counts' mode the usual index-enable logic of the encoder counters is supported.
With some carousel designs the carousel will not stop immediately. To allow for this set the lign-dc pin to a low velocity to be used for a final latching move, and set thedecel-time to a suitable value. Once the decel-time has expired the carousel will, if it was moving forwards, reverse back on to the position marker, off of the arker and then bak on to the FWD edge. If moving in reverse it will continue off the marker and then reverse slowly on to the FWD edge. This algnment is only possible with a motor-vel controlled bidirectional carousel, Other combinations will be acepted but probably won't have the desired behaviour. Some tuning will be needed of align-dc and decel-time to achieve reliable operation.
In the unusual case that the index and pulse signals do not align it is possible to use HAL logic to achieve the desired pin switching during homing.
Setting "enable" low does not halt the homing move, so if homing on first tool change is not needed then the enable pin can be toggled by an axis homing pin or a script and the homing process will continue even if that driving signal resets during the carousel homing move.
To operate the component with an encoder or stepgen use mode "C". The scale pin should be the number of steps or encoder counts between pocket centres. The width pin can be used to stop the motor some distance before the centre of the pocket to allow the motor time to decelerate.
For tool changers which lock the carousel against a stop the rev-pulse pin can be set to a non-zero value. The motor-rev pin will then be set for this many seconds at the completion of the tool search and at the same time the reverse duty/cycle velocity value will be sent to the motor-vel pin.
Andy Pugh
GPL
2023-02-10 | LinuxCNC Documentation |