Help me setting up My LinuxCNC

More
07 Jun 2024 07:59 #302515 by amanker
Help me setting up My LinuxCNC was created by amanker
I am using MKS Octopus Pro Board STM32F429 with Remora SPI and Raspberry PI4.
I wanted to use RPI5 but SPI is not working in LinuxCNC for rpi5. I am also using MPG Pendant (commonly available on eBay with MPG encoder with axis and scale selector and eStop.)

I am able to move steppers but I want to properly setup LinuxCNC with Kinamatics.

Whats Working.
1. Steppers moves
2. Limit/Home switches
3. PWM spindle
4. eStop
5. Touch Probe

I have made my machine to have two configurations. XYZAB(A Rotary on Table & B Rotating Spindle) and XYZAC (Its a common trinunion table)

My Problems.
1. I want to enable or disable my machine with Pendant (eStop Switch) not with GUI.
2. Stepper moves but on higher feed its slows down in middle of movement. Up 1000mm/sec its working. 1000-2200 not moving as expected slows down in middle. above 2200 joint follow error.
3. I want to implement both Kinamatics. XYZAC is available on linuxcnc forum but My type XYZAB config is not available(I googled a lot)


Here are my configuration files
ini file
# Basic LinuxCNC config for testing of Remora firmware

[EMC]
MACHINE = Remora-XY
DEBUG = 5
VERSION = 1.1

[DISPLAY]
DISPLAY = qtvcp qtdragon_hd

#USER_COMMAND_FILE = usercommand_regularmac_800.py


EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm
MAX_FEED_OVERRIDE = 1.2
MIN_SPINDLE_0_OVERRIDE = 0.5
MAX_SPINDLE_0_OVERRIDE = 1.5
DEFAULT_SPINDLE_0_SPEED = 1200
SPINDLE_INCREMENT = 200
MIN_SPINDLE_0_SPEED = 200
MAX_SPINDLE_0_SPEED = 1200
MAX_SPINDLE_POWER = 500
DEFAULT_LINEAR_VELOCITY = 15.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 40.00
DEFAULT_ANGULAR_VELOCITY = 25.00
MIN_ANGULAR_VELOCITY = 0
MAX_ANGULAR_VELOCITY = 50.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = ~/linuxcnc/nc_files
INCREMENTS = Continuous, 50mm, 10mm, 5mm, 1mm, .5mm, .1mm, .05mm, .01mm
#ANGULAR_INCREMENTS = 1,5,10,30,45,90
NGCGUI_SUBFILE_PATH = ~/linuxcnc/nc_files/examples/ngcgui_lib
# pre selected programs tabs
# specify filenames only, files must be in the NGCGUI_SUBFILE_PATH
NGCGUI_SUBFILE = slot.ngc
NGCGUI_SUBFILE = qpocket.ngc
#EMBED_TAB_NAME = Vismach 5 Axis
#EMBED_TAB_COMMAND = qtvcp vismach_5axis_gantry
#EMBED_TAB_LOCATION = tabWidget_utilities

[KINS]
JOINTS = 5
#KINEMATICS =trivkins coordinates=XYZ kinstype=BOTH
KINEMATICS =trivkins coordinates=XYZAC

[FILTER]
PROGRAM_EXTENSION = .py Python Script
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH = :~/linuxcnc/nc_files/examples/ngcgui_lib:~/linuxcnc/nc_files/examples/ngcgui_lib/utilitysubs; \
~/linuxcnc/nc_files/examples/probe/basic_probe/macros:~/linuxcnc/nc_files/examples/remap-subroutines: \
~/linuxcnc/nc_files/examples/ngcgui_lib/remap_lib
ON_ABORT_COMMAND=O <on_abort> call
RS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.0005 G80 G90 G94 G97 M5 M9

[MDI_COMMAND_LIST]
# for macro buttons
MDI_COMMAND = G0 Z25;X0 Y0;Z0, Goto\nUser\nZero
MDI_COMMAND = G53 G0 Z0;G53 G0 X0 Y0,Goto\nMachn\nZero

