C coded dxf to g-code converter, the building process...

More
7 years 8 months ago #126739 by tommylight

rodw wrote: I thought of you when I wrote this over the weekend:

Code:
movingup = (last_dvdt < dvdt ? 1 : 0)

So what does this mean? HINT: it is C's ternary operator at work....

That is for sure from your UP/DOWN THC comp and it should be:
MoveUp only if last difference in voltage over time is smaller than the actual difference in voltage over time.
Otherwise the movingup pin stays 0.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #126744 by rodw
Yes, tommy

Its a very compact way of saying
Code:
if(last_dvt < dvt){ movingup = 1; } else{ movingup = 0; }

Very cool. and a great way to save memory if you have constraints but those days are mostly long gone.
But hopefully it is for kerf/void sensing
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago - 7 years 8 months ago #126778 by Grotius
Rod,

Dvt is something i don't know. Problably because i never seen such a string.
The complete function an sich is quite easy to understand. Even a new member can imagine the flow of the function.

Today i made usage of pointers and array's to find the biggest object's in the drawing. Okey that works.
But i must work at a perfect algoritme to compare all the objects in the drawing. I think this is the hardest thing to think about.

A sample drawing of objects.


The output in terminal after the array's are calculated and compared to each other :


The drawing has 15 object's following the output ngc file. Following the Array calculation object 15 is the biggest object related
to x, y value.


I will first make a basic algoritme for the ngc file output. Let it work for simple drawings. KIS (keep it simple) first.

Anyone an idea in the mean time to add into the code?

If you think, i count 16 objects.... You are right. Counts start at object Zero. :silly:
That is something about computer code....

A picture is better to understand then a code preview at some cases.


How i looked for the biggest object in dummy words :

1. Every ngc code has a m3 and m5. Beween this characters are g-code lines. M3 is tool on, M5 is tool off.
2. Between m3 and m5 is are multiple lines, they are spotted as object's, because their begin and end point correspondent's or
if they are open lines, they are also spotted by coding. You tell the c code what you want to do. And the c-code does what you want after trail and error. But how more you practice how easyer everyting becomes. Even writing a letter in English become's easy when you do it every day. So it's just a way of practicing and stay interested in what you are doing.

If i look what i did in 2 weeks, i think about military mainframes that need to be updated. But rewriting the old mainframes are a risk.
So the us and russia, they need good developers to guide a space missle coded in c. But it's all possible. We know our target and that is making a open source c coded dxfdecoder. I thank Rodw for thinking about the name. B) It's just a good name !!

3. Every object is calculated seperately in lenght and width. Data is stored in array of 1 miljion lines for x and 1 miljion lines for y.
Making a dynamic growing array is something to do. But today i find that not important. Allocating memory is also something to do.
Allocating memory in the free zone, is something that atrract's me.

4. After the array's are made. We look at the array's and look for biggest x and biggest y value and look if it's correspondent's with the same object. If so, we say okey ... It's good.
But there are 100 way's to make an algoritme. So we must think about the best way simple way to declare inside and outside offsets.
Later on we can perfectonize this. For now a radical simple algoritme can fit 80% of typical cnc users.
Attachments:
Last edit: 7 years 8 months ago by Grotius.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #126786 by rodw
Yes, C arrays always start at [0]. I noticed from your screendump your line number was out for M5.

There are very good reasons why this is so as its more natively tied to how a computer thinks and how its done in assembly language commands. As you gain more experience you will come appreciate this feature.

In dv/dt, the d really should be the delta signal signifying the change in volts divided by the change in time. (or rate of change involts per second).

I'm still only playing with this but I think I should be able to sense cutting into a void or overcutting at the end of a cut and disable THC in 1-2 milliseconds.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #126792 by Grotius
Rod,

Yes it was a screendump of many lines, i like the idea that the code is becoming more and more powerfull each day.
Last day's i thought about c language (in the air for about 40 years) and the first plotter and why i never spotted a open source c coded cad cam program for dxfdecoding process. But i know why. And i will tel you a secret.

A human can never do calculation's like this, and how nice to make your own logic.


It's rod's formula typed into AsciiMath

There are a few people on the earth that are open sourced at this moment. One of them is Tesla.
He is the great improver of all. If i look at the developpers of linuxcnc, sasha, the developper of ethercat, etc.
Without them, I would be nothing writing at this moment.
So my responsibility is to make a open sourced c coded clever program for free.
If it will take 1 year. I see it as my responsebility to the open source community. For the future of our community on mothership earth.
So everything begin's in yourself. Every idea. I hope if their are people around the world with crazy idea's, provide your skill's, provide at least one skill in your lifetime open sourced.

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago - 7 years 8 months ago #126793 by Grotius
Okey,

human's on earth : : 7.685.179.980

money on earth :
But let’s try to estimate the money in the world
7 billion dollars, amount in bitcoin investments
7.6 trillion real estate investment
7.9 trillion the amount of gold and silver
70 trillion stock market investment
90 trillion notes and coins in circulation
199 trillion dollars is debt by people and countries
= 374.5 trillion
1.2 quadrillion is the amount of derivatives.


Trillion = 12 zero's (1,000,000,000,000) = 374.500.000.000.000 Trillion
Quadrillion = 15 zero's (1,000,000,000,000,000) = 1.200.000.000.000.000 Quadrillion


Total amount of the world can't be calculated by linux calculator by typing so much zero's. We can modify the calculator to do this job.
It would be perfect if the standard calculator has a 4x4 excel row inside with all funtion's in a button touch.

We need to do it by hand mode for now.
374.5 Triljon's + 1.2 Quadrilion's = 1.574.500.000.000.000 Quadrillion.


1.574.500.000.000.000 Quadrillion / 7.685.179.980 Total people = money divided to every person on earth. They are all equal born.

204874.83 Dollar for every person on earth. Not bad.

Elon Musk is happy off with paypall. Paypall is at the moment the no. 1 bank fraud system in the world to avoid taxes.

Some people are smart and some people think they are smart. But in the end. They will be charged. I think it will take 3-4 years from now.

I'm still only playing with this but I think I should be able to sense cutting into a void or overcutting at the end of a cut and disable THC in 1-2 milliseconds.

Even when you use a high defenition. I have never spotted that problem. But i love it when you think about kerf crossing !!!
I hope to look at the union's tomorrow, from your advice. Let's take a look at that and feel about the possibilities of union's !!

Almost forgotten.
I will make a 5mb dxf file tomorrow and see how fast it is... Very important at this stage.

Rod,

My girfriend is sometimes confused when i talk about strings, float's, array's etc to here. She think's i talk about another girl. :blink:
So string's are meaning also underwear in Holland. I can't do anything about this, sorry. But i got a example of strings just to show how a string looks like. It's alloc memory is located at the underside of the woman, between the stumic and the leg's. Feel free to
make a comment.

Last edit: 7 years 8 months ago by Grotius.

Please Log in or Create an account to join the conversation.

Time to create page: 1.194 seconds
Powered by Kunena Forum