component compile problem

More
5 years 4 weeks ago - 5 years 4 weeks ago #222016 by tjtr33
Replied by tjtr33 on topic component compile problem
That error can be from the missing left justified ;;
( as gaston48 replied )
usually located between pin declarations and FUNCTION (_)
or
from bad line endings ( unix is LF hex 0a )
i've experience both reasons.
there may be more.
( heh the ';;' looks pretty useless but dont forget it! )
tomp
Last edit: 5 years 4 weeks ago by tjtr33. Reason: credit poster

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

More
3 years 11 months ago - 3 years 11 months ago #257743 by AlexMagToast
Hello guys,
A couple Years later i also got my hands on the same type of Weiler Primus CNC.
Thanks for @Skidloaders1  for sharing your files.

I am currently finishing rewiring everything and starting to get the machine working with LinuxCNC and this thread will certainly help me with getting the Turret going.
For those interested, i have made an animation from the machine manual, explaining how the turret works and how it is driven hardware wise.
beginning @(12:12)
Youtube

Is using the CAROUSEL component, what you still would reccomend for me?
The turret can have multiple Tools per side, so i guess i have to specify in the tooltable, on which side they are mounted and apply an offset. Lots of stuff to learn for me.

Thanks four your years of service for the community!

Cheers, Alex
Last edit: 3 years 11 months ago by AlexMagToast.

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

More
3 years 11 months ago #257771 by andypugh
Replied by andypugh on topic component compile problem
Carousel might work, though I am a little confused about the rotation sequence.
It looks like it needs to open one valve until a sensor triggers, then it needs to trigger a different valve to lock, and that advances one position.

The carousel comp expects the carousel to carry on moving through successive pocket positions all the time that the "motor-fwd" pin is held high.

In this case I think it might be simplest to do it all as a G-code subroutine or a dedicated HAL component as it is quite a simple sequence and interpreting the position sensors is fairly easy.

Is there a sensor to indicate that the piston is at the end of travel, or is it done purely on time?

To use "carousel" you would need to use something like a one-shot HAL component to pulse the solenoid valves, and at that point there is more happening outside carousel than inside.

Note that the "tooledit" programme will not allow multiple tools in the same pocket, and your changer seems to require that. You can edit the tool table with a text editor, though, and get the desired result.

Are you more comfortable with G-code or C for the control sequence?

One advantage of using a G-code remap is that you can
Code:
O<toolchange> SUB ; normally these would be done with the python prolog routines, but ; I know that the HAL pins have the right values when multiple tools ; specify the same pocket. #1 = #<_hal[iocontrol.0.tool-prep-pocket]> #2 = #<_hal[iocontrol.0.tool-prep-number]> ; check the motion.digital-in-NN pin corresponding to the selected pocket M66 P[#1] L0 O100 WHILE [#5399 EQ 0] M65 P2 ; signal tool prepare in progress M64 P0 ; start rotation, open S1 G4 P0.5 ; wait to finish stage 1 M65 P0 ; close S1 M64 P1 ; open S2 G4 P0.5 ; wait M65 P1 ; close S2 M66 P[#1] L0 ; re-check the sensor corresponding to the pocket O100 ENDWHILE ; Should now be in position and locked, so signal tool-prepared; M64 P2 do the toolchange ; and apply the tool ofsets here rather than in the main G-code M6 T[#2] G43 O<toolchange> ENDSUB M2

This requires a few HAL connections to work.

net tool-prepared motion.digital-out-02 => iocontrol.0.tool-prepared
net M6-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
net pos-1 motion.digital-in-01 <= { hardware input for positionl 1}
net pos-2 motion.digital-in-02 <= { hardware input for positionl 2}
net pos-3 motion.digital-in-03 <= { hardware input for positionl 3}
net pos-4 motion.digital-in-04 <= { hardware input for positionl 4}
net valve-S1 motion.digital-out-00 => {output pin for S1}
net valve-S2 motion.digital-out-01 => {output pin for S2}
The following user(s) said Thank You: AlexMagToast

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

