585,670 active members*
4,337 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2023
    Posts
    2

    Encoder signals to BBB

    Hello

    I have made my DIY CNC milling machine with BeagleBone Black (Machinekit) and DIY cape. I used ARM.BeagleBone.Xylotex setup as base and modified that to work with my machine.
    I used old Omron servo drivers and motors with DIR and STEP signals. It kinda works but now I'd like to add feedback signals from servos to BBB (2048 pls/rev).

    So there is quadrature signals from X, Y and Z. I'm planning to use these pins P9:25, P9:27, P9:28, P9:29, P9:30, P9:31
    I have understood that these pins are in PRU0 and first I have to config the those as "pruin" in setup.sh file?

    Then the ini-file now:
    [PRUCONF]
    DRIVER=hal_pru_generic
    CONFIG=pru=1 num_stepgens=3
    PRUBIN=xenomai/pru_generic.bin

    so can I change it to:
    CONFIG=pru=0 num_stepgens=3 num_encoders=3

    And how to I do the HAL wiring?

    Here is the pins that are in use now:
    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
    P9.15 out # gpio1.16 Z_Step
    P9.23 out # gpio1.17 Z_Dir
    P8.09 in # gpio2.5 STOPin
    Are these step/dir signals used by PRU 1? Or can I use these with PRU 0?

  2. #2
    Join Date
    Nov 2023
    Posts
    2

    Re: Encoder signals to BBB

    I got it working. At least with X axis. I have to do some pid and servo tuning, but at least the position feedback is working.

    In the .ini file I have:
    CONFIG=pru=0 num_stepgens=3 num_encoders=3 disabled=0

    and in .hal file:
    setp hpg.encoder.00.chan.00.A-pin 7
    setp hpg.encoder.00.chan.00.B-pin 5
    setp hpg.encoder.00.chan.00.scale [AXIS_0]ENCODER_SCALE

    net motor.00.pos-fb <= hpg.encoder.00.chan.00.position axis.0.motor-pos-fb pid.0.feedback

    And I didn't understand at first where I can get the number (A-pin 7 and B-pin 5). They can be found in the pinmux.ods file (https://github.com/cdsteinkuehler/be...ric/pinmux.ods) from column K
    A P9:25 -> pr1_pru0_pru_r31_1 -> 1
    B P9:27 -> pr1_pru0_pru_r31_5 -> 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •