Heller CNC machine with encoder
12 Dec 2013 00:03 - 12 Dec 2013 00:09 #41519
by simon n.
Heller CNC machine with encoder was created by simon n.
Hi guys,
maybe you remember us, we exchanged the resolvers of our machine with new encoders now but linuxcnc didn't count the right pulses of the encoder.
We got:
1x-5i22-1 (FGPA card)
1x-7i48 (Servo card)
3x-7i37 (IO card)
Our encoders can be uses in TTL/RS422 mode. We set the jumpers of the 7i48 to TTL mode first and tried to get the encoders running. The encoder does 2500 pulses / turn so if we turn it just 1 round we should get 2500 pulses or counts in linuxcnc, but we just get ~680 pulses. We got a special firmware from PCW for our original machine with resolver. In this firmware the encoders are used in muxed mode and not quadrature. If we set a new config with PNCconf there is no firmware with muxed Encoder for the 5i22.
Our encoder sends A+ A- B+ B- Z+ Z- signals. We need to get 2500 pulses for each turn, we tried different mode --> TTL-->RS422 and back or we just connected the A B Z signals without the A- B- Z- signals on the 7i48 but nothing happened here.
Is there a Firmware for the 5i22 with muxed encoders, the ones we can select just have quadrature input? What do we have to consider?
edit: what is the difference in muxed and quadrature inputs?
Greetings
Simon N.
maybe you remember us, we exchanged the resolvers of our machine with new encoders now but linuxcnc didn't count the right pulses of the encoder.
We got:
1x-5i22-1 (FGPA card)
1x-7i48 (Servo card)
3x-7i37 (IO card)
Our encoders can be uses in TTL/RS422 mode. We set the jumpers of the 7i48 to TTL mode first and tried to get the encoders running. The encoder does 2500 pulses / turn so if we turn it just 1 round we should get 2500 pulses or counts in linuxcnc, but we just get ~680 pulses. We got a special firmware from PCW for our original machine with resolver. In this firmware the encoders are used in muxed mode and not quadrature. If we set a new config with PNCconf there is no firmware with muxed Encoder for the 5i22.
Our encoder sends A+ A- B+ B- Z+ Z- signals. We need to get 2500 pulses for each turn, we tried different mode --> TTL-->RS422 and back or we just connected the A B Z signals without the A- B- Z- signals on the 7i48 but nothing happened here.
Is there a Firmware for the 5i22 with muxed encoders, the ones we can select just have quadrature input? What do we have to consider?
edit: what is the difference in muxed and quadrature inputs?
Greetings
Simon N.
Last edit: 12 Dec 2013 00:09 by simon n..
Please Log in or Create an account to join the conversation.
12 Dec 2013 01:53 #41521
by PCW
Replied by PCW on topic Heller CNC machine with encoder
The standard encoder counter is a quadrature counter
it can be multiplexed or non-multiplexed. The 7I48 uses multiplexed
encoder signals to reduce the number of interface wires to allow 6 channels
on one connector.
If you have mis-counting, The first place to look is the quadrature signals and power supplies
1. Make sure the encoder and 7I48 have 5V +-5%
2. Make sure the encoder signals have enough swing
For TTL I would expect the high level to be >3V and the low level to be < 0.4v.
For differential signals I would verify that A is high when /A is low and vice versa and also for the B and Z signals. I would also verify that the voltage difference between the true and inverted signals (A,/A, B,/B, Z./Z) is always > 2V measured with a voltmeter )
(and you should expect 10000 counts per turn on a 2500 line encoder)
it can be multiplexed or non-multiplexed. The 7I48 uses multiplexed
encoder signals to reduce the number of interface wires to allow 6 channels
on one connector.
If you have mis-counting, The first place to look is the quadrature signals and power supplies
1. Make sure the encoder and 7I48 have 5V +-5%
2. Make sure the encoder signals have enough swing
For TTL I would expect the high level to be >3V and the low level to be < 0.4v.
For differential signals I would verify that A is high when /A is low and vice versa and also for the B and Z signals. I would also verify that the voltage difference between the true and inverted signals (A,/A, B,/B, Z./Z) is always > 2V measured with a voltmeter )
(and you should expect 10000 counts per turn on a 2500 line encoder)
Please Log in or Create an account to join the conversation.
12 Dec 2013 20:40 #41542
by simon n.
Replied by simon n. on topic Heller CNC machine with encoder
Hi PCW,
thanks for your advise. We checked the voltage, and it operates with ~5V+-5%. We measured channel A and B against GND, because we wanted to verify that the signals are shifted by 90°. But A and B were shifted by 180° and not 90°. We also measured IDX with A and B againstt GND to look up the shift between them. They are shifted by 90°, so we switched B and IDX and now it works, we get ~10000 pulses per turn but we dont know why it works now.
We checked the connections from the PC to the Encoder, they are all correct. We connected the Z+ and Z- signals and IDX+ and IDX- to the mesa cards, but that seems to be wrong. Now we connected A+ and A- to A+ and A-, B+ and B- to IDX+ and IDX- plus Z+ and Z- to B+ and B- from the Encoder to the Mesa card.
We used your Firmware for the 7i48-7i49 with muxed encoder inputs, its working there. We tested it with a firmware with quadrature encoder inputs, nothing happend there, all signals are dead. We switched back from RS422 to TTL logic on the 7i48 with muxed encoder and now it works. But actually we dont know why exactly, maybe you got some wisdom to share with us?^^ We need to know it for the documentary.
Thanks alot again PCW!
Greetings
Simon N.
thanks for your advise. We checked the voltage, and it operates with ~5V+-5%. We measured channel A and B against GND, because we wanted to verify that the signals are shifted by 90°. But A and B were shifted by 180° and not 90°. We also measured IDX with A and B againstt GND to look up the shift between them. They are shifted by 90°, so we switched B and IDX and now it works, we get ~10000 pulses per turn but we dont know why it works now.
We checked the connections from the PC to the Encoder, they are all correct. We connected the Z+ and Z- signals and IDX+ and IDX- to the mesa cards, but that seems to be wrong. Now we connected A+ and A- to A+ and A-, B+ and B- to IDX+ and IDX- plus Z+ and Z- to B+ and B- from the Encoder to the Mesa card.
We used your Firmware for the 7i48-7i49 with muxed encoder inputs, its working there. We tested it with a firmware with quadrature encoder inputs, nothing happend there, all signals are dead. We switched back from RS422 to TTL logic on the 7i48 with muxed encoder and now it works. But actually we dont know why exactly, maybe you got some wisdom to share with us?^^ We need to know it for the documentary.
Thanks alot again PCW!
Greetings
Simon N.
Please Log in or Create an account to join the conversation.
12 Dec 2013 22:56 - 12 Dec 2013 22:58 #41544
by PCW
Replied by PCW on topic Heller CNC machine with encoder
a couple of observations:
Sounds like you just have the encoder signals wrong. Note that getting the RS-422 signals right is a bit more involved since you need to verify that:
A is 180 degrees out of phase with /A
B is 180 degrees out of phase with /B
A and B are 90 degrees out of phase
Z is 180 degrees out of phase with /Z
Not counting the power signals there are 720 ways to wire the six RS-422 encoder wires,
with only 16 combinations which will work. So if you are not certain of the encoder wiring
you only have 1/45 odds of getting a working combination.
Any configuration that is not specifically for a 7I48 will not work as the
pinout will be wrong. Note that all standard HM2 encoder counters are quadrature,
but some use multiplexing between the daughtercard and the FPGA card to reduce the number of interface wires.
Sounds like you just have the encoder signals wrong. Note that getting the RS-422 signals right is a bit more involved since you need to verify that:
A is 180 degrees out of phase with /A
B is 180 degrees out of phase with /B
A and B are 90 degrees out of phase
Z is 180 degrees out of phase with /Z
Not counting the power signals there are 720 ways to wire the six RS-422 encoder wires,
with only 16 combinations which will work. So if you are not certain of the encoder wiring
you only have 1/45 odds of getting a working combination.
Any configuration that is not specifically for a 7I48 will not work as the
pinout will be wrong. Note that all standard HM2 encoder counters are quadrature,
but some use multiplexing between the daughtercard and the FPGA card to reduce the number of interface wires.
Last edit: 12 Dec 2013 22:58 by PCW.
Please Log in or Create an account to join the conversation.
12 Dec 2013 23:14 #41545
by simon n.
Replied by simon n. on topic Heller CNC machine with encoder
Hi,
we now get the right counter value and the position is rising when we turn the encoder. We just have to set the scale for the right machine unit. When we now start the machine the axis begins to move fitfull. The encoder gives pos-fb to the x axis with some value and the x axis gives exactly the same value as x-pos-cmd to the PID. We now try to get the machine stopped when we push the start button, we try to get it working, will take some time to figure it out i guess.
maybe you got some quick hint for us to look for? We set the PID to defaul P=1 I=0 D=0. Maybe we have to set a offset on the pwmgens?
Greetings
Simon N.
we now get the right counter value and the position is rising when we turn the encoder. We just have to set the scale for the right machine unit. When we now start the machine the axis begins to move fitfull. The encoder gives pos-fb to the x axis with some value and the x axis gives exactly the same value as x-pos-cmd to the PID. We now try to get the machine stopped when we push the start button, we try to get it working, will take some time to figure it out i guess.
maybe you got some quick hint for us to look for? We set the PID to defaul P=1 I=0 D=0. Maybe we have to set a offset on the pwmgens?
Greetings
Simon N.
Please Log in or Create an account to join the conversation.
12 Dec 2013 23:33 #41546
by PCW
Replied by PCW on topic Heller CNC machine with encoder
One important thing with the 7I48 is that the PWM mode must be set to UP/DOWN mode (mode 2)
Also when starting you need to make sure the polarity is correct (so you have negative feedback instead of positive)
If the feedback is reversed, it can be fixed by changing the sign of the PWM scale value.
Normally the PWM scale value should be set to the axis velocity in machine units per second
with 10V applied to the drive input (for velocity mode drives).
So for example if your axis speed with 10V input is 100 mm/S you would use a PWM scale of 100
(or -100)
Also when starting you need to make sure the polarity is correct (so you have negative feedback instead of positive)
If the feedback is reversed, it can be fixed by changing the sign of the PWM scale value.
Normally the PWM scale value should be set to the axis velocity in machine units per second
with 10V applied to the drive input (for velocity mode drives).
So for example if your axis speed with 10V input is 100 mm/S you would use a PWM scale of 100
(or -100)
Please Log in or Create an account to join the conversation.
13 Dec 2013 00:27 - 13 Dec 2013 00:28 #41548
by simon n.
Replied by simon n. on topic Heller CNC machine with encoder
Hi PCW,
yes your right, but we already checked that, now we got the problem that the encoders are working but the PWMgens dont work. We guess its the firmware, because the 7i48 is now plugged in P2 from the FPGA. Before that the 7i49 was plugged in slot 3 and the 7i48 in P2, the pwmgens on the 7i49 were working just fine, while the pwmgens from the 7i48 didn't work.
I guess we need a new firmware, where the 7i48 with muxed encoders is plugged in Slot 3 of the FPGA card, so that the pwmgens will work too.
I'll upload our current firmware for you, hope you can help us with that too^^
Greetings
Simon N.
yes your right, but we already checked that, now we got the problem that the encoders are working but the PWMgens dont work. We guess its the firmware, because the 7i48 is now plugged in P2 from the FPGA. Before that the 7i49 was plugged in slot 3 and the 7i48 in P2, the pwmgens on the 7i49 were working just fine, while the pwmgens from the 7i48 didn't work.
I guess we need a new firmware, where the 7i48 with muxed encoders is plugged in Slot 3 of the FPGA card, so that the pwmgens will work too.
I'll upload our current firmware for you, hope you can help us with that too^^
Greetings
Simon N.
Last edit: 13 Dec 2013 00:28 by simon n..
Please Log in or Create an account to join the conversation.
13 Dec 2013 00:39 #41549
by PCW
Replied by PCW on topic Heller CNC machine with encoder
The PWMs probably do work but they will be PWMGens 6..11
This means you will have to enable 12 PWMGens in the config line
This is also rather sub-optimal since the driver will access all the unused PWMGens (0..5)
so you probably want a 7I48 only configuration or at least swap the PWMgen numbers
in the PIN_XXXX file so that the 7I48 has PWMGena 0..5 instead of 6..11
This means you will have to enable 12 PWMGens in the config line
This is also rather sub-optimal since the driver will access all the unused PWMGens (0..5)
so you probably want a 7I48 only configuration or at least swap the PWMgen numbers
in the PIN_XXXX file so that the 7I48 has PWMGena 0..5 instead of 6..11
Please Log in or Create an account to join the conversation.
13 Dec 2013 17:46 - 13 Dec 2013 23:30 #41578
by simon n.
Replied by simon n. on topic Heller CNC machine with encoder
Hey PCW,
yes you're right, but is it possible to edit the PIN file by hand or do we have to program something in C in the bit-file to change that?.
We can also change the PWMgen numbers in the HAL if PWMGen 6..11 works, but if there is a 7i48 only pin/bit-file that would be great too
.
I'll try it on Monday with the swap of the PWMGens, until now we just tested PWMGen 0..5 and that didn't work, so maybe it works when we put XYZ on PWMGen 6,7 and 8!?
Greetings and have a nice weekend
Simon N.
yes you're right, but is it possible to edit the PIN file by hand or do we have to program something in C in the bit-file to change that?.
We can also change the PWMgen numbers in the HAL if PWMGen 6..11 works, but if there is a 7i48 only pin/bit-file that would be great too
![:) :)](/media/kunena/emoticons/smile.png)
I'll try it on Monday with the swap of the PWMGens, until now we just tested PWMGen 0..5 and that didn't work, so maybe it works when we put XYZ on PWMGen 6,7 and 8!?
Greetings and have a nice weekend
Simon N.
Last edit: 13 Dec 2013 23:30 by simon n..
Please Log in or Create an account to join the conversation.
14 Dec 2013 12:06 #41602
by PCW
Replied by PCW on topic Heller CNC machine with encoder
It turns out that there is a suitable pinout file (theres one for 2 7I48s)
so its just a matter of compiling a new bitfile. I've been busy so did not
a chance to do this today, but may be able to compile a new bitfile on
Saturday or Monday.
so its just a matter of compiling a new bitfile. I've been busy so did not
a chance to do this today, but may be able to compile a new bitfile on
Saturday or Monday.
Please Log in or Create an account to join the conversation.
Moderators: cncbasher
Time to create page: 0.388 seconds