Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadrt encoder num_chan=1
- loadrt mux4 count=1
- addf encoder.capture-position servo-thread
- addf encoder.update-counters base-thread
- addf mux4.0 servo-thread
- loadrt ilowpass
- addf ilowpass.0 servo-thread
- setp ilowpass.0.scale 1000
- setp ilowpass.0.gain 0.01
- # If your MPG outputs a quadrature signal per click set x4 to 1
- # If your MPG puts out 1 pulse per click set x4 to 0
- setp encoder.0.x4-mode 0
- # For velocity mode, set to 1
- # In velocity mode the axis stops when the dial is stopped
- # even if that means the commanded motion is not completed,
- # For position mode (the default), set to 0
- # In position mode the axis will move exactly jog-scale
- # units for each count, regardless of how long that might take,
- setp axis.0.jog-vel-mode 0
- setp axis.1.jog-vel-mode 0
- setp axis.2.jog-vel-mode 0
- # the inputs to the mux4 component
- net scale1 mux4.0.sel0 <= parport.1.pin-09-in
- net scale2 mux4.0.sel1 <= parport.1.pin-10-in
- # this sets the scale that will be used based on the input to the mux4
- # the scale used here has to be multiplied by the ilowpass scale
- setp mux4.0.in0 0.0001
- setp mux4.0.in1 0.00001
- setp mux4.0.in2 0.000001
- # send encoder counts to ilowpass
- net mpg-out ilowpass.0.in <= encoder.0.counts
- # the output from the mux4 is sent to each axis jog scale
- net mpg-scale <= mux4.0.out
- net mpg-scale => axis.0.jog-scale
- net mpg-scale => axis.1.jog-scale
- net mpg-scale => axis.2.jog-scale
- # the output from the ilowpass is sent to each axis jog count
- net encoder-counts <= ilowpass.0.out
- net encoder-counts => axis.0.jog-counts
- net encoder-counts => axis.1.jog-counts
- net encoder-counts => axis.2.jog-counts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement