G-Code Love

This forum is dedicated to those Hobbyists Interested in CNC machining in their home shops. (Digital Read Outs are also topical, as is CAD/CAM as it relates to CNC)

Moderator: Harold_V

User avatar
ctwo
Posts: 2510
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

G-Code Love

Postby ctwo » Tue Jan 26, 2016 3:02 pm

I was preparing for Valentines day (although I'm unsure if my machine will be ready in time). I created this code block that can be run on a 1" round bar stock stood vertical in the mill, with center at 0,0. It uses about 1/2" of stock, which can then be parted off in the lathe. There is about 0.4 x 0.2 flat for engraving if desired.

The formula for the outlines:

x=16sin^3(t) (Edit: this is supposed to be the value of sin cubed.)
y=12cos(t)-5cos(2t)-2cos(3t)-cos(4t)

where t is an incrementing angle (0 to 2pi). I am incrementing in 0.1 radians per code line to generate each curve. Each curve is reduced in "diameter" by a 2nd order function as Z is raised 0.050

Note that none of the tool or machine setup is included and I have only run the program in a simulator. I imagine a 1/8" ball end mill would make a usable shape, but I expect there would be stepping (kerfing?) lines. If anyone runs this, let me know if it needs any tweaks.
Attachments
g-code-love.txt
(70.69 KiB) Downloaded 45 times
g-code-love.png
Last edited by ctwo on Wed Jan 27, 2016 12:39 pm, edited 2 times in total.
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...

User avatar
SteveM
Posts: 6202
Joined: Mon Jun 27, 2005 6:18 pm
Location: Connecticut

Re: G-Code Love

Postby SteveM » Wed Jan 27, 2016 9:30 am

In math, what does:
x=16sin^3(t)
mean?

Looks like you are raising something to a power, but you can't raise SIN to a power, as it is only a function not a value.

User avatar
Rick
Posts: 409
Joined: Sat Jan 04, 2003 8:34 pm
Location: Stone Mountain, Ga.

Re: G-Code Love

Postby Rick » Wed Jan 27, 2016 12:33 pm

SteveM

to me it must be a typo, I would think the equation isn't raising the sin to a power its simply 16 times the sin of the value of 3 times (t), where t is the incrementing angle

or 16(sin(3t))
Rick

“We make a living by what we get, but we make a life by what we give." Sir Winston Leonard Spencer Churchill (1874-1965)
"Peace is that brief glorious moment in history when everybody stands around reloading". Unknown
Murphy's Law: " If it can go wrong it will"
Rick's axiom: "Murphy was entirely too optimistic"

User avatar
ctwo
Posts: 2510
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: G-Code Love

Postby ctwo » Wed Jan 27, 2016 12:35 pm

Steve, it is the value of sin(t) cubed. I did not want to confuse raising t to the third power.
x = 16 * (sin(t))^3

BTW, I have to replace the g-code txt file because it will make the initial outline at full depth and break the cutter. I think I can step the outline down in 0.050" increments from the top, and then step back up and inward for each subsequent layer.
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...

User avatar
ctwo
Posts: 2510
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: G-Code Love

Postby ctwo » Sat Feb 06, 2016 4:29 pm

Here is an update. Same file as first one for the boss, pocket attached here. I just ran it a couple times and raised the knee...
Attachments
heart-pocket-01.txt
(48.73 KiB) Downloaded 38 times
heart-20160206_131533.jpg
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...

RET
Posts: 666
Joined: Wed Jun 07, 2006 8:36 am
Location: Toronto, Canada

Re: G-Code Love

Postby RET » Sun Feb 07, 2016 10:29 am

Hi ctwo,

Very nice. I'm impressed.

Richard Trounce.

User avatar
ctwo
Posts: 2510
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: G-Code Love

Postby ctwo » Wed Nov 29, 2017 8:40 pm

I am working on another. Here's the rub - my software no longer works on the recent Win10 Creators update. Well, I'd be learning all over again anyway... also, I want to cut the outside shape as well, so working on a good way to hold the work piece and then get rid of the holding stock... AND I want a better hinge.
Attachments
guitar-pick-small.png
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...

User avatar
ctwo
Posts: 2510
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: G-Code Love

Postby ctwo » Thu Nov 30, 2017 4:05 pm

OK, here is an idea:

The piece will be 1" finish height (0.155" thick lid and 0.845" body) and 1.625" tall and wide. I will use oversize 2" round stock faced to 1.2" long, then flats on opposite sides, 0.100 deep. That will give me a flat surface to grip in the vise.

I will mill the body OD and pocket first, then I can flip it over and mill the lid OD and engrave, leaving the extra holding stock closer to the lid. I've determined that the shape will grip fine in my 3-jaw chuck, so I will part the lid off through that stock and have about 0.050" to face off each piece. The body should be strong enough since there will be 0.155" solid at the bottom of the body. It will be beautiful!

I also think that I will counter bore the lid to use a small cap screw for the hinge, and maybe even make a plug to hide the hole..
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...


Return to “Home Shop CNC”

Who is online

Users browsing this forum: No registered users and 3 guests