7i96S MPG input
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
26 Dec 2024 10:01 - 26 Dec 2024 10:10 #317400
by slowpoke
7i96S MPG input was created by slowpoke
I'm anticipating reception of my 7196S card shortly. (The Canada Post strike is finally on hold)
This is for a lathe; I have a stepper (for now) mated to the Z-axis leadscrew, and a servo mated to the cross-slide
The Spindle encoder (A,B,Z signals) will interface to the fast encoder inputs on TB2:7,10,13
I plan to configure this so that the lathe can operate either in old fashioned manual mode, or in LinuxCNC mode. When in manual mode a separate ELS controller drives the Z-axis leadscrew, and because I have eliminated the hand crank for the cross-slide (it's now mated to a servo), I want to add a MPG to emulate the old cross-slide hand crank when I want to manipulate the cross-slide manually.
My question is about interfacing the 600 pulse/Rev rotary encoder intended for use as the cross-slide MPG. I have spare isolated inputs on TB3 that I would prefer to use because of the isolation. Manual states 5kHz max for these isolated inputs which seems fast enough, I can't imagine being able to rotate that knob 8 times in a second. So assuming the rate is okay, can I simply add a few lines to my HAL file to get a couple of those spare inputs to decode the A/B signals to get counts and direction from the encoder? or do I need to re-FLASH the FPGA on the 7196S?
This is for a lathe; I have a stepper (for now) mated to the Z-axis leadscrew, and a servo mated to the cross-slide
The Spindle encoder (A,B,Z signals) will interface to the fast encoder inputs on TB2:7,10,13
I plan to configure this so that the lathe can operate either in old fashioned manual mode, or in LinuxCNC mode. When in manual mode a separate ELS controller drives the Z-axis leadscrew, and because I have eliminated the hand crank for the cross-slide (it's now mated to a servo), I want to add a MPG to emulate the old cross-slide hand crank when I want to manipulate the cross-slide manually.
My question is about interfacing the 600 pulse/Rev rotary encoder intended for use as the cross-slide MPG. I have spare isolated inputs on TB3 that I would prefer to use because of the isolation. Manual states 5kHz max for these isolated inputs which seems fast enough, I can't imagine being able to rotate that knob 8 times in a second. So assuming the rate is okay, can I simply add a few lines to my HAL file to get a couple of those spare inputs to decode the A/B signals to get counts and direction from the encoder? or do I need to re-FLASH the FPGA on the 7196S?
Last edit: 26 Dec 2024 10:10 by slowpoke.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17994
- Thank you received: 4838
26 Dec 2024 15:55 #317415
by PCW
Replied by PCW on topic 7i96S MPG input
Standard 7I96S firmware has 4 built in MPG quadrature counters
overlaid on the first 8 isolated inputs. This means you do not need
to decode individual inputs (which is important since they are typically
only read at the 1 KHz servo thread rate)
The MPG counters have names like:
hm2_7i96s.0.inm.00.enc0-count
hm2_7i96s.0.inm.00.enc1-count
hm2_7i96s.0.inm.00.enc2-count
hm2_7i96s.0.inm.00.enc3-count
overlaid on the first 8 isolated inputs. This means you do not need
to decode individual inputs (which is important since they are typically
only read at the 1 KHz servo thread rate)
The MPG counters have names like:
hm2_7i96s.0.inm.00.enc0-count
hm2_7i96s.0.inm.00.enc1-count
hm2_7i96s.0.inm.00.enc2-count
hm2_7i96s.0.inm.00.enc3-count
The following user(s) said Thank You: slowpoke
Please Log in or Create an account to join the conversation.
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
26 Dec 2024 23:14 #317441
by slowpoke
Thank you
Replied by slowpoke on topic 7i96S MPG input
That's great news.Standard 7I96S firmware has 4 built in MPG quadrature counters
overlaid on the first 8 isolated inputs. This means you do not need
to decode individual inputs (which is important since they are typically
only read at the 1 KHz servo thread rate)
The MPG counters have names like:
hm2_7i96s.0.inm.00.enc0-count
hm2_7i96s.0.inm.00.enc1-count
hm2_7i96s.0.inm.00.enc2-count
hm2_7i96s.0.inm.00.enc3-count
Thank you
Please Log in or Create an account to join the conversation.
- timo
- Offline
- Premium Member
Less
More
- Posts: 97
- Thank you received: 30
27 Dec 2024 04:34 #317454
by timo
Replied by timo on topic 7i96S MPG input
Just a side question: Why do you need a separate Controller for the manual operation?
Isn*t everything possible to do in the LInux CNC. Slaving axis, Using MPG to move the axis manually?
Isn*t everything possible to do in the LInux CNC. Slaving axis, Using MPG to move the axis manually?
Please Log in or Create an account to join the conversation.
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
27 Dec 2024 12:46 #317465
by slowpoke
Replied by slowpoke on topic 7i96S MPG input
I think all of the functionality is available in LinuxCNC, however I developed a little touchscreen GUI for the existing ELS and I really like the ease of use when using the lathe in manual mode.Just a side question: Why do you need a separate Controller for the manual operation?
Isn*t everything possible to do in the LInux CNC. Slaving axis, Using MPG to move the axis manually?
Please Log in or Create an account to join the conversation.
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
02 Jan 2025 01:18 - 02 Jan 2025 01:21 #317841
by slowpoke
I have a glass scale connected up to inputs 0,1
I don't see them in HALshow. (I do see .encoder.00 however it does not seem to be linked to input 0,1), I think that's probably the spindle data.
How would I go about:
1) just viewing and scaling the quadrature data?
2) displaying the scaled value in axis?
Replied by slowpoke on topic 7i96S MPG input
I'm trying to find these 4 overlaid quadrature encounters,Standard 7I96S firmware has 4 built in MPG quadrature counters
overlaid on the first 8 isolated inputs. This means you do not need
to decode individual inputs (which is important since they are typically
only read at the 1 KHz servo thread rate)
The MPG counters have names like:
hm2_7i96s.0.inm.00.enc0-count
hm2_7i96s.0.inm.00.enc1-count
hm2_7i96s.0.inm.00.enc2-count
hm2_7i96s.0.inm.00.enc3-count
I have a glass scale connected up to inputs 0,1
I don't see them in HALshow. (I do see .encoder.00 however it does not seem to be linked to input 0,1), I think that's probably the spindle data.
How would I go about:
1) just viewing and scaling the quadrature data?
2) displaying the scaled value in axis?
Attachments:
Last edit: 02 Jan 2025 01:21 by slowpoke.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17994
- Thank you received: 4838
02 Jan 2025 15:21 #317872
by PCW
Replied by PCW on topic 7i96S MPG input
The MPG encoders are part of the inm module, so in halshow,
select hm2_7i96s.0.inm.00.enc0-count
Note that these are just raw counts and would need
the scale component to scale to position.
It might be easier to have some normal encoders brought out on the
parallel expansion connector since standard encoders have scaling built in.
select hm2_7i96s.0.inm.00.enc0-count
Note that these are just raw counts and would need
the scale component to scale to position.
It might be easier to have some normal encoders brought out on the
parallel expansion connector since standard encoders have scaling built in.
The following user(s) said Thank You: slowpoke
Please Log in or Create an account to join the conversation.
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
04 Jan 2025 18:06 #318112
by slowpoke
So next up try the pins on the P1 expansion port (ESD carefully).
Three questions if you don't mind:
1) How would I use or map the expansion port pins to be used as 'A', 'B' quadrature encoder inputs and where would I find them in HAL?
2) One of my scales has differential outputs 'A' ,'A-', & 'B', 'B-'. all within the range of 0-5V so when 'A' is +5V, 'A-' is 0V etc. Can four expansion port pins be used to accommodate differential quadrature signalling or just single ended?
I order a fair number of PCB's and I get free PCB vouchers, so I will probably make a little daughter board either with fast opto's, or perhaps just a series resistor and TVS's (need to think about that) to be on the FPGA safe side. However I would like to do a proof of concept first.
3) Assuming I have created a HAL net with the DRO value and now I want to display that in Axis as a DRO value, what target parameter do i need to send the DRO value to? And, assuming my commanded values will differ from the scale values because of backlash, which displayed value in axis represents the commanded value, and which one represents the actual (scale read value)?
Much appreciated.
Replied by slowpoke on topic 7i96S MPG input
I did a little test using hm2_7i96s.0.inm.00.enc0-count driving a HAL scale and it works very well as long as I move the carriage at moderate speeds.If I turn the hand wheel as fast as possible I loose counts as expected.The MPG encoders are part of the inm module, so in halshow,
select hm2_7i96s.0.inm.00.enc0-count
Note that these are just raw counts and would need
the scale component to scale to position.
It might be easier to have some normal encoders brought out on the
parallel expansion connector since standard encoders have scaling built in.
So next up try the pins on the P1 expansion port (ESD carefully).
Three questions if you don't mind:
1) How would I use or map the expansion port pins to be used as 'A', 'B' quadrature encoder inputs and where would I find them in HAL?
2) One of my scales has differential outputs 'A' ,'A-', & 'B', 'B-'. all within the range of 0-5V so when 'A' is +5V, 'A-' is 0V etc. Can four expansion port pins be used to accommodate differential quadrature signalling or just single ended?
I order a fair number of PCB's and I get free PCB vouchers, so I will probably make a little daughter board either with fast opto's, or perhaps just a series resistor and TVS's (need to think about that) to be on the FPGA safe side. However I would like to do a proof of concept first.
3) Assuming I have created a HAL net with the DRO value and now I want to display that in Axis as a DRO value, what target parameter do i need to send the DRO value to? And, assuming my commanded values will differ from the scale values because of backlash, which displayed value in axis represents the commanded value, and which one represents the actual (scale read value)?
Much appreciated.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17994
- Thank you received: 4838
04 Jan 2025 21:05 #318122
by PCW
Replied by PCW on topic 7i96S MPG input
You may get a bit more speed by increasing the inm's scan rate from its default
20 KHz to say 100 KHz (this decreases the default digital filter fast time constant (5 clocks)
from 250 usec to 50 usec)
1. If you use the 7I96S firmware with MPGs on P1 it would just be the second inm (inm 1)
2. No, you need to use differential receivers (say 26LS32) for that
3. its a bit tricky because LinuxCNC has many offsets in its DRO readouts
at the minimum you would need to set this offset.
(perhaps by using the scale components offset pin or manually resetting
the counters at 0)
20 KHz to say 100 KHz (this decreases the default digital filter fast time constant (5 clocks)
from 250 usec to 50 usec)
1. If you use the 7I96S firmware with MPGs on P1 it would just be the second inm (inm 1)
2. No, you need to use differential receivers (say 26LS32) for that
3. its a bit tricky because LinuxCNC has many offsets in its DRO readouts
at the minimum you would need to set this offset.
(perhaps by using the scale components offset pin or manually resetting
the counters at 0)
Please Log in or Create an account to join the conversation.
- slowpoke
- Offline
- Elite Member
Less
More
- Posts: 173
- Thank you received: 25
04 Jan 2025 22:16 #318124
by slowpoke
How do I tweak the inm scan rate?
2) 26LS32 looks good, I used similar DS3486's for something similar a fair ways back.
3) In axis there are two tabs; Preview and DRO it's not clear to me how these differ? I'm assuming that when I start driving the steppers/servos the values (for Z and X) on those tabs will be updated by Linux based on the steps sent to the drives and whatever scaling is specified. I'm not sure if I can override those values with the actual values that I get from the scales, and if not, can I somehow get the actual values displayed somewhere in the GUI?
Much appreciated
Replied by slowpoke on topic 7i96S MPG input
1) okay, seems logical to start with the inm scan rate, because I have to make a bit of an effort to miss pulses now, so if I'm really lucky perhaps at 5x, it might be fast enough?You may get a bit more speed by increasing the inm's scan rate from its default
20 KHz to say 100 KHz (this decreases the default digital filter fast time constant (5 clocks)
from 250 usec to 50 usec)
1. If you use the 7I96S firmware with MPGs on P1 it would just be the second inm (inm 1)
2. No, you need to use differential receivers (say 26LS32) for that
3. its a bit tricky because LinuxCNC has many offsets in its DRO readouts
at the minimum you would need to set this offset.
(perhaps by using the scale components offset pin or manually resetting
the counters at 0)
How do I tweak the inm scan rate?
2) 26LS32 looks good, I used similar DS3486's for something similar a fair ways back.
3) In axis there are two tabs; Preview and DRO it's not clear to me how these differ? I'm assuming that when I start driving the steppers/servos the values (for Z and X) on those tabs will be updated by Linux based on the steps sent to the drives and whatever scaling is specified. I'm not sure if I can override those values with the actual values that I get from the scales, and if not, can I somehow get the actual values displayed somewhere in the GUI?
Much appreciated
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds