Need help in choosing controller board from small honby cnc.

More
01 Jun 2024 18:35 #302089 by cakeslob
ahh shit i forgot since its rotary axis
net mpg-scale <= mux4.0.out
net mpg-scale => joint.0.jog-scale
net mpg-scale => joint.1.jog-scale
net mpg-scale => joint.2.jog-scale
#net mpg-scale => axis.a.jog-scale
#net mpg-scale => axis.c.jog-scale

so you also need 2 separate jogscales for the rotary units?

re:estop
I honestly dont remember what i said for estop, but here I have a new idea.
here is a hardware based estop that it connected to remora, it doesnt count as an IO pin because it happenes inside remora. I just tested it, and it works. add this to your config.txt, and there is nothing you need to connect to in hal for this estop. change the pin to whatever
    "Thread": "Servo",
    "Type": "eStop",
            "Comment":                      "estop pin",
            "Pin":                          "PB_3"
   	 },

for your encoder, the config looks liek this (unsure if you used it yet)change your pins/modifier as needed
{
    "Thread": "Base",
    "Type": "Encoder",
            "Comment":                      "MPG encoder",
            "ChA Pin":                      "PA_5",
            "ChB Pin":                      "PA_6",
            "Modifier":                     "Pull Up",
            "PV[i]":                        0,

    },

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

More
01 Jun 2024 18:44 #302090 by cakeslob

Why I cant move any axis faster than 650mm/min?


can you give me more details on this?
the only thing I can see that matches this speed, is your setting in the INI file, under DISPLAY
MAX_LINEAR_VELOCITY = 10.00

This might limit your jog sliders and stuff to 600mm/min

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

More
01 Jun 2024 19:02 #302091 by amanker
Thanks for such an elaborate reply.
First about encoder.
Yes I have tried using PRUencoder component. Which I learnt from you remora documents site and defined appropriate remora.PV.0 in config.txt.
But then also same pin type mismatch error of s32 and float. Then I used linuxcnc encoder. And thanks you have explained that s32 thing. I will try again using float to s32 conversion as you mentioned.

Second about Estop. I thought I have posted my config.txt. I looked back my replies and found that I forgot to include that.
Yes I have already defined estop and reset pins. As you mentioned in your example. But estop not working. May be because I wired my estop to ground. (When estop pressed that pin goes to ground)

About jog speed.
No that ini thing is not limiting jog speed from mpg pendant. Its limiting jog speed in UI. I have tested it. When jog speed cross approx 650-700 then joint follow error comes. First I thought my stepper is stalling on this speed. But later on axis which dont have stepper wired also had same issue. While using pendant jog speed shows above 1000 but if use UI then it limits to 600 as I capped in config. I capped it because it was giving error above this speed.

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

More
01 Jun 2024 19:29 #302093 by amanker
About delay in switching axis may be due to I am using servo thread for that function. But as per LinuxCNC examples I should use base thread. But base thread gives me error so I had to change it to servo thread.
Its like. If I selct X axis and jog using pendant, then if I switch to Y axis, then X axis keeps on moving along with selected Y axis while jogging from pendant for few secs, may be 20 secs, after that only Y axis moves as expected.
Same thing also happens when I change scale x1,x10,x100.

About slow feed on steppers, i thought It may be due to I using wrong clk div or pru frequency. Or may SPI limitation. But that can't be true.

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

More
01 Jun 2024 19:36 #302095 by cakeslob
estop : yeah the estop needs to be normally closed if you are using the hardware remora config version. with the remora config version, you dont need to use an IO, or connect it to a hal pin. I did a quick test with a microswitch, and it has to be closed to reset. I dont know how to do motor power without using an IO pin

When jog speed cross approx 650-700 then joint follow error comes.


ok, thats what i needed. we will have to refine some of your settings

can you post your current ini file? well have to look at the speeds/accel you are trying to do

but first you can try this, lets increase the performance of your board. lets try doubling the base thread freq. the f429 should be able to without issue

in your hal file, do this. this will tell the remora comp our new basethread
loadrt remora chip_type=STM SPI_clk_div=32 PRU_base_freq=80000


now add this to your config.txt, this will tell the remora firmware our new basethread,
"Threads":[
	{
	"Thread": "Base",
	"Frequency": 80000
	}
	],


