Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lathe taper problem. #370

Closed
nickshl opened this issue Apr 6, 2024 · 4 comments
Closed

Lathe taper problem. #370

nickshl opened this issue Apr 6, 2024 · 4 comments

Comments

@nickshl
Copy link

nickshl commented Apr 6, 2024

Hi @terjeio, could you try to cut taper? But with real part please :)

There is a problem in this line: https://github.com/terjeio/ioSender/blob/614115d80c1f6c792112371e94f73741558cc407/CNC%20Controls%20Lathe/CNC%20Controls%20Lathe/TurningLogic.cs#L181C1-L181C100

It should be like this(see the comment):

if (angle != 0.0d)
{
    ztarget = cut.Distance / angle * model.config.ZDirection;
    model.gCode.Add(string.Format("G1 X{0} Z{1}", model.FormatValue(diameter), model.FormatValue(zstart + ztarget)));
}
else
{
    model.gCode.Add(string.Format("G1 Z{0} F{1}", model.FormatValue(ztarget), model.FormatValue(feedrate)));
    model.gCode.Add(string.Format("G0 X{0}", model.FormatValue(xtarget + xclearance))); // THIS LINE MUST BE INSIDE else STATEMENT !!!
}
model.gCode.Add(string.Format("G0 Z{0}", model.FormatValue(zstart + model.config.ZClearance / model.UnitFactor)));

I almost ruined the workpiece because of that. I actually ruined it anyway, but it completely my fault.

@nickshl
Copy link
Author

nickshl commented Apr 17, 2024

@terjeio any updates on this issue? This is an example with 1 mm cut, clearance, last pass 45 degree taper:

G18 G8 G21
M3S100 G4P1
G0 X6.000
G0 Z0.500
G97
(Pass: 1, DOC: 4.000 1.000)
G1 X4.000 F200.000
G1 X5.000 Z-1.000
G0 X5.000; // THIS LINE SHOULDN'T BE THERE !
G0 Z0.500
(Pass: 2, DOC: 3.000 1.000)
G1 X3.000 F200.000
G1 X5.000 Z-2.000
G0 X4.000; // SO THIS!
G0 Z0.500
(Pass: 3, DOC: 2.000 1.000)
G1 X2.000 F200.000
G1 X5.000 Z-3.000
G0 X3.000; // AND THIS!
G0 Z0.500
(Pass: 4, DOC: 1.000 1.000)
G1 X1.000 F200.000
G1 X5.000 Z-4.000
G0 X2.000; // THIS ONE TOO!
G0 Z0.500
(Pass: 5, DOC: 0.000 1.000)
G1 X0.000 F100.000
G1 X5.000 Z-5.000
G0 X1.000; // At this point it will be 2 mm rod instead taper...
G0 Z0.500

Without fix, it cut taper, then at the end of this taper it moves cutter to the center.
This is a bug to use taper minor diameter to calculate clearance, taper major diameter should be used. Or it shouldn't be used at all since it unnecessary - when we move Z to start position, it immediately clear from part because of taper.

@terjeio
Copy link
Owner

terjeio commented Apr 17, 2024

Not yet, I have been quite busy with private assignments lately.

@terjeio
Copy link
Owner

terjeio commented Apr 21, 2024

I have uploaded new edge versions for you to try - when a taper is selected only current and target diameter is used for the calculations - and Z length is calculated as well. I have also enabled entry of fractional degrees and I flag an error if the angle is >= 90 degrees. I have not yet implemented/verified internal tapers and the UI could be improved.

What do you think?

@nickshl
Copy link
Author

nickshl commented Apr 22, 2024

Looks good now. How it used to be, you can check there: https://youtu.be/5Wq_Iub6t_M?t=272

@terjeio terjeio closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants