Advanced Search

Search Results (Searched for: estop_latch)

  • Sternfox
  • Sternfox
24 Dec 2024 18:25
Replied by Sternfox on topic Timed delay

Timed delay

Category: Advanced Configuration

Thanks for the code, im getting this error on startup ./main.hal:239: Pin 'xor.0.in0' does not exist

here is my hal file

# This file was created with the Mesa Configuration Tool on Nov 26 2024 15:50:59
# If you make changes to this file DO NOT run the configuration tool again!
# This file will be replaced with a new file if you do!

# kinematics
loadrt [KINS](KINEMATICS)

# motion controller
loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS]JOINTS num_dio=30 num_aio=30

# hostmot2 driver
loadrt hostmot2
loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="sserial_port_0=00000000"
loadrt oneshot count=1

setp hm2_[MESA](BOARD).0.watchdog.timeout_ns 10000000
loadrt timedelay count=1
loadrt xor2
loadrt pid names=pid.x,pid.y,pid.z,pid.s



# PID Information for Stepper Boards
# Mesa hardware step generators at every servo thread invocation, the step
# generator hardware is given a new velocity. Without feedback from the PID
# controller the hardware position would slowly drift because of clock speed and
# timing differences between LinuxCNC and the step generator hardware.
# The PID controller gets feedback from the actual (fractional) step position and
# corrects for these small differences.

# THREADS
addf hm2_[MESA](BOARD).0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_[MESA](BOARD).0.write servo-thread
addf timedelay.0 servo-thread
addf xor2.0 servo-thread



# DPLL TIMER
setp hm2_[MESA](BOARD).0.dpll.01.timer-us -50
setp hm2_[MESA](BOARD).0.stepgen.timer-number 1

# amp enable
#net motion-enable <= motion.motion-enabled => hm2_7i95.0.ssr.00.out-02

# Spindle Air Oil solenoid


# Board: 7i95

# Axis: X Joint: 0 Output: 0
# PID Setup
setp pid.x.Pgain [JOINT_0](P)
setp pid.x.Igain [JOINT_0](I)
setp pid.x.Dgain [JOINT_0](D)
setp pid.x.bias [JOINT_0](BIAS)
setp pid.x.FF0 [JOINT_0](FF0)
setp pid.x.FF1 [JOINT_0](FF1)
setp pid.x.FF2 [JOINT_0](FF2)
setp pid.x.deadband [JOINT_0](DEADBAND)
setp pid.x.maxoutput [JOINT_0](MAX_OUTPUT)
setp pid.x.error-previous-target True
# limit stepgen velocity corrections caused by position feedback jitter
setp pid.x.maxerror [JOINT_0](MAX_ERROR)

# joint-0 enable chain
net joint-0-index-enable <=> pid.x.index-enable
net joint-0-index-enable <=> joint.0.index-enable

net joint-0-enable <= joint.0.amp-enable-out
net joint-0-enable => pid.x.enable

net joint-0-enable => hm2_[MESA](BOARD).0.stepgen.00.enable

# Joint 0 Step Generator Settings
setp hm2_[MESA](BOARD).0.stepgen.00.dirsetup [JOINT_0](DIRSETUP)
setp hm2_[MESA](BOARD).0.stepgen.00.dirhold [JOINT_0](DIRHOLD)
setp hm2_[MESA](BOARD).0.stepgen.00.steplen [JOINT_0](STEPLEN)
setp hm2_[MESA](BOARD).0.stepgen.00.stepspace [JOINT_0](STEPSPACE)
setp hm2_[MESA](BOARD).0.stepgen.00.position-scale [JOINT_0](SCALE)
setp hm2_[MESA](BOARD).0.stepgen.00.maxvel [JOINT_0](STEPGEN_MAX_VEL)
setp hm2_[MESA](BOARD).0.stepgen.00.maxaccel [JOINT_0](STEPGEN_MAX_ACC)
setp hm2_[MESA](BOARD).0.stepgen.00.step_type 0
setp hm2_[MESA](BOARD).0.stepgen.00.control-type 1


# position command and feedback
net joint-0-pos-cmd <= joint.0.motor-pos-cmd
net joint-0-pos-cmd => pid.x.command

net joint-0-pos-fb <= hm2_[MESA](BOARD).0.stepgen.00.position-fb
net joint-0-pos-fb => joint.0.motor-pos-fb
net joint-0-pos-fb => pid.x.feedback

