Time to setup my lathe with 7i76e

More
22 Feb 2018 20:54 - 22 Feb 2018 21:00 #106353 by Todd Zuercher
I don't think you will want mux4, it only uses 2 inputs (think binary input). You could make the mux8 work for you nicely if you set up your wcomp inputs to overlap a little (and you would only need 3 wcomp components).
Make your 1st wcomp window 0-12v, 2nd wcomp 8-17 and 3rd 15.5-24v. Connect wcomp.0.out to mux8.0.sel0, wcomp.1.out to mux8.0.sel1, and wcomp.2.out to mux8.0.sel2. Then your setp values would be:
setp mux8.0.in1 1 #wcomp0 true
setp mux8.0.in3 0.1 #wcomp0+1 true
setp mux8.0.in2 0.01 #wcomp1 true
setp mux8.0.in6 0.001 #wcomp1+2 true
setp mux8.0.in4 0.0001 #wcomp2 true
Last edit: 22 Feb 2018 21:00 by Todd Zuercher. Reason: forgot to change mux4 to mux 8 in something I copied and paisted.

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

More
23 Feb 2018 10:20 - 23 Feb 2018 10:20 #106378 by tecno
Thanks for the explanation, having difficulties to understand all this as a foreigner but I an learning.
Here corrections that I hope are done as you described. Your help is much appreciated!

loadrt wcomp count=3
loadrt mux8 count=1

addf wcomp.0 servo-thread
addf wcomp.1 servo-thread
addf wcomp.2 servo-thread

addf mux8.0 servo-thread

# For velocity mode, set to 1
setp axis.0.jog-vel-mode 1
setp axis.2.jog-vel-mode 1

# This sets the scale that will be used based on the input to the mux8
setp mux8.0.in1 1 #wcomp0 true 6.8V
setp mux8.0.in3 0.1 #wcomp0+1 true 10.8
setp mux8.0.in2 0.01 #wcomp1 true 14.5
setp mux8.0.in6 0.001 #wcomp1+2 true 16.7 >>>>>>>>> not in5???
setp mux8.0.in4 0.0001 #wcomp2 true 18.7

# The input to the mux8 component
net scale mux8.0.sel0 <= wcomp.1.out
net scale mux8.0.sel1 <= wcomp.2.out
net scale mux8.0.sel2 <= wcomp.3.out

# The output from the mux8 is sent to each axis jog scale
net mpg-scale <= mux8.0.out
net mpg-scale => axis.0.jog-scale
net mpg-scale => axis.2.jog-scale

# The MPG inputs
net mpg-a encoder.0.phase-A <= hm2_7i76e.0.7i76.0.0.input-16
net mpg-b encoder.0.phase-B <= hm2_7i76e.0.7i76.0.0.input-17
net mpg-a encoder.1.phase-A <= hm2_7i76e.0.7i76.0.0.input-18
net mpg-b encoder.1.phase-B <= hm2_7i76e.0.7i76.0.0.input-19

# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts <= encoder.0.counts
net encoder-counts => axis.0.jog-counts
net encoder-counts <= encoder.1.counts
net encoder-counts => axis.2.jog-counts


net wcomp-input <= hm2_7i76e.0.7i76.0.0.analogin0 => wcomp.0.in
setp wcomp.0.min 0
setp wcomp.0.max 12
setp wcomp.0.out

net wcomp-input => wcomp.1.in
setp wcomp.1.min 8
setp wcomp.1.max 17
setp wcomp.1.out

net wcomp-input => wcomp.2.in
setp wcomp.2.min 15.5
setp wcomp.2.max 24
setp wcomp.2.out
Last edit: 23 Feb 2018 10:20 by tecno.

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

More
23 Feb 2018 13:51 - 23 Feb 2018 14:03 #106382 by Todd Zuercher
If you study the truth table for Mux8 you will see that sel6 is the one you want for wcomp1 and 2 true. Sel5 would be wcomp0 and 2 true which should never happen.

It also looks like you are trying to configure it to use a software encoder counter rather than the MPG encoder counter in the Mesa hardware. Could you post your whole hal file again, so that I can check some things?
Last edit: 23 Feb 2018 14:03 by Todd Zuercher. Reason: clicked
The following user(s) said Thank You: tecno

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

More
23 Feb 2018 14:17 #106383 by tecno
Had to print out the truth table and use pen to scribble and see what is going on ;)

File Attachment:

File Name: CNC3000_20...2-23.ini
File Size:3 KB

File Attachment:

