wrap y to a axis
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
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...
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
# 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.
- Aciera
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
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.
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
- Posts: 504
- Thank you received: 157
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
I did it last years. But the target should be one parameter program including scaling.An alternative is to do the conversion in the g-code post processor.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
Yes or as another alternative use a python filter script that changes the XYZ to XAZ code.An alternative is to do the conversion in the g-code post processor.
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
- Posts: 529
- Thank you received: 139
I tryRegarding 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
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.
Yes. if the diameter for "setp ytoa.0.diam 2" change should be the workpiece diam in vismach change too.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.
Good idea
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
- Posts: 504
- Thank you received: 157
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
- Posts: 4001
- Thank you received: 1729
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.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
Anyway the attached config contains a modified vismach model with dynamic work piece diameter which you may find useful.
Please Log in or Create an account to join the conversation.