# PID Output
net joint.0.output <= pid.x.output
net joint.0.output => hm2_[MESA](BOARD).0.stepgen.00.velocity-cmd

# Axis: Y Joint: 1 Output: 1
# PID Setup
setp pid.y.Pgain [JOINT_1](P)
setp pid.y.Igain [JOINT_1](I)
setp pid.y.Dgain [JOINT_1](D)
setp pid.y.bias [JOINT_1](BIAS)
setp pid.y.FF0 [JOINT_1](FF0)
setp pid.y.FF1 [JOINT_1](FF1)
setp pid.y.FF2 [JOINT_1](FF2)
setp pid.y.deadband [JOINT_1](DEADBAND)
setp pid.y.maxoutput [JOINT_1](MAX_OUTPUT)
setp pid.y.error-previous-target True
# limit stepgen velocity corrections caused by position feedback jitter
setp pid.y.maxerror [JOINT_1](MAX_ERROR)

# joint-1 enable chain
net joint-1-index-enable <=> pid.y.index-enable
net joint-1-index-enable <=> joint.1.index-enable

net joint-1-enable <= joint.1.amp-enable-out
net joint-1-enable => pid.y.enable

net joint-1-enable => hm2_[MESA](BOARD).0.stepgen.01.enable

# Joint 1 Step Generator Settings
setp hm2_[MESA](BOARD).0.stepgen.01.dirsetup [JOINT_1](DIRSETUP)
setp hm2_[MESA](BOARD).0.stepgen.01.dirhold [JOINT_1](DIRHOLD)
setp hm2_[MESA](BOARD).0.stepgen.01.steplen [JOINT_1](STEPLEN)
setp hm2_[MESA](BOARD).0.stepgen.01.stepspace [JOINT_1](STEPSPACE)
setp hm2_[MESA](BOARD).0.stepgen.01.position-scale [JOINT_1](SCALE)
setp hm2_[MESA](BOARD).0.stepgen.01.maxvel [JOINT_1](STEPGEN_MAX_VEL)
setp hm2_[MESA](BOARD).0.stepgen.01.maxaccel [JOINT_1](STEPGEN_MAX_ACC)
setp hm2_[MESA](BOARD).0.stepgen.01.step_type 0
setp hm2_[MESA](BOARD).0.stepgen.01.control-type 1


# position command and feedback
net joint-1-pos-cmd <= joint.1.motor-pos-cmd
net joint-1-pos-cmd => pid.y.command

net joint-1-pos-fb <= hm2_[MESA](BOARD).0.stepgen.01.position-fb
net joint-1-pos-fb => joint.1.motor-pos-fb
net joint-1-pos-fb => pid.y.feedback

# PID Output
net joint.1.output <= pid.y.output
net joint.1.output => hm2_[MESA](BOARD).0.stepgen.01.velocity-cmd

# Axis: Z Joint: 2 Output: 2
# PID Setup
setp pid.z.Pgain [JOINT_2](P)
setp pid.z.Igain [JOINT_2](I)
setp pid.z.Dgain [JOINT_2](D)
setp pid.z.bias [JOINT_2](BIAS)
setp pid.z.FF0 [JOINT_2](FF0)
setp pid.z.FF1 [JOINT_2](FF1)
setp pid.z.FF2 [JOINT_2](FF2)
setp pid.z.deadband [JOINT_2](DEADBAND)
setp pid.z.maxoutput [JOINT_2](MAX_OUTPUT)
setp pid.z.error-previous-target True
# limit stepgen velocity corrections caused by position feedback jitter
setp pid.z.maxerror [JOINT_2](MAX_ERROR)

# joint-2 enable chain
net joint-2-index-enable <=> pid.z.index-enable
net joint-2-index-enable <=> joint.2.index-enable

net joint-2-enable <= joint.2.amp-enable-out
net joint-2-enable => pid.z.enable

net joint-2-enable => hm2_[MESA](BOARD).0.stepgen.02.enable