[PROBE]
#USE_PROBE = versaprobe
USE_PROBE = basicprobe

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 0
SERVO_PERIOD = 1000000

[HAL]
HALFILE = remora-xyz.hal
HALFILE = mpg.hal
POSTGUI_HALFILE = qtdragon_hd_postgui.hal
#POSTGUI_HALFILE = postgui_call_list.hal
HALUI = halui

[HALUI]

[TRAJ]
COORDINATES =  X Y Z A C
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_LINEAR_VELOCITY = 15.00
MAX_LINEAR_VELOCITY = 40.00
NO_FORCE_HOMING = 1 

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_X]
MAX_VELOCITY = 40.00
MAX_ACCELERATION = 500.0
MIN_LIMIT = 0.0
MAX_LIMIT = 300.0

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = 0.0
MAX_LIMIT = 300.0
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 500.0
SCALE = 1600
FERROR = 2
MIN_FERROR = 2.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_SEQUENCE = 0

[AXIS_Y]
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 20.0
MIN_LIMIT = 0.0
MAX_LIMIT = 200.0

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = 0.0
MAX_LIMIT = 200.0
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 2000.0
SCALE = 1600.00
FERROR = 9.0
MIN_FERROR = 5.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_SEQUENCE = 0




[AXIS_Z]
OFFSET_AV_RATIO = 0.2
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 20.0
MIN_LIMIT = 0
MAX_LIMIT = 200

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = 0
MAX_LIMIT = 200
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 300.0
SCALE = 1200.00
FERROR = 5
MIN_FERROR = 1.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_SEQUENCE = 0

[AXIS_A]
OFFSET_AV_RATIO = 0.2
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 20.0
MIN_LIMIT = 0
MAX_LIMIT = 360

[JOINT_3]
TYPE = ANGULAR
HOME = 0.0
MIN_LIMIT = 0
MAX_LIMIT = 360
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 300.0
SCALE = 71.111
FERROR = 5
MIN_FERROR = 1.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_SEQUENCE = 0

[AXIS_C]
OFFSET_AV_RATIO = 0.2
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 20.0
MIN_LIMIT = 0
MAX_LIMIT = 180

[JOINT_4]
TYPE = ANGULAR
HOME = 0.0
MIN_LIMIT = 0
MAX_LIMIT = 180
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 300.0
SCALE = 71.111
FERROR = 5
MIN_FERROR = 1.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_SEQUENCE = 0

Hal FIle 
# load the realtime components

    loadrt [KINS]KINEMATICS
    loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS

    #loadrt remora 

    loadrt remora chip_type=STM SPI_clk_div=32 PRU_base_freq=120000 
    #loadrt remora chip_type=LPC SPI_clk_div=64
        
# estop loopback, SPI comms enable and feedback
    net user-enable-out    <= iocontrol.0.user-enable-out        => remora.SPI-enable 
    net user-request-enable  <= iocontrol.0.user-request-enable    => remora.SPI-reset
    net remora-status     remora.SPI-status     => iocontrol.0.emc-enable-in
        
# add the remora and motion functions to threads

    addf remora.read servo-thread
    addf motion-command-handler servo-thread
    addf motion-controller servo-thread
    addf remora.update-freq servo-thread
    addf remora.write servo-thread
    


# Joint 0 setup

    setp remora.joint.0.scale         [JOINT_0]SCALE
    setp remora.joint.0.maxaccel     [JOINT_0]STEPGEN_MAXACCEL

    net xpos-cmd         <= joint.0.motor-pos-cmd     => remora.joint.0.pos-cmd  
    net j0pos-fb         <= remora.joint.0.pos-fb     => joint.0.motor-pos-fb
    net j0enable         <= joint.0.amp-enable-out     => remora.joint.0.enable


