Thank you Frederic,
When we get this sorted out we can post an edited version to this list with
the subject heading BBB-25/26 and Xylotex for the lathe.

>From setup.sh the actual I/O pins are described here.  Unfortunately there's
no direct link to the PC Emulated Parallel ports.  My plan was to add that
as comments but haven't got there yet.

sudo $(which config-pin) -f - <<- EOF

    P8.07   out # gpio2.2   Enable System
    P8.10   in  # gpio2.4   XLIM
    P8.11   out # gpio1.13  X_Dir
    P8.12   out # gpio1.12  X_Step
    P8.13   out # gpio0.23  PWM0/SPINDLE
    P8.14   in  # gpio0.26  YLIM
    P8.15   out # gpio1.15  Y_Dir
    P8.16   out # gpio1.14  Y_Step
    P8.18   in  # gpio2.1   ZLIM
    P8.19   out # gpio0.22  PWM1
    P9.14   out # gpio1.18  PWM2
    P9.15   out # gpio1.16  Z_Step
    P9.23   out # gpio1.17  Z_Dir
#   P9.17   out # gpio0.5   SCS
#   P9.18   in  # gpio0.4   SDI
#   P9.21   out # gpio0.3   SDO
#   P9.22   out # gpio0.2   SCK
    P9.13   out # gpio0.30  A_Dir
    P9.11   out # gpio0.31  A_Step
    P8.09   in  # gpio2.5   STOPin

The README file in the machinekit directory attaches the Parallel Port pins
to their descriptions.

$ cat README
This configuration drives a standard 4-axis system using the PRU for
high speed step/dir pulse generation and a Xylotex BBB interface board.  The
interface board sets up the STEP/DIR/Limit as:XS-2, XD-3, XL-11, YS-4,
YD-5, YL-12, ZS-6, ZD-7, ZL-13, AS-8, AD-9, AL-15

The STOP Input is Pin 10 and the Enable Input is Pin 1

There are 3 additional Outputs, Pin 14 Spindle On, Pin 16 Flood Coolant,
Pin 17 Mist Coolant
===========================================
In the .hal file we have:
# This output is on DB25-14 and is currently tied to spindle control (M3/M5)
net Output1 bb_gpio.p8.out-13 => motion.spindle-on
setp bb_gpio.p8.out-13.invert 1

# This output is on DB25-16
net Output2 bb_gpio.p8.out-19 => halui.mist.is-on
setp bb_gpio.p8.out-19.invert 1

# This output is on DB25-17 (M8/M9)
net Output3 bb_gpio.p9.out-14 => halui.flood.is-on
setp bb_gpio.p9.out-14.invert 1
================================================

Which means if I've edited the text correctly it should look like this:

    P8.07   out         # gpio2.2   Enable System       # DB-25-1
    P8.10   in          # gpio2.4   XLIM                        # DB-25-11
(also HOME)
    P8.11   out         # gpio1.13  X_Dir               # DB25-3
    P8.12   out         # gpio1.12  X_Step              # DB25-2
    P8.13   out         # gpio0.23  PWM0/SPINDLE        # DB-25-14
    P8.14   in          # gpio0.26  YLIM                # DB-25-12 (also
HOME)
    P8.15   out         # gpio1.15  Y_Dir               # DB-25-5
    P8.16   out         # gpio1.14  Y_Step              # DB-25-4
    P8.18   in          # gpio2.1   ZLIM                        # DB-25-13
(also HOME)
    P8.19   out         # gpio0.22  PWM1                # DB25-16
    P9.14   out         # gpio1.18  PWM2                # DB25-17 (M8/M9)
    P9.15   out         # gpio1.16  Z_Step              # DB-25-6
    P9.23   out         # gpio1.17  Z_Dir               # DB-25-7
#   P9.17   out         # gpio0.5   SCS
#   P9.18   in          # gpio0.4   SDI
#   P9.21   out         # gpio0.3   SDO
#   P9.22   out         # gpio0.2   SCK
    P9.13   out         # gpio0.30  A_Dir               # DB-25-9
    P9.11   out         # gpio0.31  A_Step              # DB-25-8
    P8.09   in          # gpio2.5   STOPin              # DB-25-10

Clearly for the lathe we have a fair amount of latitude.  The P9 pins for
SPI are not addressed in the HAL.

