LibreCAD modified for the interface of a laser machine

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

LibreCAD modified for the interface of a laser machine

diegoroman17_2
 I am developing my thesis of electronic engineering. This is a laser cutting machine. This machine will have at its core a mainboard which will have a Linux RTAI. The user interface is done through the CAD software where laser powers can be assigned to design the user wants to cut. I saw that libreCAD is the best option to make an interface to my system. Now I need to add other functionality to libreCAD such as starting and stopping of the machine, the data transfer trajectory generator software, etc..
I need your help to achieve this goal of transforming libreCAD on my machine interface adding  toolbars and new features that I need. Where should I start? In what ways could you help me? I need instructions please. :)

Greetings Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

tin-pot
Hi Diego,

I'm not sure that I understand what you are up to. Let me first give you my perspective:

The usual setup for CNC machining (be it laser cutting, wire EDM, milling or whatever) as I know it is such:

1. You have an application in which the part you want to manufacture is constructed, or can be imported. This may be a 3D program like CATIA, UX, SolidWorks, or you just produce drawings of your part in a 2D program like AutoCAD or - LibreCAD.

2. Someone must indicate features in the part (edges, holes etc) that are to be machined with a given technology. In your case, you would collect contours in your drawing which represent the shape you want to cut (that's what you mean with "design the user wants to cut", right?).

3. You also have to assign parameters to those contours which are specific for the way you want to machine them: which tool to use, at what rotation and feed speed, or in your case laser power level (I don't know much about laser cutters ...).

4. On the actual CNC machine, there is a software running that controls its hardware motions: that is the aptly named "machine controller", or CNC control. This is usually provided by the manufacturer of the CNC machine. In your case, I presume *you* are the manufacturer. So you will need some software that performs the functions of a machine controller. (I just found http://www.linuxcnc.org/ - they seem to do something like that, but you probably know that already and better.)

5. The machine controller is itself commanded by a CNC program, which is more or less standardized and not completely specific for the CNC machine. Again, I have no idea how these CNC programs look like for laser cutters.

6. Someone must produce this CNC program. In the olden days, this could have been done manually and actually was the job of a person called CNC programmer. Nowadays, these are of course generated by software (comparable to compiler generating assembly language).

7. The software that generates a CNC program from the description mentioned in point 3 above is sometimes called a postprocessor. It has to know about the specific technologies and tools that are required in manufacturing, and maybe even how to apply them in order to manufacture a part that fulfils the given geometric and tolerance requirements.

So that's how I know CNC machining, now to your questions.

Where do you see LibreCAD fit in? Do you intend to let it control the laser cutter in real time (you write about "starting and stopping of the machine")? Do you want to let it generate NC programs (ie add postprocessor functions into it)? In which specified format? What do you mean by "the data transfer trajectory generator software"? (By the way, I also do not know what a "Linux RTAI" is - RT stands for real time?)

So this is a load of questions and indeterminates here.

What I would recommend to you is to place as little functionality into LibreCAD as possible: Only the GUI to collect the machining information as suggested above in point 3. That would encompass:

- Picking/collecting of contours, ie connected chains of geometric elements (line segments, circular arcs, even splines if you are really daring). Note that these contours must be oriented - so the user must also be able to indicate which is the "forward" direction along such a contour.

- You must provide a means that the user can assign and edit numerical and other properties to such contours (or you encode these as say line colors ...)

- You probably have to deal not only with complete contours but also with segments along it, the start and end of which must be user specified somehow.

- Start and stop points for machining, and the path from these points to the actual tool paths must be specified by the user.

- After you have all this collected inside the LibreCAD application, you have to transmit it to the outside world somehow - the simplest way would be to write it out as a file in a format of your own choice.


That is what could be (or have to be) done in LibreCAD for your scenario; all the rest is the job of outside applications: postprocessing for your specific laser cutter control, maybe deciding on the sequential order of cutting jobs and so on.

Hope this made sense to you,

Greetings
Martin

Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

R. van Twisk
Administrator
In reply to this post by diegoroman17_2
Diego,

I did see that Martin already gave you some answers but i will give a better answer once i get back from my holidays.
As you might know, or not know, i am also located in Ecuador, to be precise in Valle de los Chillos, near Quito.

I started the LibreCAD fork precisely of what you are planning todo, but I am using EMC2 already on my wood router. So, librecad would generate cnc code and send start/stop sequences to EMC2.

Anyways, more info on that when i am back.

Ries


Sent from my iPad

On Jan 1, 2012, at 12:31 PM, "diegoroman17_2 [via LibreCAD]" <[hidden email]> wrote:

 I am developing my thesis of electronic engineering. This is a laser cutting machine. This machine will have at its core a mainboard which will have a Linux RTAI. The user interface is done through the CAD software where laser powers can be assigned to design the user wants to cut. I saw that libreCAD is the best option to make an interface to my system. Now I need to add other functionality to libreCAD such as starting and stopping of the machine, the data transfer trajectory generator software, etc..
I need your help to achieve this goal of transforming libreCAD on my machine interface adding  toolbars and new features that I need. Where should I start? In what ways could you help me? I need instructions please. :)

Greetings Diego



If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/LibreCAD-modified-for-the-interface-of-a-laser-machine-tp5113327p5113327.html
To start a new topic under LibreCAD, email [hidden email]
To unsubscribe from LibreCAD, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi Tin-Pot and R. van Twisk,

Thank you for your answers.
Indeed it is developing a system similar to a CNC machine but not in its entirety.

The main difference is that G is not managed code to specify the movement to "machine controller".

Below I will specify the characteristics of the system as best you can in the order flow data:

1. As you say what is wanted manufacture is constructed in a CAD program such as VectorWork, AutoCad, Illustrator, etc. There are many options on the market ... This is stored in dxf format (This software design is totally outside the scope of the project, the user has complete freedom to choose their favorite software to develop their design, the only constraint is given which must necessarily save your design in dxf format).

2. The user enters the design into the laser cutting machine through its USB port or via ethernet or any means of income you have the mainboard that is within the laser cutting machine. Let's talk about the mainboard and S.O:

           2.1 It is a computer mainboard with a Core 2 duo. Within this is installed Ubuntu 10.04 which will install a real-time kernel with the features offered by RTAI (Real Time Aplication Interface). RTAI install a real time subnucleus which manages the processes and interruptions by giving higher priority to real-time processes.

3. The design is modified LibreCAD opened by which a more general tools that are available in the normal version will have:
- A text box called primitive element.
- A text box called cutting power.
- A start button.
- A stop button.
- A button machine specifications.
All these elements will be in a new toolbox

4. When you click with the mouse on a line, circle, spline, etc in the box "primitive element" will be the name of the selected primitive in the text box "power cut" power will be written to that should cut this primitive, this process will be made with all primitives in the design.

5. When you click on the button "Machine Specifications" will open a window which is set minimum and maximum speeds, maximum and minimum accelerations, etc..

6. When you click a button "Start" LibreCAD placed in a position of  memory all modified primitives with its information. It is ilustrade with the following example:
If we have a line from 0, 0 to 10, 1 and a circle of center in 15, 1 and 10 radius we want to cut respectively 20W and 50W, memory information will be placed in the following

line 0 0 10 1 20
circle 15 1 10 50

7. Below LibreCAD open another application developed in C language This application has the characteristic of being developed as a real-time application which took control from now on.

8. This will read the data from the machine specifications and data for each of the primitives located in memory, will make the process of generation of trajectories (interpolation) of the current primitive and will result in the number of steps to be taken each step-motor the next millisecond.

9. The numbers of steps of each step-motor and the power of the laser is sent via USB to a card of control that read the data received and transformed into pulses to send drivers for stepper motors each axle and Power Controller laser.

10. 8 and 9 will be repeated until it is finished cutting all the primitives.

This is what the system should do. As you said LibreCAD actually be only one user interface. Hard work will the application developed in C.

Can not save a file from libreCAD then be read by another application and that it would take too long to read data from disk and dimensions as the sample rate is 1 ms. That is the whole process of interpolation must be made within this range.

I hope I was explicit enough about the project. sorry with my English, this is very bad. I know your can help me with my project. Thanks in advance

Regards Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

anders.e.e.wallin
> 6. When you click a button "Start" LibreCAD placed in a position of  memory
> all modified primitives with its information. It is ilustrade with the
> following example:
> If we have a line from 0, 0 to 10, 1 and a circle of center in 15, 1 and 10
> radius we want to cut respectively 20W and 50W, memory information will be
> placed in the following
> line 0 0 10 1 20
> circle 15 1 10 50
> 7. Below LibreCAD open another application developed in C language This
> application has the characteristic of being developed as a real-time
> application which took control from now on.
> 8. This will read the data from the machine specifications and data for each
> of the primitives located in memory, will make the process of generation of
> trajectories (interpolation) of the current primitive and will result in the
> number of steps to be taken each step-motor the next millisecond.
> 9. The numbers of steps of each step-motor and the power of the laser is
> sent via USB to a card of control that read the data received and
> transformed into pulses to send drivers for stepper motors each axle and
> Power Controller laser.
> 10. 8 and 9 will be repeated until it is finished cutting all the
> primitives.
> This is what the system should do. As you said LibreCAD actually be only one
> user interface. Hard work will the application developed in C.

I would strongly suggest you start with the conventional way. Use
LibreCAD or another CAD package to draw your geometry. Use existing
CAM-functionality in LibreCAD (or write your own) to generate G-code.
Then use emc2 to drive your machine.
If and when this toolchain works for what you want to do, you can
start to bind programs tighter to each other (if you perceive this to
be a problem currently?). On a lower-level than G-code emc2 can be
controlled by NML-commands (this is what the various GUIs for emc2
do). You could write an emc2-GUI which is a LibreCAD plugin.

Anders
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi Anders,
Thank you for your answer. Your proposal seems interesting but part of the project is entirely omitted using code G. It tries to create a coding system itself. For this reason EMC2 not be used to control the machine, but rather is necessary to create a real-time software can interpret and interpolate the data sent or stored by LibreCAD. This software will calculate the instantaneous speed of each stepper motor and send them to the card that controls the motor drivers which is also designed by me.

Regars Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

R. van Twisk
Administrator
Diego,

except for the 'best done in EMC2' part this should be doable in LibreCAD in fact I already have some of these dialogs created that should have been pretty universal and could be used for your machine aswell (with some modifications).

For the creating of your language, It would be best to use python as you language of choice to generate you code file so you can be flexible,
so you have a circle object somewhere in memory, and you send this object to python which will create the lines for you in the format you need it to be. 

Ries



On Jan 3, 2012, at 11:11 AM, diegoroman17_2 [via LibreCAD] wrote:

Hi Anders,
Thank you for your answer. Your proposal seems interesting but part of the project is entirely omitted using code G. It tries to create a coding system itself. For this reason EMC2 not be used to control the machine, but rather is necessary to create a real-time software can interpret and interpolate the data sent or stored by LibreCAD. This software will calculate the instantaneous speed of each stepper motor and send them to the card that controls the motor drivers which is also designed by me.

Regars Diego


If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/LibreCAD-modified-for-the-interface-of-a-laser-machine-tp5113327p5117257.html
To start a new topic under LibreCAD, email [hidden email]
To unsubscribe from LibreCAD, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi Ries,

Exactly I need to create these new dialogs in LibreCAD for my project. I downloaded the source code LibreCAD and am at a stage of identifying who does what, to understand how it works and how I can add my system requirements.

Regarding the second part I do not understand what you mean to create my own language? Which part would enter this part that you propose? Why phyton? LibreCAD generated the data for each of the primitive with respect to which power should be cut. The interpreter of the data to be programmed in another application outside LibreCAD to is then executed when click on the button "start". This application is programmed in C for speed of execution that this language is presented in its applications and computation speed greatly needed in the generation of trajectories. It must be said that this application is completely transparent to the user (see non-execution).

Greetings Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

dxli
Hi Diego,

To create a dialog in LibreCAD, the flow is like,

1, Signals (button clicked, checked, toggled, etc.), or command Event;
2, slot for the signal/event,( mostly in GUI classes, for example, qc_applicationwindow.h/cpp);
3, request action from the slot to actionhandle ( qg_actionhandle.h/cpp)
4, the action class itself, the rs_action* files in src/actions/

for pop-up dialogs, have a look at qg_dlg* files in the folder src/ui/forms/, and the qg_dialogfactory.h/cpp file

Dongxu


On Tue, Jan 3, 2012 at 7:11 PM, diegoroman17_2 [via LibreCAD] <[hidden email]> wrote:
Hi Ries,

Exactly I need to create these new dialogs in LibreCAD for my project. I downloaded the source code LibreCAD and am at a stage of identifying who does what, to understand how it works and how I can add my system requirements.

Regarding the second part I do not understand what you mean to create my own language? Which part would enter this part that you propose? Why phyton? LibreCAD generated the data for each of the primitive with respect to which power should be cut. The interpreter of the data to be programmed in another application outside LibreCAD to is then executed when click on the button "start". This application is programmed in C for speed of execution that this language is presented in its applications and computation speed greatly needed in the generation of trajectories. It must be said that this application is completely transparent to the user (see non-execution).

Greetings Diego


If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/LibreCAD-modified-for-the-interface-of-a-laser-machine-tp5113327p5118348.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi Dongxu,

Your information helps me a lot ... It could also help me with information on how to create a toolbar with 3 buttons in a LibreCAD start a stop and a specification of the machine and the text boxes for the allocation of power? As I can give functions to the buttons?

Regards Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

dxli
Hi Diego,

you can read the source code for a particular toolbar example, say, cadToolBar (left tool bar area, main drawing/editing toolbars).

In qc_applicationwindow.cpp, around line 1562, it reads like,

   t->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
   // t->setVerticallyStretchable(true);
        addToolBar(Qt::LeftToolBarArea, t);

    cadToolBar = new QG_CadToolBar(t, "CAD Tools");

A toolbar of QG_CadToolBar() type is created and added LeftToolBarArea.

The QG_CadToolBar() class manages which cad toolbar to show. read source code in src/ui/forms/qg_cadtoolbar*

I suppose you may simply add a new cadToolBar to the system. following examples in qg_cadtoolbar* (.h, .cpp, and .ui).

For example, add a button in qg_cadtoolbarmain to open a new sub cadtoolbar, and create your own sub cadtoolbar.

Dongxu

On Tue, Jan 3, 2012 at 9:02 PM, diegoroman17_2 [via LibreCAD] <[hidden email]> wrote:
Hi Dongxu,

Your information helps me a lot ... It could also help me with information on how to create a toolbar with 3 buttons in a LibreCAD start a stop and a specification of the machine and the text boxes for the allocation of power? As I can give functions to the buttons?

Regards Diego


If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/LibreCAD-modified-for-the-interface-of-a-laser-machine-tp5113327p5118532.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi Dongxu,

I followed the information you gave me and is able to my own toolbar. Thanks helped me a lot to me, while I understood as LibreCAD is structured. Now I decided to make the menu of the laser with a QDockWidget similar to that found for the manipulation of layers. In the same way I am taking the example of QDockWidget that are already created in this way LibreCAD to succeed in creating a QDockWidget.

Greetings Diego
Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

R. van Twisk
Administrator
@all,

just a thought. For the menu we already have a API through the plugin interface.
May be it's a good idea that we also make such a interface for toolbar items?

Ries

On Jan 5, 2012, at 8:53 PM, diegoroman17_2 [via LibreCAD] wrote:

Hi Dongxu,

I followed the information you gave me and is able to my own toolbar. Thanks helped me a lot to me, while I understood as LibreCAD is structured. Now I decided to make the menu of the laser with a QDockWidget similar to that found for the manipulation of layers. In the same way I am taking the example of QDockWidget that are already created in this way LibreCAD to succeed in creating a QDockWidget.

Greetings Diego


If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/LibreCAD-modified-for-the-interface-of-a-laser-machine-tp5113327p5124420.html
To start a new topic under LibreCAD, email [hidden email]
To unsubscribe from LibreCAD, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: LibreCAD modified for the interface of a laser machine

diegoroman17_2
Hi all,

I have created a QDockWidget to handle cutting powers as though they were layers. for it creates a new class that the Name QG_LaserWidget, edit and create all subclasses dependencies required for this to work. As this is a replica of the class QG_LayerWidget someone tell me how I can get a list where I can have the layer and the primitive elements that are inside it?

An example would be:

layer 1: - Line1
            - Line2
            - Arc1

layer 2: - Line3
            - Line2
            - Circle 1

etc....