setting up schaublin 125 cnc lathe with carousel toolchanger

More
7 years 9 months ago - 7 years 9 months ago #125434 by inoxix
I think this is not the only problem with the S mode.

1. Senor(0) is never correct evaluated, the loop aborts at i=0 regardless of signal state
Code:
case 'S': // individual sensors for (i = inst_sense - 1; sense(i) == 0 && i > 0 ; i--) {} p = i; break;
If no sensor is active p is then always assigned 0 (or 1 as above).

2. current_position is only updated when strobe is set.
Code:
if (strobe) { current_position = p; parity_error = (pcalc != (inst_parity ^ parity_)); }
The moving state machine keeps just moving the turret. To use strobe doesn't make much sense in S mode. So, current_position is always 0. Of course we could bind all sensor signals with an or together and generate a strobe as workaround.

Regards,
Tom
Last edit: 7 years 9 months ago by inoxix.

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #125435 by trilobyte
halcompile does not work on my computer:

trilobyte@trilobyte:~$ ls
Bilder Dokumente linuxcnc Öffentlich Videos
carousel.comp Downloads Musik Schreibtisch Vorlagen
trilobyte@trilobyte:~$ sudo halcompile --install carousel.comp
[sudo] Passwort für trilobyte:
Traceback (most recent call last):
File "/usr/bin/halcompile", line 1431, in <module>
main()
File "/usr/bin/halcompile", line 1401, in main
process(f, mode, outfile)
File "/usr/bin/halcompile", line 1267, in process
a, b = parse(filename)
File "/usr/bin/halcompile", line 424, in parse
a, b = f.split("\n;;\n", 1)
ValueError: need more than 1 value to unpack
trilobyte@trilobyte:~$

its a installation from this image:
www.linuxcnc.org/testing-stretch-rtpreempt/
i addet these stanzas:
deb buildbot.linuxcnc.org/ stretch master-rtpreempt
deb-src buildbot.linuxcnc.org/ stretch master-rtpreempt
to my sources.list.d

i updated the system with apt-get update, apt-get dist-upgrade

peter

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #125467 by andypugh

inoxix wrote: I think this is not the only problem with the S mode.
1. Senor(0) is never correct evaluated, the loop aborts at i=0 regardless of signal state


Good point. Something like this is probably required
Code:
case 'S': // individual sensors for (i = inst_sense - 1; sense(i) == 0 && i > 0 ; i--) {} if (sense(i)) p = i + 1; break;

Of course we could bind all sensor signals with an or together and generate a strobe as workaround.

That would be one approach but doesn't solve the off-by-one. (Note that strobe is set TRUE by default, it can only be FALSE if it is actually connected in HAL)

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #125468 by andypugh

trilobyte wrote: halcompile does not work on my computer:
...
a, b = f.split("\n;;\n", 1)
ValueError: need more than 1 value to unpackr


This indicates that your carousel.comp file has been passed through a Windows (or Classic Mac) system and the end-of-line characters are no longer a simple \n (linefeed)
The line above is looking for the ";;" delimiter in a .comp file that separates the setup instructions from the actual C code.

And halcompile really ought to deal better with this situation.

If you can correct the end-of-line characters then it ought to work.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #125561 by trilobyte
Hi Andy

i created the carousel.comp with notepad++ on windows and copied the file via win scp to the linuxcomputer. after that the halcompile worked.

Unfortunately position 0 still does not work.

i edited the original carousel.comp with this:

"case 'S': // individual sensors
for (i = inst_sense - 1; sense(i) == 0 && i > 0 ; i--) {}
if (sense(i)) p = i + 1;
break;"

enable is true, motor fwd isn't.
position 1,2,3 are working.

peter

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago - 7 years 8 months ago #125721 by inoxix
Hi Andy

I created a fix for Peter and he confirmed it's now working. I will create a pull request as soon as I have figured out all the github stuff ;).

We also found another glitch in the code when T0 is requested. The carousel goes into an endless mode. In case of turret tool changer T0 doesn't make much sense and an error handling could be added. Maybe this is by intention and a useful case in other configurations.

Tom

Update:
Pull Request created: github.com/LinuxCNC/linuxcnc/pull/557
Last edit: 7 years 8 months ago by inoxix.

Please Log in or Create an account to join the conversation.

Time to create page: 0.229 seconds
Powered by Kunena Forum