Spindle Encoder
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 00:17 #263880
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
the line:
setp [HMOT](CARD0).encoder.04.counter-mode 0
shouldn't this be set to 1?
setp [HMOT](CARD0).encoder.04.counter-mode 0
shouldn't this be set to 1?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23160
- Thank you received: 4857
07 Feb 2023 00:31 #263882
by andypugh
Replied by andypugh on topic Spindle Encoder
No, counter-mode ignores quadrature so the counter counts up regardless of direction. You don't want that mode.
Please Log in or Create an account to join the conversation.
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 00:34 #263883
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
ah ok, no that would be bad.
Please Log in or Create an account to join the conversation.
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 21:30 #263976
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
Hello,
so there is good news i managed to set up the index signal manually and it also goes off when it hits the npn sensor.
on the one hand I have the spindle-pos-rowcounts. these always go the opposite way. is that normal? If I turn to +, they go to --. and the other way around.
However, I am still puzzled as to how I can get the whole thing added when the spindle turns.
My servo motor has 56 teeth and the spindle has 22 teeth. The encoder is on the servo while the npn sensor is on the spindle.
I checked the speed and it was correct when I calculated it. When the encoder resolution, I'm unsure.
step scale -10000
encoder scale -10000?
to the encoder of power 4x2500ppr
so there is good news i managed to set up the index signal manually and it also goes off when it hits the npn sensor.
on the one hand I have the spindle-pos-rowcounts. these always go the opposite way. is that normal? If I turn to +, they go to --. and the other way around.
However, I am still puzzled as to how I can get the whole thing added when the spindle turns.
My servo motor has 56 teeth and the spindle has 22 teeth. The encoder is on the servo while the npn sensor is on the spindle.
I checked the speed and it was correct when I calculated it. When the encoder resolution, I'm unsure.
step scale -10000
encoder scale -10000?
to the encoder of power 4x2500ppr
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17917
- Thank you received: 4799
07 Feb 2023 21:40 - 07 Feb 2023 21:43 #263977
by PCW
Replied by PCW on topic Spindle Encoder
XXX The encoder scale should be 22/56*10000 = 3928.57 (counts per turn)
EDIT: Sorry the encoder scale should just be 10000 (or -10000 to get the direction correct)
The step scale only affects the spindle RPM scaling
(unless you need to orient the spindle)
EDIT: Sorry the encoder scale should just be 10000 (or -10000 to get the direction correct)
The step scale only affects the spindle RPM scaling
(unless you need to orient the spindle)
Last edit: 07 Feb 2023 21:43 by PCW.
Please Log in or Create an account to join the conversation.
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 22:11 #263980
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
ok but when will the controller release the index. I tested it manually.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17917
- Thank you received: 4799
07 Feb 2023 22:21 - 07 Feb 2023 22:22 #263981
by PCW
Replied by PCW on topic Spindle Encoder
LinuxCNC sets index enable when it starts a spindle synchronized move.
When the hardware detects the index, (and index enable is true) index enable
is set false, and the encoder position is cleared. Index enable going false
signals LinuxCNC to begin the spindle synchronized axis move.
When the hardware detects the index, (and index enable is true) index enable
is set false, and the encoder position is cleared. Index enable going false
signals LinuxCNC to begin the spindle synchronized axis move.
Last edit: 07 Feb 2023 22:22 by PCW. Reason: clarify
Please Log in or Create an account to join the conversation.
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 22:30 #263982
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
So I can test it eg. with g33.1.
what is it like at the beginning of a program, until now the machine has always stopped, is the machine also waiting for the index there?
what is it like at the beginning of a program, until now the machine has always stopped, is the machine also waiting for the index there?
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17917
- Thank you received: 4799
07 Feb 2023 22:57 #263985
by PCW
Replied by PCW on topic Spindle Encoder
If you have gcode for a spindle synchronized move
you need:
spindle-at-speed true
index working
spindle running and encoder counting in the correct direction
before the synchronized motion will proceed
you need:
spindle-at-speed true
index working
spindle running and encoder counting in the correct direction
before the synchronized motion will proceed
Please Log in or Create an account to join the conversation.
- Stefan321
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
07 Feb 2023 23:02 #263988
by Stefan321
Replied by Stefan321 on topic Spindle Encoder
is that correct spindle-at-speed goes off when the spindle is turning and is active when the spindle is on? I noticed today on the Hal show
here is a small example
%
(TEST )
(BEARBEITEN)
( HERSTELLER MAHO )
( MODEL MH600E)
( DESCRIPTION GENERIC 3-AXIS)
(T7 D=8. CR=0. - ZMIN=-21. - SCHAFTFRSER)
N10 G90 G94 G17 G91.1
N20 G21
(PLANEN 8)
N30 T7 M6
N40 S3979 M3
N50 G54
N60 G64 P0.01 Q0.01
N70 G0 X13.021 Y-31.145
N80 G43 Z15. H7
N90 G1 Z5. F954.93
N100 Z0.8 F318.31
All axes stop in line N80 as soon as g1 appears in the next line
here is a small example
%
(TEST )
(BEARBEITEN)
( HERSTELLER MAHO )
( MODEL MH600E)
( DESCRIPTION GENERIC 3-AXIS)
(T7 D=8. CR=0. - ZMIN=-21. - SCHAFTFRSER)
N10 G90 G94 G17 G91.1
N20 G21
(PLANEN 8)
N30 T7 M6
N40 S3979 M3
N50 G54
N60 G64 P0.01 Q0.01
N70 G0 X13.021 Y-31.145
N80 G43 Z15. H7
N90 G1 Z5. F954.93
N100 Z0.8 F318.31
All axes stop in line N80 as soon as g1 appears in the next line
Please Log in or Create an account to join the conversation.
Time to create page: 0.111 seconds