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

A Spot for User Mechs and Kinematic discussions
Post Reply
Dan Mauch
Old Timer
Posts: 117
Joined: Tue Oct 04, 2016 2:44 pm

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

Post 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
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4352
Joined: Sun Sep 05, 2010 6:14 am
Contact:

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

Post by ArtF »

havent seen such a beast...
Hessel Oosten
Old Timer
Posts: 38
Joined: Sat Apr 07, 2012 10:22 am

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

Post 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
User avatar
Mooselake
Old Timer
Posts: 503
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

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

Post by Mooselake »

Something like this perhaps?

Kirk
Dan Mauch
Old Timer
Posts: 117
Joined: Tue Oct 04, 2016 2:44 pm

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

Post 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
Dan Mauch
Old Timer
Posts: 117
Joined: Tue Oct 04, 2016 2:44 pm

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

Post 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
User avatar
Mooselake
Old Timer
Posts: 503
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

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

Post by Mooselake »

Was that for your sand plotter?

Kirk
Dan Mauch
Old Timer
Posts: 117
Joined: Tue Oct 04, 2016 2:44 pm

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

Post by Dan Mauch »

Yes and I also have a scara project that will follow.
Dan
User avatar
Mooselake
Old Timer
Posts: 503
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

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

Post 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
Post Reply