# Joint 1 setup

    setp remora.joint.1.scale         [JOINT_1]SCALE
    setp remora.joint.1.maxaccel     [JOINT_1]STEPGEN_MAXACCEL

    net j1pos-cmd         <= joint.1.motor-pos-cmd     => remora.joint.1.pos-cmd
    net j1pos-fb         <= remora.joint.1.pos-fb     => joint.1.motor-pos-fb 
    net j1enable         <= joint.1.amp-enable-out     => remora.joint.1.enable

# Joint 2 setup

    setp remora.joint.2.scale         [JOINT_2]SCALE
    setp remora.joint.2.maxaccel     [JOINT_2]STEPGEN_MAXACCEL

    net j2pos-cmd         <= joint.2.motor-pos-cmd     => remora.joint.2.pos-cmd
    net j2pos-fb         <= remora.joint.2.pos-fb     => joint.2.motor-pos-fb
    net j2enable         <= joint.2.amp-enable-out     => remora.joint.2.enable

# Joint 3 setup

    setp remora.joint.3.scale         [JOINT_3]SCALE
    setp remora.joint.3.maxaccel     [JOINT_3]STEPGEN_MAXACCEL

    net j3pos-cmd         <= joint.3.motor-pos-cmd     => remora.joint.3.pos-cmd
    net j3pos-fb         <= remora.joint.3.pos-fb     => joint.3.motor-pos-fb
    net j3enable         <= joint.3.amp-enable-out     => remora.joint.3.enable

# Joint 4 setup

    setp remora.joint.4.scale         [JOINT_4]SCALE
    setp remora.joint.4.maxaccel     [JOINT_4]STEPGEN_MAXACCEL

    net j4pos-cmd         <= joint.4.motor-pos-cmd     => remora.joint.4.pos-cmd
    net j4pos-fb         <= remora.joint.4.pos-fb     => joint.4.motor-pos-fb
    net j4enable         <= joint.4.amp-enable-out     => remora.joint.4.enable

# end-stops

    net X-min       remora.input.0         => joint.0.neg-lim-sw-in
#    net X-max       remora.input.1         => joint.0.home-sw-in joint.0.pos-lim-sw-in

    net Y-min       remora.input.2         => joint.1.neg-lim-sw-in
#    net Y-max       remora.input.3         => joint.1.home-sw-in joint.1.pos-lim-sw-in
    
    net Z-min       remora.input.4         => joint.2.neg-lim-sw-in
#    net Z-max       remora.input.5         => joint.2.home-sw-in joint.2.pos-lim-sw-in
    
# Probe 
    net probe-input motion.probe-input <= remora.input.6
#    net probe-input => qtdragon.led-probe
    
# Spindle

    loadrt pwmgen output_type=0
    addf pwmgen.update servo-thread
    addf pwmgen.make-pulses servo-thread
    net spindle-speed-cmd spindle.0.speed-out => pwmgen.0.value
    net spindle-on spindle.0.on => pwmgen.0.enable
    net spindle-pwm pwmgen.0.pwm => remora.output.0
# Set the spindle's top speed in RPM
    setp pwmgen.0.scale 12000
#    net spindle-speed-feedback spindle.0.speed-out-rps => spindle.0.speed-in


mpg.hal
# Jog Pendant
loadrt PRUencoder names=encoder.0
addf PRUencoder.capture-position servo-thread
setp encoder.0.position-scale 400.0
# connect the hal encoder to linuxcnc
net encoder-count <= remora.PV.0 => encoder.0.raw_count
loadrt conv_float_s32 count=1
addf conv-float-s32.0 servo-thread

loadrt mux4 count=1
addf mux4.0 servo-thread

# 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 joint.0.jog-vel-mode 1
setp joint.1.jog-vel-mode 1
setp joint.2.jog-vel-mode 1
setp joint.3.jog-vel-mode 1
setp joint.4.jog-vel-mode 1

# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001

# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= remora.input.10
net scale2 mux4.0.sel1 <= remora.input.9

# The output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux4.0.out
net mpg-scale => joint.0.jog-scale axis.x.jog-scale
net mpg-scale => joint.1.jog-scale axis.y.jog-scale
net mpg-scale => joint.2.jog-scale axis.z.jog-scale
net mpg-scale => joint.3.jog-scale axis.a.jog-scale
net mpg-scale => joint.4.jog-scale axis.c.jog-scale

