method for resting a stepgen position to zero?

More
30 May 2013 07:00 #34935 by garymcrobertpdx
Well it appears I spoke to soon. The PID works but for reasons yet discovered the orient
zero position is established as the point where ever the spindle happens to be when
Linuxcnc is launched. Apparently the encoder position is not being set to zero by the index
which is the reference that I want as zero.

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

More
30 May 2013 07:05 #34937 by andypugh

Well it appears I spoke to soon. The PID works but for reasons yet discovered the orient
zero position is established as the point where ever the spindle happens to be when
Linuxcnc is launched. Apparently the encoder position is not being set to zero by the index
which is the reference that I want as zero.


It is probably sufficient to add the line:

setp encoder.0.index-enable 1

In the HAL file, then the encoder will zero the first time it sees an index. (there is still the issue with this approach that you can't orient until the spindle has turned at least far enough to pass index)

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

More
30 May 2013 08:42 #34941 by garymcrobertpdx
another issue

setp hm2_5i25.0.encoder.00.index-enable 1 produces an error

custom.hal:99: pin 'hm2_5i25.0.encoder.00.index-enable' is connected to a signal

hm2_5i25.0.encoder.00.index-enable is a bi-directional pin

How do I deal with bi-directional pins? If I had some understanding of this perhaps
I could work out a solution

I also have to be careful when messing with the encoder because functions like
G33.1 depend on the encoder working correctly.

Thinking out loud here suppose

If I were to unlink hm2_5i25.0.encoder.00.index-enable
net .hm2_5i25.0.encoder.00.index-enable to the mux2.n.sel

net orient.command to the mux2.n. in0
setp a slow velocity on the mux2.n. in1
net mux2.n.out to the orient-pid.command

setp hm2_5i25.0.encoder.00.index-enable 1

then after the encoder is initialized to zero relative to the encoder index
unlink hm2_5i25.0.encoder.00.index-enable
net spindle-index-enable <=> hm2_5i25.0.encoder.00.index-enable

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

More
30 May 2013 19:00 #34964 by andypugh

setp hm2_5i25.0.encoder.00.index-enable 1 produces an error
custom.hal:99: pin 'hm2_5i25.0.encoder.00.index-enable' is connected to a signal


Ah, yes.

In order of complexity: Try "sets" on the signal name first.

If that doesn't work then what might work would be to setp the pin (or sets the signal) immediately before hooking it up to motion.spindle.index-enable (I think that is where it links).

Otherwise it gets complicated (i think the tristate-bit component will be involved) and I would need a system to experiment with. Yor previous suggestions are someting like what is needed, but you need the trisate-bit function to connect up io pins). Think that you can then just net the tristate-bit output to the spindle index enable signal and setp the tristate-bit enable. However, you will then need something to disable the tristate-bit or it will keep over-writing index-enable. Possibly you could link the enable pin to machine-is-off.
The "sets" command before it is too late

It would actually be logical for the index-enable pin to default to 1 at startup for just this reason.

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

More
31 May 2013 02:50 #34991 by garymcrobertpdx
I will experiment with the "sets" halcmd

Is there a man page for tristate-bit components?

At the moment I have a working but some what nasty hacked spindle orientation configuration
The trick I used is to do a encoder.reset before allowing the orient.enable to become TRUE
Orient samples the encoder position on enable.

1 filpflop , 1 xor and 2 muxs I managed to make it work A bit of a mess but it gets the job done

Thanks for the help

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

More
31 May 2013 03:13 #34993 by andypugh

Is there a man page for tristate-bit components?


They are all here:
www.linuxcnc.org/docs/html/
Near the bottom

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

Time to create page: 0.621 seconds
Powered by Kunena Forum