# Joint 2 Step Generator Settings
setp hm2_[MESA](BOARD).0.stepgen.02.dirsetup [JOINT_2](DIRSETUP)
setp hm2_[MESA](BOARD).0.stepgen.02.dirhold [JOINT_2](DIRHOLD)
setp hm2_[MESA](BOARD).0.stepgen.02.steplen [JOINT_2](STEPLEN)
setp hm2_[MESA](BOARD).0.stepgen.02.stepspace [JOINT_2](STEPSPACE)
setp hm2_[MESA](BOARD).0.stepgen.02.position-scale [JOINT_2](SCALE)
setp hm2_[MESA](BOARD).0.stepgen.02.maxvel [JOINT_2](STEPGEN_MAX_VEL)
setp hm2_[MESA](BOARD).0.stepgen.02.maxaccel [JOINT_2](STEPGEN_MAX_ACC)
setp hm2_[MESA](BOARD).0.stepgen.02.step_type 0
setp hm2_[MESA](BOARD).0.stepgen.02.control-type 1


# position command and feedback
net joint-2-pos-cmd <= joint.2.motor-pos-cmd
net joint-2-pos-cmd => pid.z.command

net joint-2-pos-fb <= hm2_[MESA](BOARD).0.stepgen.02.position-fb
net joint-2-pos-fb => joint.2.motor-pos-fb
net joint-2-pos-fb => pid.z.feedback

# PID Output
net joint.2.output <= pid.z.output
net joint.2.output => hm2_[MESA](BOARD).0.stepgen.02.velocity-cmd

# Manual Tool Change Dialog
loadusr -W hal_manualtoolchange
net tool-change-request => hal_manualtoolchange.change
net tool-change-confirmed <= hal_manualtoolchange.changed
net tool-number => hal_manualtoolchange.number

# create signals for tool loading loopback
net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed

# # Load Classicladder without GUI
loadrt classicladder_rt
addf classicladder.0.refresh servo-thread 1

# E-Stop Chain
loadrt estop_latch count=1
addf estop-latch.0 servo-thread

# E-Stop Loop
net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in
net estop-loopout estop-latch.0.ok-out => iocontrol.0.emc-enable-in

# E-Stop Reset
net estop-reset iocontrol.0.user-request-enable
net estop-reset => estop-latch.0.reset
net remote-estop0 estop-latch.0.fault-in <= hm2_7i95.0.inmux.00.input-01-not

# Input and output configuration
net button-press <= hm2_7i95.0.inmux.00.input-05 # Connect input pin 5 to signal button-press
net relay-1-control => hm2_7i95.0.ssr.00.out-01 # Connect signal relay-1-control to relay output 1
net relay-2-control => hm2_7i95.0.ssr.00.out-03 # Connect signal relay-2-control to relay output 3

setp timedelay.0.on-delay 1.0 # 1-second delay
setp timedelay.0.off-delay 0.0 # No off delay

# Timedelay connections
net button-press => timedelay.0.in xor.0.in0 # Link button-press to timedelay and logic
net relay-1-control <= timedelay.0.out xor.0.in1 # Link timedelay output to relay-1-control and logic
net relay-2-control <= xor.0.out # Link xor out to relay-2-control


#*******************
# SPINDLE
#*******************

setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
setp pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp pid.s.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.s.maxerror 0.012700

net spindle-index-enable => pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output

# Step Gen signals/setup

setp hm2_[MESA](BOARD).0.stepgen.03.dirsetup [SPINDLE_0]DIRSETUP
setp hm2_[MESA](BOARD).0.stepgen.03.dirhold [SPINDLE_0]DIRHOLD
setp hm2_[MESA](BOARD).0.stepgen.03.steplen [SPINDLE_0]STEPLEN
setp hm2_[MESA](BOARD).0.stepgen.03.stepspace [SPINDLE_0]STEPSPACE
setp hm2_[MESA](BOARD).0.stepgen.03.position-scale [SPINDLE_0]SCALE
setp hm2_[MESA](BOARD).0.stepgen.03.step_type 0
setp hm2_[MESA](BOARD).0.stepgen.03.control-type 1
setp hm2_[MESA](BOARD).0.stepgen.03.maxaccel [SPINDLE_0]STEPGEN_MAX_ACC
setp hm2_[MESA](BOARD).0.stepgen.03.maxvel [SPINDLE_0]STEPGEN_MAX_VEL

net machine-is-on => hm2_[MESA](BOARD).0.stepgen.03.enable
net spindle-vel-cmd-rps => hm2_[MESA](BOARD).0.stepgen.03.velocity-cmd
net spindle-vel-fb-rps <= hm2_[MESA](BOARD).0.stepgen.03.velocity-fb

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true
net spindle-manual-cw halui.spindle.0.forward
net spindle-manual-ccw halui.spindle.0.reverse
net spindle-manual-stop halui.spindle.0.stop
  • Mattias
  • Mattias