"On the BBB_DB25/26, the  IDC26 header has BBB Pin P9-42 and P9-27.
  P9-42 equates to eQEP0Ain
  P9-27 equates to eQEP0Bin

  Pin 9-41 equates to eQEP0index.  This is on the DB25 connector and has a
RC filter on it (used on the board as an A axis home/limit switch).  If you
want to use that input, you will need to remove the capacitor."

Nor are P9-42, P9-27 and P9-41.
I am a bit confused by the .hal file statements here as on one hand they are
saying pins 12,13 are HOME switches on the Parallel port and then below that
these parallel port pins are for encoder line A and Index.  Could be the
Spindle Encoder information in the Xlylotex.hal file are from a LinuxCNC PC
parallel port config and not Beagle.

############# Spindle Encoder #############
# add scale and lowpass, these will be used in custom_postgui.hal
loadrt scale count=1
loadrt lowpass count=1
 
# add the encoder to HAL and attach it to threads.
loadrt encoder num_chan=1
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
 
# set the HAL encoder to 60 pulses per revolution.
setp encoder.0.position-scale 60
 
# set the HAL encoder to non-quadrature simple counting using A only.
setp encoder.0.counter-mode true
#setp encoder.0.counter-mode 1 - alternative line
 
# connect the HAL encoder outputs to LinuxCNC.
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=>
motion.spindle-index-enable
 
# connect the HAL encoder inputs to the real encoder.
net spindle-phase-a encoder.0.phase-A <= parport.0.pin-13-in
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z <= parport.0.pin-12-in
############# End Spindle Encoder #############

I've sent you the hal and ini files attached in a private email.

The lathe I'll test on has:
 Z axis 0.1" pitch or 10 TPI and 1600 steps per rev.
X axis is 0.050 pitch or 20 TPI and 2400 steps per rev.

Currently a 1PPR sensor which I guess we'll call encoder Index which is
supposed to be on the DB-25 GPIO 9-41 but I can't find that in the HAL file.
Can't locate my schematic for the Beagle so I'll reverse engineer the pins
and send Xylotex an email.  They no longer sell the cape I have.  They now
sell this one.
http://xylotex.netfirms.com/OSCommerce/catalog/product_info.php?products_id=
117&osCsid=4305cae8154e69b7a62e009f0f40f984


The 26 pin header of the BBB_DB-25/26 has the QEP pins but again they don't
say which ones.  I'll let you know on that.

Thanks again for the help.  If all goes well we can put together a single
document that guides others in connecting a Beagle to a Lathe.  

John


> -----Original Message-----
> From: Frederic RIBLE [mailto:[email protected]]
> Sent: October-15-17 10:22 PM
> To: [email protected]
> Subject: Re: [Emc-users] MachineKit on the BeagleBone Black
> 
> On 2017-10-15 19:58, John Dammeyer wrote:
> 
> > I mentioned 10uS period because that's what I read is the PRU interrupt
rate
> > and why the machine kit can't do more than 50kHz stepping pulses.
Don't
> > know if that's true either now because that information might also be
old.
> >
> 10uS is the standard configuration.
> You can change it to 2.5uS with "pru_period=2500" as argument on the
> line loading the PRU in the HAL config.
> 
> loadrt hal_pru_generic prucode=$(HAL_RTMOD_DIR)/xenomai/pru_generic.bin
> pru=0 num_encoders=1 num_pwmgens=1 pru_period=2500 halname=hpg
> 
> > What needs to be put into the Xylotex  .ini and .hal file to make the
Beagle
> > PRU use a 1PPR sensor for the latest revision of MachineKit on the
Beagle?
> >
> > What needs to be put into the Xylotex  .ini and .hal file to make the
Beagle
> > PRU use eQEP0 for the latest revision of MachineKit on the Beagle?
> >
> 
> If you share the wiring of your Xylotex cape, I can prepare a example
> config for you based on my EMCO-120P files.
> Information needed is:
> - stepper motors: dir/step connections
> - spindle encoder: resolution and A/B/I connections (I assume eQEP0)
> - lead screws/stepper: number of steps per unit
> - unit: inch or mm
> - end-stop switches: connections and position (at min or max X/Z ?)
> - X/Z: travel
> - spindle motor: drive connections
> 
>  From that starting point you will be able to tune your own config by
> learning HAL and INI syntax.
> Always easier with a good example.
> 
> Frederic
> http://cnc.f1oat.org
> 
>
----------------------------------------------------------------------------
--
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to