# The MPG inputs
#net mpg-a encoder.0.phase-A <= remora.input.7
#net mpg-b encoder.0.phase-B <= remora.input.8

# The Axis select inputs
net mpg-x joint.0.jog-enable axis.x.jog-enable <= remora.input.11
net mpg-y joint.1.jog-enable axis.y.jog-enable <= remora.input.12
net mpg-z joint.2.jog-enable axis.z.jog-enable <= remora.input.13
net mpg-a joint.3.jog-enable axis.a.jog-enable <= remora.input.14
net mpg-c joint.4.jog-enable axis.c.jog-enable <= remora.input.15

# The encoder output counts to the axis. Only the selected axis will move.
net encoder-count   conv-float-s32.0.in
net encoder-counts  conv-float-s32.0.out


#net encoder-counts  <= encoder.0.counts
net encoder-counts => joint.0.jog-counts axis.x.jog-counts
net encoder-counts => joint.1.jog-counts axis.y.jog-counts
net encoder-counts => joint.2.jog-counts axis.z.jog-counts
net encoder-counts => joint.3.jog-counts axis.a.jog-counts
net encoder-counts => joint.4.jog-counts axis.c.jog-counts

qt_dragon_hd_postgui hal
# load components
########################################################################

loadrt logic names=logic-and personality=0x102
addf logic-and servo-thread

# load a summing component for adding spindle lift and Z compensation
loadrt scaled_s32_sums
addf scaled-s32-sums.0 servo-thread

loadusr -Wn z_level_compensation z_level_compensation
# method parameter must be one of nearest(2), linear(1), cubic (0)
setp z_level_compensation.fade-height 0.0
setp z_level_compensation.method 1

# connect signals
########################################################################

net spindle-speed-limited  =>  spindle.0.speed-out-rps => spindle.0.speed-in

# the unlink pin commands are only used, because they are connected 
# in core_sim.hal and we use this file to simulate
unlinkp iocontrol.0.tool-change
unlinkp iocontrol.0.tool-changed
unlinkp iocontrol.0.tool-prep-number

net tool-change      hal_manualtoolchange.change   <=  iocontrol.0.tool-change 
net tool-changed     hal_manualtoolchange.changed  <=  iocontrol.0.tool-changed
net tool-prep-number hal_manualtoolchange.number   <=  iocontrol.0.tool-prep-number

net eoffset-clear    axis.z.eoffset-clear
net eoffset-counts   axis.z.eoffset-counts
setp axis.z.eoffset-scale .001
net eoffset-total          axis.z.eoffset
net eoffset-total          qtdragon.eoffset-value
setp axis.z.eoffset-enable True

## external offsets for spindle pause function
##################################################
net eoffset-clear     qtdragon.eoffset-clear
net eoffset-spindle-count   <= qtdragon.eoffset-spindle-count    
net spindle-pause     qtdragon.spindle-inhibit spindle.0.inhibit
net probe-input qtdragon.led-probe

## Z level compensation
####################################################
net eoffset-clr2            z_level_compensation.clear      => logic-and.in-01
net xpos-cmd                z_level_compensation.x-pos      <= joint.0.motor-pos-cmd
net ypos-cmd                z_level_compensation.y-pos      <= joint.1.pos-cmd
net zpos-cmd                z_level_compensation.z-pos      <= joint.2.pos-cmd
net z_compensation_on       z_level_compensation.enable-in  <= qtdragon.comp-on
net eoffset-zlevel-count    z_level_compensation.counts     => qtdragon.eoffset-zlevel-count

net eoffset-spindle-count   scaled-s32-sums.0.in0
net eoffset-zlevel-count    scaled-s32-sums.0.in1
setp scaled-s32-sums.0.scale0 1000
net eoffset-counts          scaled-s32-sums.0.out-s


 