07 Nov 2024 23:56

Estop, external and internal with physical relay

Category: HAL

if estop-latch.N.ok-out goes false, one of these must have changed:

estop-latch.N.ok-in  goes false
estop-latch.N.fault-in goes true

So I would watch these in halshow or halscope to see whats happening.

I also don't understand why you have two estop latches. It seems that one
should be sufficient (adding some logic if you need to add fault inputs or OK inputs)

 

Hi, thank you for your quick reply. I have been looking at these halshow/scope bits but could not get it to click.

I have tried with two latches, with the idea that one will be for external estop (input 00) and the other for software internal estop (user enable out).
I also tried with one, linking the ok-in for user-enable out and fault-in to input00 external estop. No succes.

I will keep trying, thanks.

If you have any more sugestions i would be happy to hear them.
  • PCW
  • PCW's Avatar
07 Nov 2024 18:45 - 07 Nov 2024 18:53

Estop, external and internal with physical relay

Category: HAL

if estop-latch.N.ok-out goes false, one of these must have changed:

estop-latch.N.ok-in  goes false
estop-latch.N.fault-in goes true

So I would watch these in halshow or halscope to see whats happening.

I also don't understand why you have two estop latches. It seems that one
should be sufficient (adding some logic if you need to add fault inputs or OK inputs)



 
  • Mattias
  • Mattias
07 Nov 2024 16:46 - 07 Nov 2024 23:39

Estop, external and internal with physical relay

Category: HAL

Hi guys,

I have been trying for a couple of days to get the e stop to work on my diy cnc router.
I have an safety circuit which connects 24v supply to a relay(which switches on motor powers).  Output 00 of mesa card 7i95t and 4 physical estop NC are wired in series to this safety circuit.
In parallel i have wired this circuit to mesa input 01.

Here is my hal io code.
# E-Stop Chain
loadrt estop_latch count=2
addf estop-latch.0 servo-thread
addf estop-latch.1 servo-thread

net estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset => estop-latch.1.reset
net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in
net latch0-faultout estop-latch.0.fault-out
net latch1-okin estop-latch.1.ok-in <= estop-latch.0.ok-out => hm2_7i95.0.ssr.00.out-00
net latch1-faultin estop-latch.1.fault-in <= hm2_7i95.0.inmux.00.input-01-not
net latch1-out estop-latch.1.ok-out => iocontrol.0.emc-enable-in

I have many more attempts but this one came the closest. It triggers the relay for a second but does not 'stick'.
I want to reset with gui request enable en trip the circuit with either estop external button or software internal button on gui.
Can anybody please point me in the right direction, i have tried so many things and i get maybe more confused by the day
 
  • Benb
  • Benb's Avatar
25 Aug 2024 01:49
Is software Estop allowed was created by Benb

Is software Estop allowed

Category: HAL

Software Estop in the form of UI/HMI touchscreen, flat panel display driven by mouse/keyboard, software commands (G code …) and membrane switches are NOT ALLOWED.

Control regulation rules (common sense) calls for external hardwired red mushroom push button.
Emergency stop push button must be designed to fulfill the following requirements:
  • Mushroom-head shape to make it easy to push
  • Coloured red and mounted on a bright yellow background
  • Push button must remain in latched position after it has been pushed
  • Resetting of the Estop by pulling or twisting alone shall not resume operation. A second deliberate action is needed, such as the pressing of a reset button
  • Must be located at each operator control station and at any other location where an emergency stop would be required
Now, Linuxcnc has built-in software estops (halui) and estop latch (iocontrol) these components should only used for testing and simulation. Any machine larger than coffee maker that can cause harm must be equipped with an external hardwired Estop push button and a reset button.Linuxcnc ‘gate keepers’ should warn users that - software estops are not allowed - for safety sake.The only OEM that I know uses Linuxcnc software is ‘Tormach’. If you take look at their machines, they equipped their  machines with an external hardwired Estop and reset/start push buttons, the reason liability.I am only trying to raise awareness about software estop, I am not trying to spread fear or trash Linuxcnc, to the contrary Linuxcnc is an excellent piece of software. However, Estops, safety devices and watchdogs must be built external to any controller including PLC, DCS, redundant controller …
  • amanker
  • amanker