I have added it to the section of your config file, so it should look like this in your config, and dont forget the commas. run the config through the json checker when you are done to make sure
jsonlint.com/
"Board": "BIGTREETECH SKR OCTOPUS PRO V1.0",
"Threads":[
	{
	"Thread": "Base",
	"Frequency": 80000
	}
	],

   "Modules":[
    {
    "Thread": "Servo",
    "Type": "Reset Pin",
        "Comment":            "Reset pin",
        "Pin":                "PC_15"
    },

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

More
01 Jun 2024 19:53 #302099 by cakeslob
yes, im pretty sure you are correct about the switching delay. it is probably related to parallel port linuxcnc setups which use the base thread. with remora, we are only using the servo thread as part of linuxcnc.


Now, this next part is going to make the previous post more confusing.

remora to linuxcnc/rpi is only using the servo thread. internally, remora is using the basethread between the component to the hardware.

The following error occurs because linuxcnc is sending out more step pulses than remora hardware can physically do (with the given parameters). remora sees there are too many steps to process, sends a following error instead of missing steps.

but yes, you are correct, it is tied to our base thread pru freq, the default for remora is set to a conservative lower level. I would keep the clk div at 32, and play with the pru_freq settings. keep in mind the pru_freq needs to be the same between the hal file and the config file. i would progressively try increasing your settings until you find an acceptable level. on the flexihal, they are using 120, but I dont think you will be able to get that high. try with 80 and see if you get issues.

once you have a higher pru, you can try and tune in your axis speeds n stuff. you will probably need to tune your velocity/accel, but your scale setting will play a large part in your max speed setting. if you have a really high stepscale, you will limit your max speed, so you might need to compromise on the microstep scale


also, when you are satisfied, do you think you could post your linuxcnc configuration/config for remora, so that it may be used as an example/sample config for other users? you are pushing the limits a bit and i like it. I appreciate your patience with this whole process, you have a less conventional setup, so its makign my brain work harder, but i think it would make a good example config.


also if you feel comfortable, when you are good, can you post a pic/video of your thing using remora?

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

More
01 Jun 2024 20:13 - 01 Jun 2024 20:21 #302101 by amanker
Thanks again for such a prompt and well explained reply.
I will first try increasing PRU frequency to 80000.
Then I will test again.
One confusion, estop should be wired to +5v or gnd? I am using gnd. And this is true for all inputs and using invert=true in config.txt.

On using inbuilt estop and encoder it will free my 2 input pins. That will be useful for me. Since MPG encoder is using too many pins.

Yes, I would love to give every input I can, for such a great product.
Last edit: 01 Jun 2024 20:21 by amanker.

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

More
01 Jun 2024 20:22 #302103 by cakeslob
lol, i was gonna spend my morning working on the ethernet firmware, but your questions were much more fun, because I had to work for the answers. But at this point in time, because you are probably maxing out remora firmware. so even if I do support the f429 in the ethernet, I will also need to add some other parts to the firmware as well. all things I planned to do eventually, but adding encoder has to ethernet has been harder than expected. I am sure the RPi5 spi will be supported soon enough.

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

More
01 Jun 2024 20:25 #302104 by cakeslob
yeah, Im doing my inputs to gnd also. when using the estop module in the config, if the estop is clickd down, that should be the same result as if there is no estop connected, which will raise an error on linuxcnc about estop being open, and you wont be able to enable the machine. estop needs to be normally closed , then you can enable the machine power.

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

More
02 Jun 2024 11:10 #302137 by amanker
End Stop Still Not working. Its N/C type. AND I have wired to GND. So Estop pin will be on GND normally. But When its pressed GND will be open.
My Config.txt
{
    "Board": "BIGTREETECH SKR OCTOPUS PRO V1.0",
    
    "Threads":[
    {
    "Thread": "Base",
    "Frequency": 80000
    }
    ],
    
    "Modules":[
    {
    "Thread": "Servo",
    "Type": "Reset Pin",
        "Comment":            "Reset pin",
        "Pin":                "PC_15"
    },
    {
    "Thread": "Base",
    "Type": "Stepgen",
        "Comment":            "X - Joint 0 step generator",
        "Joint Number":        0,
        "Step Pin":         "PF_13",
        "Direction Pin":     "PF_12",
        "Enable Pin":         "PF_14"
    },
    {
    "Thread": "Base",
    "Type": "Stepgen",
        "Comment":            "Y - Joint 1 step generator",
        "Joint Number":        1,
        "Step Pin":         "PG_0",
        "Direction Pin":     "PG_1",
        "Enable Pin":         "PF_15"
    },
    {
    "Thread": "Base",
    "Type": "Stepgen",
        "Comment":            "Z - Joint 2 step generator",
        "Joint Number":        2,
        "Step Pin":         "PF_11",
        "Direction Pin":     "PG_3",
        "Enable Pin":         "PG_5"
    },
    {
    "Thread": "Base",
    "Type": "Stepgen",
        "Comment":            "E0 - Joint 3 step generator",
        "Joint Number":        3,
        "Step Pin":         "PG_4",
        "Direction Pin":     "PC_1",
        "Enable Pin":         "PA_0"
    },
    {
    "Thread": "Base",
    "Type": "Stepgen",
        "Comment":            "E1 - Joint 4 step generator",
        "Joint Number":        4,
        "Step Pin":         "PF_9",
        "Direction Pin":     "PF_10",
        "Enable Pin":         "PG_2"
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "X min",
        "Pin":                "PG_6",
        "Mode":                "Input",
        "Data Bit":            0
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "X max",
        "Pin":                "PG_9",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            1
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Y min",
        "Pin":                "PG_10",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            2
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Y max",
        "Pin":                "PG_11",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            3
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Z min",
        "Pin":                "PG_12",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            4
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Z max",
        "Pin":                "PG_13",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            5
    },
    
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Probe",
        "Pin":                "PC_5",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            6
    },

    {
        "Thread": "Base",
        "Type": "Encoder",
            "Comment":                      "MPG encoder",
            "ChA Pin":                      "PE_7",
            "ChB Pin":                      "PE_8",
            "Modifier":                     "Pull Up",
            "PV[i]":                        0

        },
    

    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "X1",
        "Pin":                "PE_9",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            9
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "X10",
        "Pin":                "PE_10",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            10
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Axis X",
        "Pin":                "PE_12",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            11
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Axis Y",
        "Pin":                "PE_13",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            12
    },
    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Axis Z",
        "Pin":                "PE_14",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            13
    },

    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Axis A",
        "Pin":                "PE_15",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            14
    },

    {
    "Thread": "Servo",
    "Type": "Digital Pin",
        "Comment":            "Axis C",
        "Pin":                "PB_1",
        "Mode":                "Input",
        "Invert":            "True",
        "Data Bit":            15
    },


    {
    "Thread": "Servo",
    "Type": "Estop Pin",
        "Comment":            "Estop pin",
        "Pin":                "PF_3"

    },


    {
        "Thread": "Servo",
        "Type": "Digital Pin",
                "Comment":                      "PWM0",
                "Pin":                      "PA_8",
                "Mode":                          "Output",
        "Data Bit":            0

        }

    ]
}

