| 25 | you need to enable the extra parport if not done yet! |
| 26 | |
| 27 | in this config parport.1 is used (2nd port) |
| 28 | |
| 29 | {{{ |
| 30 | # you need one encoder for this |
| 31 | loadrt encoder num_chan=1 |
| 32 | # and one absolut value |
| 33 | loadrt abs count=1 |
| 34 | |
| 35 | # connect encoder to fast thread for pin-update |
| 36 | addf encoder.update-counters base-thread |
| 37 | |
| 38 | # calculate new dataset |
| 39 | addf encoder.capture-position servo-thread |
| 40 | addf abs.1 servo-thread |
| 41 | |
| 42 | |
| 43 | #####rpm-counter######## |
| 44 | # in: 1x encoder out: spindle: pyvcp speed in rpm |
| 45 | setp encoder.0.x4-mode FALSE |
| 46 | net rpm-wheel-a encoder.6.phase-A <= parport.1.pin-11-in-not |
| 47 | net rpm-wheel-b encoder.6.phase-B <= parport.1.pin-12-in-not |
| 48 | # we are measuring rps in reality, so multiply by 60 through dividing by 1/60th |
| 49 | setp encoder.0.position-scale .01666666 |
| 50 | # the encoder-output is signed, but we want a directional led and an absolut |
| 51 | net measured-speed abs.0.out => pyvcp.spindle-speed-measured |
| 52 | net measured-speed-signed encoder.0.velocity => abs.0.in |
| 53 | net measured-speed-sign abs.0.sign => pyvcp.spindle-cw-led-measured |
| 54 | }}} |
| 55 | |
| 56 | |