17 Aug 2024 14:56

Setting Up BLDC spindle motor in Forward/Reverse direction.

Category: Basic Configuration

I have setup linuxCNC using remora.
Its working nice. I want to replace PWM DC motor with BLDC motor.
BLDC contoller has enable and direction pins and 0-10V input pin. I am using PWM tp 0-10V converter.
When I use spindle i forward direction then its working. But in reverse direction its not rotating. I confirmed manullly that spindle/contoller is working ok in both direction.
I can see m3 and m4 signals properly triggering suitable pins. on m3 and m4 I can see enable pin is getting voltage. and like wise direction pin is also working ok. 
But I have noted that PWM out is only working in forward direction. In case of m4 there is no PWM out on pin.
Please help me.
Here is my 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-eth 

    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
    setp remora.joint.0.deadband     [JOINT_0]DEADBAND
    setp remora.joint.0.pgain     [JOINT_0]P_GAIN
    setp remora.joint.0.ff1gain     [JOINT_0]FF1_GAIN

    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
    setp remora.joint.1.deadband     [JOINT_1]DEADBAND
    setp remora.joint.1.pgain         [JOINT_1]P_GAIN
    setp remora.joint.1.ff1gain     [JOINT_1]FF1_GAIN

    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
    setp remora.joint.2.deadband     [JOINT_2]DEADBAND
    setp remora.joint.2.pgain         [JOINT_2]P_GAIN
    setp remora.joint.2.ff1gain     [JOINT_2]FF1_GAIN

    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
    setp remora.joint.3.deadband     [JOINT_3]DEADBAND
    setp remora.joint.3.pgain         [JOINT_3]P_GAIN
    setp remora.joint.3.ff1gain     [JOINT_3]FF1_GAIN

    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
    setp remora.joint.4.deadband     [JOINT_4]DEADBAND
    setp remora.joint.4.pgain         [JOINT_4]P_GAIN
    setp remora.joint.4.ff1gain     [JOINT_4]FF1_GAIN

    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 X-max       remora.input.1         => 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 Y-max       remora.input.3         => 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
#    net Z-max       remora.input.5         => joint.2.pos-lim-sw-in    
    net A-max        remora.input.6            => joint.3.home-sw-in 
    
    
# Probe
#loadrt debounce cfg=1
#addf debounce.0 servo-thread
#setp debounce.0.delay 100
#unlinkp motion.probe-input
#net probe-in debounce.0.0.in
#net probe-filt debounce.0.0.out => motion.probe-input 
    net probe-input motion.probe-input <= remora.input.7
#    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
    loadrt scale count=7
    addf scale.0 servo-thread
    addf scale.1 servo-thread
    setp scale.0.gain 0.008333 # PWM per RPM, calculated over full scale. Example: 0-100 PWM, 12000 rpm: (100/12000)  = 0.008333
    net spindle-scale-in spindle.0.speed-out => scale.0.in scale.1.in
    net spindle-speed-scaled scale.0.out => remora.SP.0 
    # spindle enable pin
    net spindle-enable spindle.0.on => remora.output.1
    # spindle DIR pin change to where ever it goes
    net spindle-rev spindle.0.reverse => remora.output.2
    setp scale.1.gain 0.000965
    #net spindle-amp-in spindle.0.speed-out => scale.1.in




    #net remora-status => halui.machine.on
    #net user-enable-out => halui.estop.reset
    #net remora-status remora.SPI-status => estop_latch.ok-in
    #net estop-status estop_latch.ok-out => iocontrol.0.emc-enable-in
    net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
    

  • rodw
  • rodw's Avatar
13 Aug 2024 13:28
Replied by rodw on topic Ein Neuling sucht Hilfe

Ein Neuling sucht Hilfe

Category: Deutsch

Best practice for installing an external estop is to use the estop-latch component.
Fortunately, there u=is an example on the forum
forum.linuxcnc.org/47-hal-examples/25861-external-e-stop

People will offer other ideas but this is the safest way and it will introduce you to hal :)
This video might help

 
  • rodw
  • rodw's Avatar
24 Jul 2024 12:42

Capturing a pin remaining True for a certain period of time

Category: HAL

Remember, estop is an important safety feature. estop-latch is the correct method to implement it. Please watch this video

When using multiple instances, I find it best to sketch out a block diagram as it can be confusing
  • rodw
  • rodw's Avatar
