Mapping pins in Hal

More
17 Jan 2013 12:01 #28765 by marsheng
Mapping pins in Hal was created by marsheng
I'm trying to use a switch to select between X and Z for the MPG

Switch on = X
Switch off = Z

What I have is

net joint-select-a <=> hm2.5i20.0.gpio.034.in

I'm not sure how to map the 'not' hm2.5i20.0.gpio.034.in to Z or net-joint-select-c.

Thanks

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

More
17 Jan 2013 12:29 #28766 by PCW
Replied by PCW on topic Mapping pins in Hal
At the very minimum this should be about right but this would
always enable the MPG for one axis or the other which may not be safe so more logic may be desired

net jog_x_enable axis.0.jog-enable <== hm2.5i20.0.gpio.034.in
net jog_z_enable axis.1.jog-enable <== hm2.5i20.0.gpio.034.in_not

Things that may help:

in a terminal window:

man motion
man hostmot2

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

More
17 Jan 2013 16:39 #28767 by marsheng
Replied by marsheng on topic Mapping pins in Hal
Thanks that worked.

I'm sure I'll find it sometime but which control/pin does the equivalent of machine on and resume. ?

I need these for remote buttons.

I found the single step and abort in the PNCConfig files.

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

More
17 Jan 2013 22:12 - 17 Jan 2013 22:15 #28776 by BigJohnT
Replied by BigJohnT on topic Mapping pins in Hal
This is my MPG section of my hal file. I use a selector for axis and for increment as well as an ilowpass to smooth the jogging.
# MPG
setp hm2_5i25.0.encoder.05.counter-mode true
loadrt mux4 names=mpg-scale
addf mpg-scale servo-thread
loadrt ilowpass
addf ilowpass.0 servo-thread
loadrt or2 count=2
addf or2.0 servo-thread
addf or2.1 servo-thread

setp ilowpass.0.gain 0.02
setp ilowpass.0.scale 1000
setp mpg-scale.in0 0.0
setp mpg-scale.in1 -0.0000001
setp mpg-scale.in2 -0.000001
setp mpg-scale.in3 -0.00001

net jog-smoothing ilowpass.0.in <= hm2_5i25.0.encoder.05.count
net jog-position <= ilowpass.0.out
net jog-position => axis.0.jog-counts
net jog-position => axis.1.jog-counts
net jog-position => axis.2.jog-counts

net scale1 or2.0.in0 <= hm2_5i25.0.7i77.0.0.input-03
net scale2 or2.1.in0 <= hm2_5i25.0.7i77.0.0.input-04
net scale3 or2.0.in1 or2.1.in1 <= hm2_5i25.0.7i77.0.0.input-05

net pos2 mpg-scale.sel0 <= or2.0.out
net pos3 mpg-scale.sel1 <= or2.1.out

net axis-mpg-jog-scale axis.0.jog-scale <= mpg-scale.out
net axis-mpg-jog-scale axis.1.jog-scale <= mpg-scale.out
net axis-mpg-jog-scale axis.2.jog-scale <= mpg-scale.out

This is my run button
# External Program Run Button
loadrt and2 count=2
addf and2.0 servo-thread
addf and2.1 servo-thread
net program-run-btn halui.mode.auto <= hm2_5i25.0.7i77.0.0.input-08
net program-run-btn and2.0.in0
net program-is-auto and2.0.in1 <= halui.mode.is-auto
net remote-prg-run halui.program.run <= and2.0.out

And this is my pause/resume button which I now understand why it don't work... it is still commented out.
# External Program Pause/Resume Button
#net pause-resume-btn and2.3.in0 and2.4.in0 <= hm2_5i20.0.gpio.029.in_not
#net pause-on toggle2nist.0.is-on and2.3.in1 <= halui.program.is-paused
#net run-status and2.4.in1 <= halui.program.is-running
#net pause-sig or2.5.in0 <= and2.3.out
#net resume-sig or2.5.in1 <= and2.4.out
#net toggle-ok toggle.0.in < or2.5.out
#net togglesig toggle2nist.0.in <= toggle.0.out
#net toggleon halui.program.pause <= toggle2nist.0.on
#net toggleoff halui.program.resume <= toggle2nist.0.off

John
Last edit: 17 Jan 2013 22:15 by BigJohnT.

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

More
18 Jan 2013 04:38 #28788 by marsheng
Replied by marsheng on topic Mapping pins in Hal
Thanks John

I enjoyed your website. CNC, Motorbikes, cooking, Arduino Wine making, quite a collection. I rode road bikes for years but started track racing at 50. Great fun.

I'll work through your code over the next few days. We are still busy with the PID control. I'm using Copley servo drives and as they have their own settings it is difficult to get the combination setup correct.

I have to go into the workshop now and earn some $'s to pay for all my toys.

Cheers Wallace

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

Time to create page: 0.131 seconds
Powered by Kunena Forum