- Posts: 224
- Thank you received: 0
halui
2 years 3 months ago #305496
by slowpoke
I'm making a physical knob & push-button interface for Axis. I have an Arduino board that is successfully sending and receiving messages with Axis.
The next thing I want to try/test is push one of the physical buttons and then link that incoming message (that I can presently observe in HalShow) to cause the X axis to jog one increment in the positive direction. Assume I have already selected the X axis and set the jog increment, I just need to activate the "+" jog button. I searched through all the pins, signals etc in HalShow and could not find that "+ jog button", the closest thing I found was joint.0.kb-jog-active that gets activated when I click on the jog button, so not exactly what I need.
In the LinuxCNC HAL tutorial part 2, he has a bunch halui signals defined in his custom_postgui.hal file (see below). Can I simply replicate what he has done to get access to these signals or do I need to something else to expose the pins shown in the right hand column?
The next thing I want to try/test is push one of the physical buttons and then link that incoming message (that I can presently observe in HalShow) to cause the X axis to jog one increment in the positive direction. Assume I have already selected the X axis and set the jog increment, I just need to activate the "+" jog button. I searched through all the pins, signals etc in HalShow and could not find that "+ jog button", the closest thing I found was joint.0.kb-jog-active that gets activated when I click on the jog button, so not exactly what I need.
In the LinuxCNC HAL tutorial part 2, he has a bunch halui signals defined in his custom_postgui.hal file (see below). Can I simply replicate what he has done to get access to these signals or do I need to something else to expose the pins shown in the right hand column?
Attachment not found
Please Log in to join the conversation.
2 years 3 months ago #305547
by slowpoke
Aciera, Thanks for that, I can now see the halui stuff in HalShow
I think I'm pretty close, but need a little help troubleshooting please.
The configuration:
Axis connected to an Arduino board, the Arduino board has a couple of digital inputs(6,7) and a couple of digital outputs(8,9) that are linked to LinuxCNC via a python script. The Arduino/Python portion seems to be working just fine, I can trigger Arduino outputs with HAL file links and I can observe digital inputs to the Arduino in Hal Watch.
What I'm trying to do: when I activate digital input 6 on the Arduino, I want Axis to jog X in the positive direction, (as if I mouse clicked the + "X")
What I have done: I added the following to postgui.hal:
net jog-x-pos halui.axis.x.plus
net jog-x-pos <= arduino.din.6
Arduino input 6 happens to be configured with a pullup, so when I push the button the input goes low, so I set the arduino.din.6-invert bit
What's happening:
When input 6 NOT pushed; arduino.din.6 is yellow (because it's pulled up), halui.axis.x.plus and jog-x-pos are both dark, so far so good
While input 6 IS pushed; arduino.din.6 is dark (it's now low), halui.axis.x.plus and jog-x-pos are both yellow, so far so good
However Axis does not jog. Estop is good, machine power is on, X is selected, just no movement and joint.0.kb-jog-active remains dark.
If I mouse click the actual + jog button in Axis, X moves and the joint.0.kb-jog-active watch LED briefly flashes yellow.
So for whatever reason my button press is not actually causing Axis to jog.
Please see attached, and thanks in advance for any guidance...
I think I'm pretty close, but need a little help troubleshooting please.
The configuration:
Axis connected to an Arduino board, the Arduino board has a couple of digital inputs(6,7) and a couple of digital outputs(8,9) that are linked to LinuxCNC via a python script. The Arduino/Python portion seems to be working just fine, I can trigger Arduino outputs with HAL file links and I can observe digital inputs to the Arduino in Hal Watch.
What I'm trying to do: when I activate digital input 6 on the Arduino, I want Axis to jog X in the positive direction, (as if I mouse clicked the + "X")
What I have done: I added the following to postgui.hal:
net jog-x-pos halui.axis.x.plus
net jog-x-pos <= arduino.din.6
Arduino input 6 happens to be configured with a pullup, so when I push the button the input goes low, so I set the arduino.din.6-invert bit
What's happening:
When input 6 NOT pushed; arduino.din.6 is yellow (because it's pulled up), halui.axis.x.plus and jog-x-pos are both dark, so far so good
While input 6 IS pushed; arduino.din.6 is dark (it's now low), halui.axis.x.plus and jog-x-pos are both yellow, so far so good
However Axis does not jog. Estop is good, machine power is on, X is selected, just no movement and joint.0.kb-jog-active remains dark.
If I mouse click the actual + jog button in Axis, X moves and the joint.0.kb-jog-active watch LED briefly flashes yellow.
So for whatever reason my button press is not actually causing Axis to jog.
Please see attached, and thanks in advance for any guidance...
Attachment not found
Please Log in to join the conversation.
Time to create page: 0.082 seconds