24 Jul 2024 08:52

Capturing a pin remaining True for a certain period of time

Category: HAL

First get familiar with the estop-latch component. Chain 2 together. One for the estop button and another for this component.
Then you could try a time delay component.

I that does not work out, write your own component that monitors the fault pin. When it changes state, set a flag (maybe call it error_set) then in another variable (error_time) accumulate the time its on for
if (error_set){
  error_time += fperiod;
  if (error_time > error_delay) 
    do something
  }
}
  • thomaseg
  • thomaseg
17 Jul 2024 12:43 - 17 Jul 2024 12:43
Replied by thomaseg on topic Safety relay and e-stop in LCNC?

Safety relay and e-stop in LCNC?

Category: Basic Configuration

Yeah i saw your description in another post and they look very similar. After seeing the discussion you had, i've already decided to do a minor change to the estop-button-circuit. The button itself have a NC and a NO connector, but i'm going to change the NO-contactor so i'm getting 2xNC instead and then put them in series and make that part redundant aswell... thanks for the inspiration ;-)

I also should have mentioned the estop-latch component allows you to build an estop chain in hal.

yes, i've studied that part, but i'm very unsure how to couple it with the hardware latch in the safety relay. My thoughts so far, see if it is clear and makes sense:
  • The physical estop triggers, this sends estop-signal to LinuxCNC and automatically kills servos after set amount of time.
  • The estop-signal sent to LinuxCNC triggers the estop-latch inside LinuxCNC and stops everything "on the software side" including estopping servers via EtherCAT.
  • The physical reset-button is connected to IO-pin instead of directly to safety relay. When pushed it sends signal to LinuxCNC estop latch to "open" disabling software estop.
  • When LinuxCNC estop goes into normal operation mode it sends a "oneshot" signal to the safety-relay to cause a reset of the physical latch

Does that make sense? As far as i can see i get "the best of both worlds", right? The only missing part is that i won't be able to trigger an estop from software, but i'm not sure i need that? It could be solved by a redundant relay in the physical estop chain, triggered by IO from LinuxCNC...but not sure if it is needed in any way...

/Thomas
  • rodw
  • rodw's Avatar
17 Jul 2024 12:20
Replied by rodw on topic Safety relay and e-stop in LCNC?

Safety relay and e-stop in LCNC?

Category: Basic Configuration

I also should have mentioned the estop-latch component allows you to build an estop chain in hal.
  • thomaseg
  • thomaseg
16 Jul 2024 21:26
Safety relay and e-stop in LCNC? was created by thomaseg

Safety relay and e-stop in LCNC?

Category: Basic Configuration

Hi,

After advise from this forum I built my machines estop functions around a safety relay from Abb Sentry USR22. So i have dedicated hardware just for handling the latching, i have redundant safety contactors to take power to all moving parts and so on. Everything works all by itself and doesn't need LCNC to function. I can run the estop functions with LCNC completely turned off, just as i think it should work.

But I choose the USR22 since it have 2 groups of relays with a timed delay between them. In case of a estop, i'd like to first tell LCNC via the first relay that "shit has hit the fan, stop everything!" This happens via a simple IO-pin. Then after 400ms or so the safety relay will kill the power to servo-drives nomatter what via the 2nd relay...regardless of what LCNC do/did. The idea was that i would give the software a small window to command the servo-drives to do a estop via software(or do a "quickstop", whatever i can make work) and also the possibility to stop anything else that might need stopping, but isn't "deadly"(e.g. floodcoolant pump, liquid cooling system etc)...

But i'm unsure how to wire this in HAL for it to work properly inside LCNC. It seems like all examples are assuming that i just have the estop-button connected directly to a IO pin and then need LCNC to do the heavylifting in software. But this is not the case here. I want LCNC to do a "software estop" as fast as possible and likely also turn off other "non-critical stuff". I would also want LCNC to accept that the estop-condition is resolved whenever the IO-pin changes back again(no extra latching in software, i got all that in hardware). So the estop-latch examples doesn't quite fit as far as i can tell.

The signal from my safety relay is either high or low depending on the state of the estop. I tried to wire this to iocontrol.0.emc-enable-in, but this isn't quite right and i was curious if others have found a good way of doing this "properly"? Or has ideas how to do this?

/Thomas
Displaying 31 - 42 out of 42 results.
Time to create page: 0.996 seconds
Powered by Kunena Forum