File Name: CNC3000_20...2-23.hal
File Size:10 KB


Above have no MPG so it will have to be inserted when all is done.
Attachments:

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

More
23 Feb 2018 15:15 #106390 by Todd Zuercher
The first thing I see (and what I wanted to check), is that you need to enable the MPG encoders in the smart serial settings for your 7i76e.
Change this line from:
loadrt hm2_eth board_ip="10.10.10.10" config="firmware=hm2/7i76/7i76e.BIT num_encoders=1 num_pwmgens=0 num_stepgens=3 sserial_port_0=00xxxx"
to:
loadrt hm2_eth board_ip="10.10.10.10" config="firmware=hm2/7i76/7i76e.BIT num_encoders=1 num_pwmgens=0 num_stepgens=3 sserial_port_0=20xxxx"
(I think if it doesn't work then change the 2nd 0 to a 2 instead of the 1st)

Then use the pin "hm2_7i76e.0.7i76.0.0.enc0.count" for the 1st mpg encoder and "hm2_7i76e.0.7i76.0.0.enc1.count" for the 2nd. You don't need to put anything else for the AB inputs for the MPG in your hal file (it is all handled in the Mesa hardware)

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

More
23 Feb 2018 15:20 #106391 by Todd Zuercher
So to sum up change the smart serial config line in your hal file to enable the MPG encoders and add this bit of hal code
loadrt wcomp count=3
loadrt mux8 count=1

addf wcomp.0 servo-thread
addf wcomp.1 servo-thread
addf wcomp.2 servo-thread

addf mux8.0 servo-thread

# For velocity mode, set to 1
setp axis.0.jog-vel-mode 1
setp axis.2.jog-vel-mode 1

# This sets the scale that will be used based on the input to the mux8
setp mux8.0.in1 1 #wcomp0 true 6.8V
setp mux8.0.in3 0.1 #wcomp0+1 true 10.8
setp mux8.0.in2 0.01 #wcomp1 true 14.5
setp mux8.0.in6 0.001 #wcomp1+2 true 16.7
setp mux8.0.in4 0.0001 #wcomp2 true 18.7

# The input to the mux8 component
net scale mux8.0.sel0 <= wcomp.1.out
net scale mux8.0.sel1 <= wcomp.2.out
net scale mux8.0.sel2 <= wcomp.3.out

# The output from the mux8 is sent to each axis jog scale
net mpg-scale <= mux8.0.out
net mpg-scale => axis.0.jog-scale
net mpg-scale => axis.2.jog-scale

# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts <= hm2_7i76e.0.7i76.0.0.enc0.count
net encoder-counts => axis.0.jog-counts
net encoder-counts <= hm2_7i76e.0.7i76.0.0.enc1.count
net encoder-counts => axis.2.jog-counts

net wcomp-input <= hm2_7i76e.0.7i76.0.0.analogin0 => wcomp.0.in
setp wcomp.0.min 0
setp wcomp.0.max 12
setp wcomp.0.out

net wcomp-input => wcomp.1.in
setp wcomp.1.min 8
setp wcomp.1.max 17
setp wcomp.1.out

net wcomp-input => wcomp.2.in
setp wcomp.2.min 15.5
setp wcomp.2.max 24
setp wcomp.2.out
The following user(s) said Thank You: tecno

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

More
23 Feb 2018 15:27 #106393 by tecno
Thank you Todd this is much appreciated, I will have a go on this during the weekend.
Still have to wire up the MPG box to 7i76e and mount the box on the front frame on the lathe.

Thanks again, have a nice weekend. We have very cold weather coming and now have 10-15cm snow.

Cheers
Bengt

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

More
24 Feb 2018 18:30 #106438 by tecno
I have now been testing this MPG setup but I get no axis moving. Wcomp + Mux8 works OK.

Enclosed a screendump + hal

File Attachment:

File Name: CNC3000_20...2-24.hal
File Size:12 KB


Cheers
Bengt
Attachments:

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

More
24 Feb 2018 19:58 #106441 by rodw
It appears you are missing an axis-enable signal.
My hardware has an Axis select so I have this
net axis-select-x => axis.x.jog-enable
net axis-select-y => axis.y.jog-enable
net axis-select-z => axis.z.jog-enable

but in your case as you have both jog wheels active at any time, you probably just need to set these with setp

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

More
24 Feb 2018 20:09 #106443 by Mike_Eitel
Axis and /or joint too ?

I have both connected

Mike

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

Moderators: cmorley
Time to create page: 0.195 seconds
Powered by Kunena Forum