Hi
I have try to make a cnc using codesys, We need g54 to shifting Coordinate System. But Z-Axis got unusual movement. Here is a simple g-code to show problem:
(You can see trace image and project file in Attachments.)
But after change N020 to G54 X50 Y50 Z50 then it works fine like magic.
agiBufDecoder seems fine but ipo.piSetPosition not ok. If enable G51(smoothpath), agiBufSmooth also got z=0 state, It's unusual.
So I think the problem cused by NCDecoder. Its only happend on XYZ system.
Please help me if you have any idea. Thanks.
Its cause by Z axis control speed too much. I had try to make AxisZ.fSWMaxVelocity=500, trace result show it got 350mm/s.
But i had set rncf.fDefaultVelFF=100, So any axis speed should not greater than 100mm/s theoretically.
period of the ripples about 500ms. it should cause by speed too large.
rActualSpeed not use in this template, This code is from another large project.
You can try simulate on your computer, Should have same result. We have test it on rpi and x86 rte, got same problem.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have check the process, PathTask to generate a poqpath give cnc, then ipo going position calc.
By trace ipo.poqDataIn^.nReadPos, When problem happen its 0. So i check poqPath^.pbyBuffer^[0].piStartPos and poqPath^.pbyBuffer^[0].piDestPos, Its different. but its should be same i guess cuz no any movement command before g54.
So i add line in preparepath:
IF ncd.bDone THEN poqPath^.pbyBuffer^[0].piStartPos:=poqPath^.pbyBuffer^[0].piDestPos;END_IF
Then it works fine.
BUT, When i try enable smoothpath( need modify program), it got same problem like this post start. I guess there is a public function called in NCDecoder and SmoothPath, so they have the same problem.
SmoothPath poqDataOut maybe calc in movement( not start), so i cannot force startpos to destpos.
I cannot see code in cnc, any suggesting is very useful. For any who want test it, here is project of smoothpath enabled in attachments. if running once, you can see agiBufferSmooth[1].piStartPos.dZ is 50 and agiBufferSmooth[1].piDestPos.dZ is 0, it make speed problem i think.
Thanks you a lot! Insert G17 on gcode then it works fine.
pbyBuffer^[0].piStartpos is cause by ncd.piStartPosition, After give it the axis actual position it also works perfect.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have try to make a cnc using codesys, We need g54 to shifting Coordinate System. But Z-Axis got unusual movement. Here is a simple g-code to show problem:
(You can see trace image and project file in Attachments.)
But after change N020 to G54 X50 Y50 Z50 then it works fine like magic.
agiBufDecoder seems fine but ipo.piSetPosition not ok. If enable G51(smoothpath), agiBufSmooth also got z=0 state, It's unusual.
So I think the problem cused by NCDecoder. Its only happend on XYZ system.
Please help me if you have any idea. Thanks.
more posts ...
Hi,
G51 doesn't work because you don't call SMC_SmoothPath π
can your axis handle the speeds?
a move from 0,0,0 to 10,10,50 means fast z speed.
while move to 50,50,50 divides the speed to all axes.
what is the period of the ripples? does it change with different speed settings?
are you doing anything weird with 'rActualSpeed'?
Hi
Thanks for you reply.
Its cause by Z axis control speed too much. I had try to make AxisZ.fSWMaxVelocity=500, trace result show it got 350mm/s.
But i had set rncf.fDefaultVelFF=100, So any axis speed should not greater than 100mm/s theoretically.
period of the ripples about 500ms. it should cause by speed too large.
rActualSpeed not use in this template, This code is from another large project.
You can try simulate on your computer, Should have same result. We have test it on rpi and x86 rte, got same problem.
Thanks
Hi
I have check the process, PathTask to generate a poqpath give cnc, then ipo going position calc.
By trace ipo.poqDataIn^.nReadPos, When problem happen its 0. So i check poqPath^.pbyBuffer^[0].piStartPos and poqPath^.pbyBuffer^[0].piDestPos, Its different. but its should be same i guess cuz no any movement command before g54.
So i add line in preparepath:
Then it works fine.
BUT, When i try enable smoothpath( need modify program), it got same problem like this post start. I guess there is a public function called in NCDecoder and SmoothPath, so they have the same problem.
SmoothPath poqDataOut maybe calc in movement( not start), so i cannot force startpos to destpos.
I cannot see code in cnc, any suggesting is very useful. For any who want test it, here is project of smoothpath enabled in attachments. if running once, you can see agiBufferSmooth[1].piStartPos.dZ is 50 and agiBufferSmooth[1].piDestPos.dZ is 0, it make speed problem i think.
Thanks.
Related
Talk.ru: 1
try setting 3d mode with G17 or G16 before you enable smooth path preprocessing (g51).
this should fix your issues with 0 values for dZ
Thanks you a lot! Insert G17 on gcode then it works fine.
pbyBuffer^[0].piStartpos is cause by ncd.piStartPosition, After give it the axis actual position it also works perfect.
Thanks!