wiki:Maschinen/CncFräse/JogBox

JogBox

this is a simple parallel port connected jog box with 6 axis and minimal cost.

Hardware

jogbox jogbox open

Schematic

as pullups anything between 10k and 100k should be working. i used 47k

schematic jog box jogbox pullups detail

the resistors can be soldered directly to the encoders after mounting these with a center-lock ring in the plastic case.

my encoders also have a pushbutton feature, but i did not wire these. (see the not soldered pins)

to make sure no fluids enter the case and strain-relief the cable mount use a proper cable fitting as shown in the pictures.

Software

the software is only emc2 config:

HAL config

you need to enable the extra parport if not done yet!

in this config parport.2 is used (3rd port)

loadrt encoder num_chan=6
loadrt knob2float count=1

#####jogpad########
# in: 6x encoder + pyvcp enable  out: 3 axis jog, speed, pyvcp speed, feed and spindle override

net jogdev-enable <= pyvcp.jogdevice-enable
net wheel-2-limit => pyvcp.jogdevice-speed

# this enables 5V on pin 1, which is used to source the pullups
setp parport.2.pin-01-out TRUE

# swap A and B here if you need to change the direction
# this connects parport pins to the encoder hal component
net wheel-0-a encoder.0.phase-B <= parport.2.pin-02-in-not
net wheel-0-b encoder.0.phase-A <= parport.2.pin-03-in-not
net wheel-1-a encoder.1.phase-B <= parport.2.pin-04-in-not
net wheel-1-b encoder.1.phase-A <= parport.2.pin-05-in-not
net wheel-2-a encoder.2.phase-B <= parport.2.pin-06-in-not
net wheel-2-b encoder.2.phase-A <= parport.2.pin-07-in-not
net wheel-3-a encoder.3.phase-B <= parport.2.pin-08-in-not
net wheel-3-b encoder.3.phase-A <= parport.2.pin-09-in-not
net wheel-4-a encoder.4.phase-B <= parport.2.pin-10-in-not
net wheel-4-b encoder.4.phase-A <= parport.2.pin-11-in-not
net wheel-5-a encoder.5.phase-B <= parport.2.pin-12-in-not
net wheel-5-b encoder.5.phase-A <= parport.2.pin-13-in-not

# one click is one step
setp encoder.0.x4-mode FALSE
setp encoder.1.x4-mode FALSE
setp encoder.2.x4-mode FALSE
setp encoder.3.x4-mode FALSE
setp encoder.4.x4-mode FALSE
setp encoder.5.x4-mode FALSE

# default for 'how big is one step'
setp halui.spindle-override.scale 0.01
setp halui.feed-override.scale 0.10

# connect feed and spindle overrides
net wheel-0 halui.feed-override.counts <= encoder.0.counts
net wheel-1 halui.spindle-override.counts <= encoder.1.counts

# use knob2float to limit the range of 'how big is one step'
setp knob2float.0.scale 0.001
setp knob2float.0.enable TRUE
setp knob2float.0.min-out 0.0
setp knob2float.0.max-out 1.0
net wheel-2 <= encoder.2.counts
net wheel-2 => knob2float.0.counts
net wheel-2-limit <= knob2float.0.out
net wheel-2-limit => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale

# connect the 3 jog axis to encoders
net wheel-3 axis.2.jog-counts <= encoder.3.counts
net wheel-4 axis.0.jog-counts <= encoder.4.counts
net wheel-5 axis.1.jog-counts <= encoder.5.counts

# connect the enable checkbox to the axis
net jogdev-enable => axis.0.jog-enable axis.1.jog-enable axis.2.jog-enable

# enable vel-mode for the 3 axis
setp axis.0.jog-vel-mode TRUE
setp axis.1.jog-vel-mode TRUE
setp axis.2.jog-vel-mode TRUE

PyVCP config

pyvcp-ui

add something like this to your custompanel.xml

<labelframe text="JogBox">
  <checkbutton>
    <halpin>"jogdevice-enable"</halpin>
    <text>"Enable"</text>
  </checkbutton>
  <hbox>
    <label>
      <text>"Stepsize"</text>
      <font>("Helvetica",12)</font>
    </label>
    <number>
      <halpin>"jogdevice-speed"</halpin>
      <font>("Helvetica",15)</font>
      <format>"1.3f"</format>
    </number>
  </hbox>
</labelframe>

see also

Last modified 11 years ago Last modified on Nov 16, 2009, 9:47:29 AM

Attachments (4)

Download all attachments as: .zip