wrap y to a axis

More
30 Aug 2023 17:18 #279398 by chris@cnc
wrap y to a axis was created by chris@cnc
Hello,
I am trying to engrave a cylinder. My idea was to program in X and Y and the machine convert the Y CAD data into angular position and rotate the axis.
I wrote a custom comp that also works in the halshow. A simple test was to move the Y axis 3.14mm with a diameter of 2mm and then rotate A 180 degrees.
ytoa.0.ypos is the input and ytoa.0.a is the angle converted.
With M100 / M101 it should be switched on and off.
A few questions remain unanswered and perhaps someone can help.
1. How can I forward the angle from ytoa.0.a to joint.3.motor-pos-cmd to avoid the following error?
2. My vismach is still bent. The A axis should rotate around itself and not in circle?
3. How can I clamp a workpiece there that will be engraved?
I attached my working folder.
Thank you...
Attachments:

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

More
30 Aug 2023 17:32 #279400 by Aciera
Replied by Aciera on topic wrap y to a axis
Regarding the vismach model: Try changing this:

# A-axis move to X, Y, Z centerpoint
atable = Translate([atable],600,200,-200)

atable = HalRotate([atable],c,"ja",1,0,0,1)

To this (ie add the rotation before the translation):

atable = HalRotate([atable],c,"ja",1,0,0,1)
# A-axis move to X, Y, Z centerpoint
atable = Translate([atable],600,200,-200)

I cannot test your config right now as I am away from my test setup.

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

More
30 Aug 2023 18:38 - 30 Aug 2023 18:43 #279403 by Aciera
Replied by Aciera on topic wrap y to a axis
Regarding following error:
Linking and unlinking 'ytoa.0.ypos' is likely to create a discontinuous signal for motor command which in turn creates a following error. To avoid that you may want to pass 'ytoa.0.ypos' through a 'limit3' component:
linuxcnc.org/docs/html/man/man9/limit3.9.html
Alternatively you could write a custom kinematic component to switch between trivial and wrapped kinematics.

Regarding the work piece:
Do you mean simulating the work piece in the vismach model? You can create a Cylinder in vismach that will dynamically change it's diameter with the 'diam' value of your component. Have a look how the tool cylinder is created in the other vismach models.
Last edit: 30 Aug 2023 18:43 by Aciera.
The following user(s) said Thank You: chris@cnc

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

More
30 Aug 2023 18:40 #279404 by chris@cnc
Replied by chris@cnc on topic wrap y to a axis
 Yes. One point less. 
correct line is 
atable = HalRotate([atable],c,"ja",1,1,0,0)
# A-axis move to X, Y, Z centerpoint
atable = Translate([atable],600,200,-200)


 
Attachments:

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

More
30 Aug 2023 18:56 #279405 by Hakan
Replied by Hakan on topic wrap y to a axis
An alternative is to do the conversion in the g-code post processor.

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

More
30 Aug 2023 19:01 #279407 by chris@cnc
Replied by chris@cnc on topic wrap y to a axis

An alternative is to do the conversion in the g-code post processor.

 I did it last years. But the target should be one parameter program including scaling.

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

More
30 Aug 2023 19:03 #279408 by Aciera
Replied by Aciera on topic wrap y to a axis

An alternative is to do the conversion in the g-code post processor.

Yes or as another alternative use a python filter script that changes the XYZ to XAZ code.
 

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

More
30 Aug 2023 19:10 #279409 by chris@cnc
Replied by chris@cnc on topic wrap y to a axis

Regarding following error:
Linking and unlinking 'ytoa.0.ypos' is likely to create a discontinuous signal for motor command which in turn creates a following error. To avoid that you may want to pass 'ytoa.0.ypos' through a 'limit3' component:
linuxcnc.org/docs/html/man/man9/limit3.9.html
 

I try 
halcmd unlinkp joint.3.motor-pos-cmd
halcmd net J3:pos-cmd ytoa.0.a J3_pid.command
but after 0,3mm i got position error. I guess the limit3 will not help
 

Alternatively you could write a custom kinematic component to switch between trivial and wrapped kinematics.
 


I try it but this is behind my mind.

 

Regarding the work piece:
Do you mean simulating the work piece in the vismach model? You can create a Cylinder in vismach that will dynamically change it's diameter with the 'diam' value of your component. Have a look how the tool cylinder is created in the other vismach models.
 

Yes. if the diameter for "setp ytoa.0.diam 2" change should be the workpiece diam in vismach change too.

Good idea 

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

More
31 Aug 2023 07:42 #279452 by Hakan
Replied by Hakan on topic wrap y to a axis
I think it is cool if you can make this work. I'll keep watching.

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

More
31 Aug 2023 08:03 #279454 by Aciera
Replied by Aciera on topic wrap y to a axis

I try 
halcmd unlinkp joint.3.motor-pos-cmd
halcmd net J3:pos-cmd ytoa.0.a J3_pid.command
but after 0,3mm i got position error. I guess the limit3 will not help

I'm not sure partially because I'm really not very clear on how the position command and feedback is handled in a sim config but I feel that using a custom kinematic component would make things a lot simpler since you don't need to link and unlink command signals and the a-axis motion would still be handled in the motion planner. It probably can be done in a hal component but to me it seems somehow like reinventing the wheel.

Anyway the attached config contains a modified vismach model with dynamic work piece diameter which you may find useful.
Attachments:
The following user(s) said Thank You: tommylight

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

Time to create page: 0.138 seconds
Powered by Kunena Forum