Please Log in or Create an account to join the conversation.

More
07 Jun 2024 17:55 #302546 by Aciera
Replied by Aciera on topic Help me setting up My LinuxCNC

3. I want to implement both Kinamatics. XYZAC is available on linuxcnc forum but My type XYZAB config is not available(I googled a lot)

Have you had a look at the kinematics I suggested here?
forum.linuxcnc.org/10-advanced-configura...configuration#300430



 

Please Log in or Create an account to join the conversation.

More
09 Jun 2024 23:11 #302717 by cakeslob
Replied by cakeslob on topic Help me setting up My LinuxCNC


My Problems.

2. Stepper moves but on higher feed its slows down in middle of movement. Up 1000mm/sec its working. 1000-2200 not moving as expected slows down in middle. above 2200 joint follow error.


if you were still having this issue, thats something you should have mentioned in the other thread, because it is directly related to remora, and its something I can fix relatively fast.

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 15:35 #302759 by amanker
Replied by amanker on topic Help me setting up My LinuxCNC
Because I wanted a proper configuration so I thought there are many experts who can help me with configuring linuxcnc.

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 16:08 #302760 by Aciera
Replied by Aciera on topic Help me setting up My LinuxCNC
Please do not double post about the same things.
It's really annoying for those of us who try to help and answer questions if people just turn around and ask the same things all over again in another thread.
If an answer does not work for you or you would like alternatives then please post that in the original thread. If somebody thinks of an alternative solution they will post that there, that way the information stays bundled also for other users searching for answers to similar questions in the future.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
10 Jun 2024 16:44 #302762 by cakeslob
Replied by cakeslob on topic Help me setting up My LinuxCNC

Because I wanted a proper configuration so I thought there are many experts who can help me with configuring linuxcnc.


its fine, they can help better, but that part was specific to remora, and you said yes you were good.

Also, if youre config has a problem with the encoder MPG counting, this would be the thread to ask about. you havent said anything about it really but my config counts 4x pulses for 1 MPG click, so I assume yours does too

Please Log in or Create an account to join the conversation.

More
13 Jun 2024 12:13 #302932 by amanker
Replied by amanker on topic Help me setting up My LinuxCNC
@aciera and @cakeslob.
It not intended to trouble anyone. Sorry if I have done unintentionally.

@cakeslob
I had problem in proper LinuxCNC configuration for working setup. This thread was created to get help from experts regarding LinuxCNC configurations. Regarding problems related to remora i always ask in relevant thread. Thats why I didn't mentioned about MPG thing.

@aciera
I have created this thread to get help from experts. Thats why i have included all my configuration files. So that I can keep it up with all configuration problems. Anyone using same setup can get help including all required configuration files at one place.

​​

Please Log in or Create an account to join the conversation.

More
13 Jun 2024 14:54 #302952 by cakeslob
Replied by cakeslob on topic Help me setting up My LinuxCNC
its fine, but the following error is me, but lets ask these guys if they know how we can do this.

we have a float output from a remora quadratic counting encoder module, and we want to use it for an MPG. we have converted the float to s32, but the encoder is counting quadratic

What hal logic components can we use to make the count.....not quadratic? so it counts 4 pulses for every one click of the MPG and we want 1 click, how can we use hal to make it work?

Please Log in or Create an account to join the conversation.

More
13 Jun 2024 15:07 #302953 by tommylight
Replied by tommylight on topic Help me setting up My LinuxCNC
CD4017 CMOS IC ? :)
Scaling should work, and see if there is a shift register component as that might also work, but scaling should be much easier.

Please Log in or Create an account to join the conversation.

More
19 Jun 2024 19:18 #303380 by amanker
Replied by amanker on topic Help me setting up My LinuxCNC
How can I configure my estop button on mpg pendent so that I need not to press estop and machine on button in LinuxCNC GUI. Estop and machine on controlled by estop button on MPG pendant.
​​​

Please Log in or Create an account to join the conversation.

Time to create page: 0.190 seconds
Powered by Kunena Forum