Encoder Help with Mesa 7i96
- kbec
- Offline
- Premium Member
-
Less
More
- Posts: 132
- Thank you received: 4
16 Feb 2022 04:40 #235008
by kbec
Encoder Help with Mesa 7i96 was created by kbec
I am not sure my card is picking up the signals from my ABZ optical encoder. When I load LinuxCNC, I see
hm2/hm2_7i96.0: IO Pin 027 (TB2-07/TB2-08): Encoder #0, pin A (Input)
hm2/hm2_7i96.0: IO Pin 028 (TB2-10/TB2-11): Encoder #0, pin B (Input)
hm2/hm2_7i96.0: IO Pin 029 (TB2-13/TB2-14): Encoder #0, pin Index (Input)
Which I have A to 027, B to 028 and Z to 029.
This is from the halcmd:
halcmd show pin "spindle"
Component Pins:
Owner Type Dir Value Name
19 bit IN FALSE spindle.0.amp-fault-in
19 bit IN TRUE spindle.0.at-speed <== spindle-at-speed
19 bit OUT TRUE spindle.0.brake ==> spindle-brake
19 bit OUT FALSE spindle.0.forward ==> spindle-cw
19 bit I/O FALSE spindle.0.index-enable <=> spindle-index-enable
19 bit IN FALSE spindle.0.inhibit
19 bit IN FALSE spindle.0.is-oriented
19 bit OUT FALSE spindle.0.locked
19 bit OUT FALSE spindle.0.on ==> spindle-enable
19 bit OUT FALSE spindle.0.orient
19 float OUT 0 spindle.0.orient-angle
19 s32 IN 0 spindle.0.orient-fault
19 s32 OUT 0 spindle.0.orient-mode
19 bit OUT FALSE spindle.0.reverse ==> spindle-ccw
19 float IN 0 spindle.0.revs <== spindle-revs
19 float OUT 0 spindle.0.speed-cmd-rps
19 float IN 0 spindle.0.speed-in <== spindle-vel-fb-rps
19 float OUT 0 spindle.0.speed-out ==> spindle-vel-cmd-rpm
19 float OUT 0 spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
19 float OUT 0 spindle.0.speed-out-rps ==> spindle-vel-cmd-rps
19 float OUT 0 spindle.0.speed-out-rps-abs ==> spindle-vel-cmd-rps-abs
I also noticed there are two encoder options, differential and TTL, which of those should I use? now I think it is set to TTL.
I tested the signals with my meter and they seem to be going to the board, what else do I need to look at?
hm2/hm2_7i96.0: IO Pin 027 (TB2-07/TB2-08): Encoder #0, pin A (Input)
hm2/hm2_7i96.0: IO Pin 028 (TB2-10/TB2-11): Encoder #0, pin B (Input)
hm2/hm2_7i96.0: IO Pin 029 (TB2-13/TB2-14): Encoder #0, pin Index (Input)
Which I have A to 027, B to 028 and Z to 029.
This is from the halcmd:
halcmd show pin "spindle"
Component Pins:
Owner Type Dir Value Name
19 bit IN FALSE spindle.0.amp-fault-in
19 bit IN TRUE spindle.0.at-speed <== spindle-at-speed
19 bit OUT TRUE spindle.0.brake ==> spindle-brake
19 bit OUT FALSE spindle.0.forward ==> spindle-cw
19 bit I/O FALSE spindle.0.index-enable <=> spindle-index-enable
19 bit IN FALSE spindle.0.inhibit
19 bit IN FALSE spindle.0.is-oriented
19 bit OUT FALSE spindle.0.locked
19 bit OUT FALSE spindle.0.on ==> spindle-enable
19 bit OUT FALSE spindle.0.orient
19 float OUT 0 spindle.0.orient-angle
19 s32 IN 0 spindle.0.orient-fault
19 s32 OUT 0 spindle.0.orient-mode
19 bit OUT FALSE spindle.0.reverse ==> spindle-ccw
19 float IN 0 spindle.0.revs <== spindle-revs
19 float OUT 0 spindle.0.speed-cmd-rps
19 float IN 0 spindle.0.speed-in <== spindle-vel-fb-rps
19 float OUT 0 spindle.0.speed-out ==> spindle-vel-cmd-rpm
19 float OUT 0 spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
19 float OUT 0 spindle.0.speed-out-rps ==> spindle-vel-cmd-rps
19 float OUT 0 spindle.0.speed-out-rps-abs ==> spindle-vel-cmd-rps-abs
I also noticed there are two encoder options, differential and TTL, which of those should I use? now I think it is set to TTL.
I tested the signals with my meter and they seem to be going to the board, what else do I need to look at?
Please Log in or Create an account to join the conversation.
- 0x2102
-
- Offline
- Elite Member
-
Less
More
- Posts: 211
- Thank you received: 75
16 Feb 2022 11:42 #235034
by 0x2102
Replied by 0x2102 on topic Encoder Help with Mesa 7i96
Wiring seems to be correct. Jumper for TTL (single ended)
TB2-PIN7 - A
TB2-PIN10 - B
TB2-PIN13 - Index (Z)
Double check that your encoder output is PNP (+5V) and not NPN (GND.
TB2-PIN7 - A
TB2-PIN10 - B
TB2-PIN13 - Index (Z)
Double check that your encoder output is PNP (+5V) and not NPN (GND.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
16 Feb 2022 16:15 - 16 Feb 2022 17:14 #235048
by PCW
Replied by PCW on topic Encoder Help with Mesa 7i96
Actually a PNP encoder will not work directly with a 7I96
since the 7I96 encoder inputs have pullup resistors. TTL, NPN or
Differential encoders all work without added components.
A PNP output encoder would need external pulldown resistors added.
To check the encoder, watch the encoder position pin as you turn the spindle
by hand. If working and scaled correctly, the position should increase by
1.000 for each full spindle turn in the forward direction.
On a 7I96 with standard firmware the encoder position pin would be:
hm2_7i96.0.encoder.00.position
If you are running axis you can watch this with:
"Machine" --> "Show HAL Configuration" --> "Watch" --> "Pins" --> "hm2_7i96" --> "0" --> "encoder" --> "00" --> hm2_7i96.0.encoder.00.position
since the 7I96 encoder inputs have pullup resistors. TTL, NPN or
Differential encoders all work without added components.
A PNP output encoder would need external pulldown resistors added.
To check the encoder, watch the encoder position pin as you turn the spindle
by hand. If working and scaled correctly, the position should increase by
1.000 for each full spindle turn in the forward direction.
On a 7I96 with standard firmware the encoder position pin would be:
hm2_7i96.0.encoder.00.position
If you are running axis you can watch this with:
"Machine" --> "Show HAL Configuration" --> "Watch" --> "Pins" --> "hm2_7i96" --> "0" --> "encoder" --> "00" --> hm2_7i96.0.encoder.00.position
Last edit: 16 Feb 2022 17:14 by PCW. Reason: Clarify
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
-
Less
More
- Posts: 132
- Thank you received: 4
16 Feb 2022 16:56 #235051
by kbec
Replied by kbec on topic Encoder Help with Mesa 7i96
When I did the watch, it shows a 0 and it did not change.
I have about 3.5 v on the signals, and 5.8v on the index when they are triggered.
The signals from the encoder are 10v, I think I had set up a pull down resistor to get it to 5v, but maybe that is not what you mean. Most of what I see with those involves switches, and I am a little out of practice in wiring circuits and such.
I have something like this,
10v signal out -- resistor --5v to 7i96
\- resistor -- ground
I also verified the signals are coming in as a positive voltage, so does that mean it is PNP and I need something else?
I have about 3.5 v on the signals, and 5.8v on the index when they are triggered.
The signals from the encoder are 10v, I think I had set up a pull down resistor to get it to 5v, but maybe that is not what you mean. Most of what I see with those involves switches, and I am a little out of practice in wiring circuits and such.
I have something like this,
10v signal out -- resistor --5v to 7i96
\- resistor -- ground
I also verified the signals are coming in as a positive voltage, so does that mean it is PNP and I need something else?
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
16 Feb 2022 17:21 - 16 Feb 2022 17:29 #235052
by PCW
Replied by PCW on topic Encoder Help with Mesa 7i96
Unless the A/B signals swing close to ground (less than say +0.4V when low)
you will not have reliable (or perhaps any) counting.
The 7I96 in TTL mode expects signals that swing from close to
ground in the low state (the 0.4V mentioned above) to about +2.4V
minimum in the high state.
Best options (in order of performance/reliability)
Differential encoders (5V differential signals)
TTL encoders (5V single ended signals)
NPN encoders (outputs are switches to ground)
PNP encoders (with external stiff pulldown resistors)
It sounds like you need a much stiffer pulldown resistor to
get the low levels needed for the 7I96's TTL inputs.
you will not have reliable (or perhaps any) counting.
The 7I96 in TTL mode expects signals that swing from close to
ground in the low state (the 0.4V mentioned above) to about +2.4V
minimum in the high state.
Best options (in order of performance/reliability)
Differential encoders (5V differential signals)
TTL encoders (5V single ended signals)
NPN encoders (outputs are switches to ground)
PNP encoders (with external stiff pulldown resistors)
It sounds like you need a much stiffer pulldown resistor to
get the low levels needed for the 7I96's TTL inputs.
Last edit: 16 Feb 2022 17:29 by PCW. Reason: Clarify
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
-
Less
More
- Posts: 132
- Thank you received: 4
16 Feb 2022 19:01 #235063
by kbec
Replied by kbec on topic Encoder Help with Mesa 7i96
I am not sure I am following you.
My A and B signals seem to be as you described, .4v low and 3.8 v when high.
My index signal was wired wrong, now it is .09 to .5 low and 3.8 high.
That seems to be in line with what you said, "The 7I96 in TTL mode expects signals that swing from close to
ground in the low state (the 0.4V mentioned above) to about +2.4V
minimum in the high state.
"
When I watch, I see nothing changes, I looked at the count as well as the A, B and index signals. A and B show as red and index as yellow.
Do I need to modify the signals coming to the 7i96 more than I have? I thought I did what you said.
My A and B signals seem to be as you described, .4v low and 3.8 v when high.
My index signal was wired wrong, now it is .09 to .5 low and 3.8 high.
That seems to be in line with what you said, "The 7I96 in TTL mode expects signals that swing from close to
ground in the low state (the 0.4V mentioned above) to about +2.4V
minimum in the high state.
"
When I watch, I see nothing changes, I looked at the count as well as the A, B and index signals. A and B show as red and index as yellow.
Do I need to modify the signals coming to the 7i96 more than I have? I thought I did what you said.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
16 Feb 2022 19:13 - 16 Feb 2022 19:29 #235066
by PCW
Replied by PCW on topic Encoder Help with Mesa 7i96
That should work, assuming the jumpers W2,W3,W4 are in the left hand position ( = TTL mode )
This also assumes you have standard firmware with no additional encoders,
as the spindle encoder is moved to the last encoder for firmware that includes
axis encoders.
This also assumes you have standard firmware with no additional encoders,
as the spindle encoder is moved to the last encoder for firmware that includes
axis encoders.
Last edit: 16 Feb 2022 19:29 by PCW.
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
-
Less
More
- Posts: 132
- Thank you received: 4
16 Feb 2022 19:49 #235071
by kbec
Replied by kbec on topic Encoder Help with Mesa 7i96
This is what I see when I look in the Hal Configuration for Encoder:
Component Pins:
Owner Type Dir Value Name
26 s32 OUT 0 hm2_7i96.0.encoder.00.count
26 s32 OUT 0 hm2_7i96.0.encoder.00.count-latched
26 bit I/O FALSE hm2_7i96.0.encoder.00.index-enable <=> spindle-index-enable
26 bit OUT FALSE hm2_7i96.0.encoder.00.input-a
26 bit OUT FALSE hm2_7i96.0.encoder.00.input-b
26 bit OUT TRUE hm2_7i96.0.encoder.00.input-index
26 bit IN FALSE hm2_7i96.0.encoder.00.latch-enable
26 bit IN FALSE hm2_7i96.0.encoder.00.latch-polarity
26 float OUT 0 hm2_7i96.0.encoder.00.position ==> spindle-revs
26 float OUT 0 hm2_7i96.0.encoder.00.position-latched
26 bit OUT FALSE hm2_7i96.0.encoder.00.quad-error
26 bit IN FALSE hm2_7i96.0.encoder.00.quad-error-enable
26 s32 OUT 0 hm2_7i96.0.encoder.00.rawcounts
26 s32 OUT 0 hm2_7i96.0.encoder.00.rawlatch
26 bit IN FALSE hm2_7i96.0.encoder.00.reset
26 float OUT 0 hm2_7i96.0.encoder.00.velocity ==> spindle-vel-fb-rps
26 float OUT 0 hm2_7i96.0.encoder.00.velocity-rpm ==> spindle-vel-fb-rpm
26 bit IN FALSE hm2_7i96.0.encoder.hires-timestamp
26 u32 IN 0x017D7840 hm2_7i96.0.encoder.sample-frequency
26 s32 IN -1 hm2_7i96.0.encoder.timer-number
If things are set up somewhat correctly, I should see the rawcount increase no matter what, but it is staying at 0, so I must have something wrong, or a problem with my 7i96 card.
I also tried the hal meter with input a, input b and input-index, A and B show as false, and index shows true, but the values do not update.
I am not sure where to go from here.
Component Pins:
Owner Type Dir Value Name
26 s32 OUT 0 hm2_7i96.0.encoder.00.count
26 s32 OUT 0 hm2_7i96.0.encoder.00.count-latched
26 bit I/O FALSE hm2_7i96.0.encoder.00.index-enable <=> spindle-index-enable
26 bit OUT FALSE hm2_7i96.0.encoder.00.input-a
26 bit OUT FALSE hm2_7i96.0.encoder.00.input-b
26 bit OUT TRUE hm2_7i96.0.encoder.00.input-index
26 bit IN FALSE hm2_7i96.0.encoder.00.latch-enable
26 bit IN FALSE hm2_7i96.0.encoder.00.latch-polarity
26 float OUT 0 hm2_7i96.0.encoder.00.position ==> spindle-revs
26 float OUT 0 hm2_7i96.0.encoder.00.position-latched
26 bit OUT FALSE hm2_7i96.0.encoder.00.quad-error
26 bit IN FALSE hm2_7i96.0.encoder.00.quad-error-enable
26 s32 OUT 0 hm2_7i96.0.encoder.00.rawcounts
26 s32 OUT 0 hm2_7i96.0.encoder.00.rawlatch
26 bit IN FALSE hm2_7i96.0.encoder.00.reset
26 float OUT 0 hm2_7i96.0.encoder.00.velocity ==> spindle-vel-fb-rps
26 float OUT 0 hm2_7i96.0.encoder.00.velocity-rpm ==> spindle-vel-fb-rpm
26 bit IN FALSE hm2_7i96.0.encoder.hires-timestamp
26 u32 IN 0x017D7840 hm2_7i96.0.encoder.sample-frequency
26 s32 IN -1 hm2_7i96.0.encoder.timer-number
If things are set up somewhat correctly, I should see the rawcount increase no matter what, but it is staying at 0, so I must have something wrong, or a problem with my 7i96 card.
I also tried the hal meter with input a, input b and input-index, A and B show as false, and index shows true, but the values do not update.
I am not sure where to go from here.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18482
- Thank you received: 5055
16 Feb 2022 20:17 #235074
by PCW
Replied by PCW on topic Encoder Help with Mesa 7i96
1. Is the 7I96 encoder in TTL mode (jumpers W2,W3, and W4 in left hand position)?
2. If the 7I76 encoder is jumpered for TTL mode, you should be
able to ground the A,B,IDX inputs and see a change in the
A,B,IDX hals pins with halshow or halmeter. If these do not change.
it suggests that the encoder interface chip (Differential receiver = ISL32173) might be damaged.
2. If the 7I76 encoder is jumpered for TTL mode, you should be
able to ground the A,B,IDX inputs and see a change in the
A,B,IDX hals pins with halshow or halmeter. If these do not change.
it suggests that the encoder interface chip (Differential receiver = ISL32173) might be damaged.
The following user(s) said Thank You: kbec
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
-
Less
More
- Posts: 132
- Thank you received: 4
16 Feb 2022 23:21 #235086
by kbec
Replied by kbec on topic Encoder Help with Mesa 7i96
After some other issues, I think my problem lies in my wiring. My system doesn't share a common ground. If I use the ground I assume that the encoder goes to is the 5v feed into powering the card, I get much higher voltages and they don't seem correct. The values I stated earlier were using the +24v power supply ground that feeds into the encoder.
I am not sure about this, I never really had a case where I needed 3 separate voltages and power supplies working interchanged with each other, and I don't want to break anything.
I am not sure about this, I never really had a case where I needed 3 separate voltages and power supplies working interchanged with each other, and I don't want to break anything.
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.142 seconds