How to get Gcode in matlab ?

i want to run my laser machine over a particular path for that i need gcode. so how it can be done in matlab ?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 27 Apr. 2018

0 Stimmen

13 Kommentare

khushboo chhikara
khushboo chhikara am 27 Apr. 2018
I want for line not text ! Is there any code for line ?
Walter Roberson
Walter Roberson am 27 Apr. 2018
All of the 'lent' entries in that file are indicating straight line cuts. All of the 'tourHoraire' and 'tourAntihoraire' are indicating arc cuts. All of the 'rapide' entries in that file indicate movement.
See https://www.tormach.com/g_code_table.html for the reference material.
In summary: Emit a G0 to move to a position. Emit a G01 to draw straight. Emit a G02 to turn clockwise, and G03 to turn counter-clockwise.
You need to decide whether you want to cut your shapes into the sheet, or if you want to cut everything away except your shapes.
khushboo chhikara
khushboo chhikara am 27 Apr. 2018
i have a gcode for this line ... now how can use that gcode in matlab to move my machine attached with arduino.
Walter Roberson
Walter Roberson am 27 Apr. 2018
How is your arduino attached to your MATLAB host? How is your CNC attached to your arduino? Do you have two serial ports on your arduino, one to talk to MATLAB and the other to talk to the CNC?
khushboo chhikara
khushboo chhikara am 28 Apr. 2018
Arduino is attached using the matlab ad-ons ...and my laser machine is connected to arduino.
Walter Roberson
Walter Roberson am 28 Apr. 2018
Are you using:
  • a very old PC with a DB25 parallel connector and parallel to serial adapter to connect to the arduino
  • an old PC with a DB25 RS232 connector to connect to the arduino
  • a less-old PC with a DB9 connector to connect to the arduino
  • a PS/2 DIN-6 port with a PS/2 to DB9 adapter to connect to the arduino
  • a USB port with a USB to serial adapter to connect to the arduino
  • a USB port to a USB port on the arduino
  • a USB port with a USB to TTL adapter connecting to a TTL port on the arduino
  • a pair of zigbees connecting the PC to the arduino
  • regular wifi on the PC connecting to a zigbee connected to the arduino
  • ethernet connecting the PC to the arduino directly
  • PC and arduino are both connected by ethernet by way of a hub or switch
  • something else?
khushboo chhikara
khushboo chhikara am 28 Apr. 2018
a USB port to a Usb port in the arduino.
khushboo chhikara
khushboo chhikara am 28 Apr. 2018
Picture
Walter Roberson
Walter Roberson am 28 Apr. 2018
I cannot tell which model of arduino you are using. You appear to have some kind of red DC Shield on top but I do not seem to find a match for it (the ones I can find do not say "DC Shield" in the same position.)
Based upon what I can make out from the picture, it looks to me as if you are not using USB to connect from the arduino to that white device: the connection appears to on some kind of DIN connector.
khushboo chhikara
khushboo chhikara am 28 Apr. 2018
that white wire is a USB connector. i am using arduino uno and above that a cnc shield is used.
khushboo chhikara
khushboo chhikara am 29 Apr. 2018
any help ?
Walter Roberson
Walter Roberson am 29 Apr. 2018
Bearbeitet: Walter Roberson am 29 Apr. 2018
Walter Roberson
Walter Roberson am 29 Apr. 2018
You could probably use serial() to open a serial port connection to the COM port that the arduino is on, and then send it the gcode strings. It looked to me as if that software would accept the strings and act on them.

Weitere Antworten (0)

Diese Frage ist geschlossen.

Tags

Gefragt:

am 27 Apr. 2018

Geschlossen:

am 3 Mai 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by