ATC Project - Debug phase
20 May 2022 01:17 - 20 May 2022 02:04 #243378
by spumco
In addition, I compared carousel.comp in my installation to the github version linked earlier and they're identical.
Same behavior as before:
Thanks for your patience,
-R
Replied by spumco on topic ATC Project - Debug phase
Yes, the 'homed' pin sets.
Still have an issue with the homing - keep rotating indefinately until I kill it with an M65 P0.
Looking at the code, it shouldn't...
What is the "state" pin showing in this scenario? Does the "homed" pin set?
In addition, I compared carousel.comp in my installation to the github version linked earlier and they're identical.
Same behavior as before:
- setting carousel.enable pin high results in continuous rotation (M64 P0).
- setting an M68 E0 Qn before the first enable makes no difference.
- 'homed' pin goes high when the index sensor is triggered
- current position doesn't count up/down until I stop it with an M65 P0
- jog-fwd and jog-rev both index one pocket, and the current position counts up/down appropriately.
- carousel.0.state
- "0" before first enable
- "0" after M68 E0 Q2
- "11" after first enable
- "2" after sense-0 is first triggered
- "4" after sense-1 is triggered
- "0" after M65 P0 (at random location
- "5" while jog-fwd or -rev is enabled
- "0" when jog-fwd or -rev is disabled
Thanks for your patience,
-R
Last edit: 20 May 2022 02:04 by spumco. Reason: carousel.comp compare
Please Log in or Create an account to join the conversation.
20 May 2022 09:35 #243399
by andypugh
Replied by andypugh on topic ATC Project - Debug phase
Firstly, if you are on Bullseye then you won't find linuxcnc-uspace-dev as there are no packages for bullseye...
I think that the problem here is that enable is being set with tool = 0?
In the simplest situation you would connect carousel.0.enable to iocontrol.0.tool-prepare and carousel.0.ready to iocontrol.0.tool-prepared.
This would stop the carousel at the requested tool, and then "turn off" the component.
I think that in your case the carousel is rotating indefinitely looking for a non-existent pocket 0.
Is the behaviour better if you set the pocket -number to 1 before enabling the component?
Maybe "enable" should have been called "find" or something. It is expected to be set true only when it should be finding a tool.
I think that the problem here is that enable is being set with tool = 0?
In the simplest situation you would connect carousel.0.enable to iocontrol.0.tool-prepare and carousel.0.ready to iocontrol.0.tool-prepared.
This would stop the carousel at the requested tool, and then "turn off" the component.
I think that in your case the carousel is rotating indefinitely looking for a non-existent pocket 0.
Is the behaviour better if you set the pocket -number to 1 before enabling the component?
Maybe "enable" should have been called "find" or something. It is expected to be set true only when it should be finding a tool.
Please Log in or Create an account to join the conversation.
20 May 2022 11:44 #243404
by spumco
Replied by spumco on topic ATC Project - Debug phase
I set the pocket number to 1 (via M68) before the first enable (and homing) and the behavior changed a bit.
M68 E0 Q1 => state changed to 11, pocket-number changed from 0 to 1, current-position is at 0
M64 P0 => carousel started rotating CCW, 'homing' pin goes high
Sense-0 is triggered => rotation reverses, state changed to 4, current position changed from 0 to 1, 'homed' pin goes high, 'homing' pin goes low.
Rotation continues CW without stopping until M65 P0
The primary change is that the rotation reversed when the sense-0 is triggered, but it's still not stopping.
M68 E0 Q1 => state changed to 11, pocket-number changed from 0 to 1, current-position is at 0
M64 P0 => carousel started rotating CCW, 'homing' pin goes high
Sense-0 is triggered => rotation reverses, state changed to 4, current position changed from 0 to 1, 'homed' pin goes high, 'homing' pin goes low.
Rotation continues CW without stopping until M65 P0
The primary change is that the rotation reversed when the sense-0 is triggered, but it's still not stopping.
Please Log in or Create an account to join the conversation.
20 May 2022 12:58 #243406
by andypugh
Replied by andypugh on topic ATC Project - Debug phase
Can you attach your HAL file?
What is the state during the continuous rotation?
What is the status of motor-fwd, motor-rev and motor_vel ?
What is the state during the continuous rotation?
What is the status of motor-fwd, motor-rev and motor_vel ?
Please Log in or Create an account to join the conversation.
20 May 2022 15:14 #243411
by spumco
State during continuous rotation is 4. This hasn't changed from my earlier post:
Replied by spumco on topic ATC Project - Debug phase
I will attach HAL when I get home later today, but the snippet I posted on page 1 of this thread is essentially unchanged (besides changing rev-dc to a negative number)Can you attach your HAL file?
What is the state during the continuous rotation?
What is the status of motor-fwd, motor-rev and motor_vel ?
State during continuous rotation is 4. This hasn't changed from my earlier post:
- carousel.0.state
- "0" before first enable
- "0" after M68 E0 Q2
- "11" after first enable
- "2" after sense-0 is first triggered
- "4" after sense-1 is triggered (during continuous rotation)
- "0" after M65 P0 (at random location
- "5" while jog-fwd or -rev is enabled
- "0" when jog-fwd or -rev is disabled
Please Log in or Create an account to join the conversation.
20 May 2022 16:02 #243412
by andypugh
I think I see a bug, though not one that might usually be seen
"2" is looking for the position to be correct
I think that motor_rev = twice is a bug. But would probably only cause issues if hold_dc is non-zero.
Replied by andypugh on topic ATC Project - Debug phase
[*]"2" after sense-0 is first triggered
[*]"4" after sense-1 is triggered (during continuous rotation)
I think I see a bug, though not one that might usually be seen
"2" is looking for the position to be correct
case 2: // moving
if ((current_position != mod_pocket) && enable) return;
if (rev_pulse > 0){
motor_fwd = 0;
motor_rev = 1;
motor_vel = rev_dc;
timer = rev_pulse;
state = 3;
} else {
motor_fwd = 0;
motor_rev = 0;
motor_rev = hold_dc;
active = 0;
if (enable) ready = 1;
state = 4;
break;
}
I think that motor_rev = twice is a bug. But would probably only cause issues if hold_dc is non-zero.
Please Log in or Create an account to join the conversation.
20 May 2022 19:35 - 20 May 2022 19:37 #243421
by andypugh
Replied by andypugh on topic ATC Project - Debug phase
You can get linuxcnc-usapce-dev as a package here:
www.linuxcnc.org/dists/buster/2.8-rtpree...-dev_2.8.2_amd64.deb
Install it with
sudo apt-get install ./linuxcnc-uspace-dev_2.8.2_amd64.deb
You need the./ to tell apt to look for a local file, not something on the repository servers.
Then try changing the code above to:
Then
sudo halcompile --install carousel.comp
And see if things are better.
www.linuxcnc.org/dists/buster/2.8-rtpree...-dev_2.8.2_amd64.deb
Install it with
sudo apt-get install ./linuxcnc-uspace-dev_2.8.2_amd64.deb
You need the./ to tell apt to look for a local file, not something on the repository servers.
Then try changing the code above to:
} else {
motor_fwd = 0;
motor_rev = 0;
motor_vel = hold_dc;
active = 0;
if (enable) ready = 1;
state = 4;
break;
}
Then
sudo halcompile --install carousel.comp
And see if things are better.
Last edit: 20 May 2022 19:37 by andypugh.
Please Log in or Create an account to join the conversation.
20 May 2022 21:15 - 20 May 2022 21:23 #243435
by spumco
HAL attached, just in case I forgot some changes in my post earlier today.
I'll have a go at the halcompile right now.
EDIT - downloaded .deb
sudo apt-get install ./linuxcnc-uspace-dev_2.8.2_amd64.deb
Reading package lists... Done
E: Unsupported file ./linuxcnc-uspace-dev_2.8.2_amd64.deb given on commandline
Bugger.
Replied by spumco on topic ATC Project - Debug phase
Can you attach your HAL file?
What is the state during the continuous rotation?
What is the status of motor-fwd, motor-rev and motor_vel ?
- M68 E0 Q1
- carousel.0.motor-fwd = LOW
- carousel.0.motor-rev = LOW
- carousel.0.motor-vel = 0
- carousel.0.current-position = 0
- carousel.0.pocket-number = 1
- M64 P0
- carousel rotates CCW
- carousel.0.motor-fwd = HIGH
- carousel.0.motor-rev = LOW
- carousel.0.motor-vel = 5
- carousel.0.current-position = 0
- carousel.0.pocket-number = 1
- carousel.0.homed = LOW
- carousel.0.homing = HIGH
- sense-0 triggered
- carousel reverses direction (CW)
- carousel.0.motor-fwd = LOW
- carousel.0.motor-rev = LOW
- carousel.0.motor-vel = -5
- carousel.0.current-position = 1
- carousel.0.pocket-number = 1
- carousel.0.homed = HIGH
- carousel.0.homing = LOW
- M65 P0
- carousel stops
- carousel.0.motor-fwd = LOW
- carousel.0.motor-rev = LOW
- carousel.0.motor-vel = 0
- carousel.0.current-position = 1
- carousel.0.pocket-number = 1
- carousel.0.homed = HIGH
- carousel.0.homing = LOW
HAL attached, just in case I forgot some changes in my post earlier today.
I'll have a go at the halcompile right now.
EDIT - downloaded .deb
sudo apt-get install ./linuxcnc-uspace-dev_2.8.2_amd64.deb
Reading package lists... Done
E: Unsupported file ./linuxcnc-uspace-dev_2.8.2_amd64.deb given on commandline
Bugger.
Last edit: 20 May 2022 21:23 by spumco.
Please Log in or Create an account to join the conversation.
20 May 2022 21:33 - 20 May 2022 21:36 #243436
by spumco
Can I just paste the updated code in /dev/linuxcnc/rip/src/hal/components/carousel.comp?
Replied by spumco on topic ATC Project - Debug phase
Disregard post, was looking at the imported version, not what's installed.
Can I just paste the updated code in /dev/linuxcnc/rip/src/hal/components/carousel.comp?
Last edit: 20 May 2022 21:36 by spumco. Reason: Duh
Please Log in or Create an account to join the conversation.
20 May 2022 22:51 #243442
by andypugh
(Which makes it all the more strange that you don't have halcompile)
Can you try halcompile -h in both a new terminal and one that has run the rip-environment script?
Replied by andypugh on topic ATC Project - Debug phase
Yes. Sorry, I had forgotten that you had a run-in-place version available.
Can I just paste the updated code in /dev/linuxcnc/rip/src/hal/components/carousel.comp?
(Which makes it all the more strange that you don't have halcompile)
Can you try halcompile -h in both a new terminal and one that has run the rip-environment script?
Please Log in or Create an account to join the conversation.
Time to create page: 0.103 seconds