Page 1 of 1

convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Mon Feb 01, 2021 9:44 am
by Dan Mauch
Has anyone created a excel spreadsheet or know of a program that will take XY g code and convert it to polar coordinate g code using G 16. I\m building a scar robotic arm and need such a program.

Dan Mauch

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Thu Feb 11, 2021 5:23 pm
by ArtF
havent seen such a beast...

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Thu Feb 11, 2021 11:46 pm
by Hessel Oosten
Dan,

As Art already mentioned such a program would be a real BEAST....  ;)

Isn't it possible for you to set your G-code X and Y coordinates in 2 columns/rows in Excel and put the formulas beside it ?

=SQRT((B1*B1)+(B2*B2))    (Pythagoras; distance)

=ATAN(B2/B1)*57.2958    (Cartesian to Polar; angle)

Hessel

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Fri Feb 12, 2021 1:56 am
by Mooselake
Something like this perhaps?

Kirk

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Sat Feb 13, 2021 6:56 am
by Dan Mauch
  A friend of mine converted a cartessian G code to polar. He says it was pretty simple. He created a couple macro's to pull upo the code into a spreadsheet, do the conversion and then revert the format back to a polar text file. Best of all he said that if I needed to convert many files he woul;d write a program to do that. But before I have him do that I want to get the scara running with the new harmonoic drive Y axis.
Dan mauch

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Tue Mar 23, 2021 8:35 am
by Dan Mauch
  Thanks! That was exactly what I needed. It converts cartesian G code to polar g code. I test ran it yesterday and it works great. Since there wasn't a narrative with the link you provided I thought I would go ahead and post the application in formation.

"You must have python 3 installed. You also need the ?pathlib? library. Type ?pip install pathlib? in your python scripts folder to get that. The easiest way to run it, is to put the file you want to convert in the folder with the python script. To convert a file called test.gcode you type ?python PolarPreProcessor.py test.gcode. It will print done when complete and you will now have a new gcode file called test_polar.gcode. If python is not in your path, you will need to put the location info in front, like c:python3python PolarPreProcessor.py test.gcode."

Dan Mauch

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Tue Mar 23, 2021 9:39 am
by Mooselake
Was that for your sand plotter?

Kirk

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Wed Mar 24, 2021 7:04 am
by Dan Mauch
Yes and I also have a scara project that will follow.
Dan

Re: convert cartesian XY G code to polar coordinates G code for a scara kinetic art

Posted: Sat Mar 27, 2021 8:23 am
by Mooselake
It would be nice if this old version of SMF had a like button, but it doesn't.  Consider the missing button clicked!

Kirk