Matlab help and doubt

10 views (last 30 days)
Mohana priya
Mohana priya on 11 Aug 2024
Commented: Steven Lord on 12 Aug 2024
Iam doing the project to find machining time for the cnc by creating a MATLAB Program ,I have G and M code in text file and the program should accept below points Read each line from the file. Extract the distance from G-code commands and the feedrate for each line. Calculate the time for each movement using the formula: time = distance / feedrate. Sum the times for all lines to get the total machining time. Conditions: G01 commands represent linear movements, so we calculate the distance directly. G02 and G03 commands denote circular interpolation (clockwise and counterclockwise arcs, respectively). For these, compute the distance traveled along the arc. For example, this below line is circular interpolation from G and M code Text file. N1754 G03 X72.704 I10.704 J28.773 F2198.429 Could any one help me what formula should I use to get tool path for circular interpolation and linear interpolation to extract the distance.
  1 Comment
Steven Lord
Steven Lord on 12 Aug 2024
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!