Hello guys,
Trying to set up two things :
1) I want my machine to be enabled as soon as I disengage the estop, so halui.machine.is-on is true when the estop is not pressed.
I already have this
# --- Physical E-stop on INPUT27 ---
# Normally open: 0 = OK, 1 = E-stop pressed
net estop-in <= hm2_7i76e.0.7i76.0.0.input-27
net estop-in => iocontrol.0.emc-enable-in
I tried a lot of different ways but unsuccessfully. The most I could do was that the machine was on at start, when the estop was not pushed, but after cycling the estop, the machine would not get back to its on state.
# Load the required components
loadrt toggle2nist
loadrt timedelay
loadrt oneshot
# Add functions to threads
addf toggle2nist.0 servo-thread
addf timedelay.0 servo-thread
addf oneshot.0 servo-thread
# Configure components
setp timedelay.0.on-delay 2.0
setp timedelay.0.off-delay 0.0
setp oneshot.0.width 0.1 # Short pulse
# Create a not component for inversion (using existing not component)
loadrt not names=not.estop
addf not.estop servo-thread
# Connect iocontrol.0.user-enable-out to not component
net user-enable-status iocontrol.0.user-enable-out => not.estop.in
# Detect estop clearance edge (inverted signal)
net estop-cleared <= not.estop.out
net estop-cleared => oneshot.0.in
net estop-pulse oneshot.0.out => timedelay.0.in
# Use existing machine status signal
net machine-is-on => toggle2nist.0.is-on
# Connect delayed pulse to toggle
net delayed-pulse timedelay.0.out => toggle2nist.0.in
# Connect toggle output
net machine-on-toggle toggle2nist.0.on => halui.machine.on
Can you guys tell me why it does not work, what I am doing wrong or forgot?
2) I tried adding an MPG, but I am lost and the documentation is not very helpful for a beginner.
I am wiring my mpg as described in the attached picture but I was not able to make it work :
Here is the wiring for my pins on my mesa 7i76e :
5) **Jog MPG** (hm2_7i76e.0.7i76.0.0.enc0.count)
| TB3 pin | Name | MPG contact |
|:---|:-----| :--- |
| 9 | GND | VCC |
| 12 | +5VP | GND |
| TB5 pin | Name | MPG contact |
|:---|:-----| :--- |
| 1 | INPUT16 | A+ |
| / | / | A- |
| 2 | INPUT17 | B+ |
| / | / | B- |
6) **Jog enabling button**
| TB5 pin | Name | HAL name |
|:---|:-----|:---|
| 5 | INPUT20 | hm2_7i76e.0.7i76.0.0.input-20 |
7) **Speed selector button**
| TB5 pin | Name | Position |
|:---|:-----|:---|
| 6 | INPUT21 | X1 |
| 7 | INPUT22 | X100 |
If none is selected, the speed is X10
8) **Axis selector button**
| TB5 pin | Name | Position |
|:---|:-----|:---|
| 8 | INPUT23 | X |
| 9 | INPUT24 | Z |
So, if someone has the code for an mpg wired like that, on a 7i76e, I would really appreciate it!
My ini and hal files are attached.