My Remora HAL
# 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=80000
    #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

My Remora INI
# 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 = 10.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 24.00
DEFAULT_ANGULAR_VELOCITY = 36.00
MIN_ANGULAR_VELOCITY = 0
MAX_ANGULAR_VELOCITY = 45.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

[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 = 50000
SERVO_PERIOD = 1000000

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

[TRAJ]
COORDINATES =  X Y Z A C
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_LINEAR_VELOCITY = 10.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 = 20.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 = 20.0
STEPGEN_MAXACCEL = 2000.0
SCALE = 1600
FERROR = 2
MIN_FERROR = 2.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 2.0
HOME_LATCH_VEL = 2.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 = 2.0
HOME_LATCH_VEL = 2.0
HOME_SEQUENCE = 1




[AXIS_Z]
OFFSET_AV_RATIO = 0.2
MAX_VELOCITY = 20.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 = 20.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 = 35.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 = 35.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 = 35.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 = 35.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

My MPG HAL
# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
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

# 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.9
net scale2 mux4.0.sel1 <= remora.input.10

# 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
net mpg-scale => joint.1.jog-scale
net mpg-scale => joint.2.jog-scale
#net mpg-scale => axis.a.jog-scale
#net mpg-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 <= remora.input.11
net mpg-y joint.1.jog-enable <= remora.input.12
net mpg-z joint.2.jog-enable <= remora.input.13
#net mpg-a axis.a.jog-enable <= remora.input.14
#net mpg-c axis.c.jog-enable <= remora.input.15

# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts  <= encoder.0.counts
net encoder-counts => joint.0.jog-counts
net encoder-counts => joint.1.jog-counts
net encoder-counts => joint.2.jog-counts
#net encoder-counts => axis.c.jog-counts

My QT_Dragon POST_GUI 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.

Moderators: PCWjmelson
Time to create page: 0.319 seconds
Powered by Kunena Forum