More
3 years 11 months ago #257773 by andypugh
Replied by andypugh on topic component compile problem
Also, the code should check that the pocket number is in range, and it would be wise to have a counter that aborts the tool change after 4 rotations, as that means something has gone wrong if it hasn't found the pocket.
The following user(s) said Thank You: AlexMagToast

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

More
3 years 11 months ago #257787 by AlexMagToast
thank you for your quick reply.

Carousel might work, though I am a little confused about the rotation sequence.
It looks like it needs to open one valve until a sensor triggers, then it needs to trigger a different valve to lock, and that advances one position.

Yes, there is a piston inside and it has to be pushed up and down per cycle. I think Skidloaders1got around this by placing several timers in his hal file.

Is there a sensor to indicate that the piston is at the end of travel, or is it done purely on time?

As i understand the piston is shaped in such a way, that the turret reaches next position if the piston is up. So basicly i have to enable Selenoid 1 till next pos is reached, switch selenoid 1 off an 2 on and wait couple seconds and repeat if neccesarry. So appart of 4 pos switches there are only these 2 selenoids and the hydraulic pump that migth want to be checked if it is set to run. I guess it should be a simple script.

To use "carousel" you would need to use something like a one-shot HAL component to pulse the solenoid valves, and at that point there is more happening outside carousel than inside.

yes, that is what Skidloaders1 is doing too.

Note that the "tooledit" programme will not allow multiple tools in the same pocket, and your changer seems to require that. You can edit the tool table with a text editor, though, and get the desired result.

hm i see, i was hoping to maybe misuse the orientation parameter, but i have not yet figured out, how all of this works. how i might be able to acces these parameters for example. I guess setting it manually in a textfile is ok too.

Are you more comfortable with G-code or C for the control sequence?

Good question, i think both would be considerable for me. I have read several forum threads, where these approaches and also using classicladder was discussed. I have to admit i am fairly new to the game and have much to figure out still. right now, i don't understand benefits of one or another.
But if i see correctly you just wrote a Gcode subroutine for me, so i guess this one i'll try first :) Thank you!

now that i am asking about these kind of expansions for linuxcnc. I also need to find a way to trigger a lube pump while axis are moving. what do you think of the idea to just write a simple python script and load it in userspace? precise Timing should be irrelevant for such applications, right? I could also imagine turning the turret with this method. what do you think about this? does it matter how much is in servo thread and how much in user thread?

Thanks, Alex


PS. for people going through this thread in the future that might be interested in my config files, i published my linuxCNC config folder to github and you can find my current setup here (at the time of me posting this, this is still work in progress of course): github.com/AlexmagToast/WeilerPrimusCNC_LinuxCNC_config

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

More
3 years 3 months ago - 3 years 3 months ago #276102 by AlexMagToast
just to close this thread from my side, i am proud to report, i found a solution that works very well for me and provides 100% functionality for the Turret.
As described i own the very same Lathe as Skidloaders1 with the same Turret as him.

I ended up creating a python component, which waits for the toolchange pin go high.
It will then go through the tooltable and see, which position the ordered Tool is at and where the Turret is atm.
I added a parameter in the comment section, which represents side 1-4 for each tool.
Now if the ordered Tool is on another side than present, it will cycle through the hydraulic process till the right side is reached.
After that the Toolchanged Pin is set high and the process is given back to LinuxCNC.

So i can set Offsets and Position on the Turret in the tooltable and i can order Tools via Gcode as usual.

For reference here is my code:
github.com/AlexmagToast/LinuxCNC-Sauter-HeadRevolver

I think this approach is quite easy and versatile.
Cheers,
Alex
Last edit: 3 years 3 months ago by AlexMagToast.
The following user(s) said Thank You: besriworld

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

Time to create page: 0.460 seconds
Powered by Kunena Forum