Gcode für Notenbandstanze

Benutzeravatar
Piet Paardekam
Beiträge: 85
Registriert: Sa 19. Nov 2016, 14:43
Wohnort: Zutphen Niederlande
Kontaktdaten:

Gcode für Notenbandstanze

Beitrag von Piet Paardekam »

Recently I did write a program that makes Gcode for a computercontrolled punch.
It is very easy to use:
- make a PRT-file with Midiboek
- start Midi2Gcodex
- open the PRT-file
- press the button in Midi2Gcodex and a .NC file with Gcode-lines is produced.

Remarks:
- until now I have two users that use it. Because thay have different punch machines I did make two separate versions, Midi2Gcode1 and Midi2Gcode2. So if a new user wants to use it, I will look how his punch works and will make a special version for him that produces the correct Gcode-lines. Besides that there are settings in Midi2Gcode to set some parameters that infuence the production of the Gcode
- Midi2Gcode can make calibration records (G28- return to home) if you need them. Calibration is a provision that compensates any slip of stepper motors. You can ask Midi2Gcode to put Gcode-lines for calibration on specific places, such as after every 50 punches etc
- The output NC-file of Midi2Gcode is tested as input for Mach3 and works well
- Midi2Gcode is free of course.
Interested? Let me know....

Of course there are other solutions, such as the program Midipunch of Wiel, or even my old program MidiSer (the grandfather of Midipunch). I did tell about the existence of Midi2Gcode because of the fact that EMBE seems to use Gcode and Mach3.

In the picture below of the Mach3 Toolpath you can see a visualisation of the movements of the punch. In this case the return to home is also visible. It looks a bit strange, but for this specific punch a return to home is implemented as a zeroing of both X and Y coordinate. The punch ignores the zeroing of the X.
Dateianhänge
Midi2GcodeScreen.jpg
Midi2GcodeScreen.jpg (134.73 KiB) 9322 mal betrachtet
GcodeOutput.jpg
GcodeOutput.jpg (111.25 KiB) 9322 mal betrachtet
Mach3Toolpath.jpg
Mach3Toolpath.jpg (52.54 KiB) 9323 mal betrachtet
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallo Piet,
das ist ja super ! Kann ich dein Programm Midi2Gcode irgendwo downloaden. Wird mich schon interessieren wie du das gelöst hast.
Benutzeravatar
Piet Paardekam
Beiträge: 85
Registriert: Sa 19. Nov 2016, 14:43
Wohnort: Zutphen Niederlande
Kontaktdaten:

Re: Gcode für Notenbandstanze

Beitrag von Piet Paardekam »

You can download it from my website:
Installation package: http://www.draaiorgelweb.nl/software/midi2gcode2.zip
Visual Basic project: http://www.draaiorgelweb.nl/software/mi ... roject.zip

If you open the file midi2gcode.frm in the project, you can inspect the code. In fact this code is simple.
If you press the MaakGcode button then cmdMaakGcode executes the following routines:
--- PrtGcodeHead only once
--- MakeNootEntities for each input PRT-record
------ PRTpons produces the output Gcode line for a NTYPE P record
------ (PRTnoot is not used because NTYPE S is not supported in this version)
--- PrtGcodeTrailer only once

The program is in Dutch:
Snelheid van de beitel = working speed of the punch (if you use a stepper motor for it - influences the F-parameter)
Slag van de beitel = working path of the punch (for stepper) - influences the Z-coordinate
Calibratie:
-- nooit = never
-- alleen aan begin = on begin only
-- aan begin en na aantal ponsigen = on begin and after every x punches.

As you can see in the output, I use G0 for transport of the carrier and paper (X and Y) and G1 for the punch (Z), with a speed as in the F parameter.
With this version you can use Mach3 and a Mach3 compatible parallel card (this is tested). If you are using your own code in an Arduino or other processor you might need other Gcode. Please let me know.

In the Gammafile you have to use NTYPE P (fixed distance of holes in long notes) or NTYPE A (dynamic distance to avoid half moons).
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallo Piet,
Danke für das Programm und den Quellcode, werde mich mal über Weihnachten dahinter machen. Ich arbeite mit Mach3, hab ich an meiner NC-Maschine auch dran. Eine billige Nahoststeuerung mit Mach3 wird dann für das Stanzen verwendet.
Schönen Gruß nach Holland !
M.Betz
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallop Piet,
Hab mal die Feiertage benutzt deinen Quellcode anzuschauen. Supper gemacht!
Meine Lösung läuft rein über Makroprogrammierung auf Excel 2003, braucht etwas länger zum umwandeln, hab aber dann alle meine Parameter die ich für meine Stanze brauche und sehe dabei was gerade abläuft. Meine .prt Dateien werden in ein entsprechendes Verzeichnis als temp.prt gelegt und am Schluß wird Notepad zum einfügen und evtl Änderungen und abspeichern als .nc benutzt. Als Option habe ich lediglich dreierlei Geschwindigkeiten vorbelegt. Mehr brauch ich nicht. Die Lochstanze ist auch schon zur Hälfte ferig. Das erste Loch liegt bei mir auf x = 0 also dem Referenznullpunkt der NC-Steuerung. Beim Y-Wert werd ich austesten was gut ist, hängt noch von der Übersetzung des Schrittmotores ab. Aufbewahrungsplatz ist bei mir immer ein Problem, deshalb wird die Stanze auch relativ klein. Fürs erste wird die Stanze direkt an der NC-Maschine (Umsteckbar) betrieben. Dort sind die Vorschubparameter in einem eigenen Profil abgelegt, müssen also nicht ins Programm.
Dateianhänge
Band_erstellen.zip
(21.92 KiB) 446-mal heruntergeladen
Benutzeravatar
Piet Paardekam
Beiträge: 85
Registriert: Sa 19. Nov 2016, 14:43
Wohnort: Zutphen Niederlande
Kontaktdaten:

Re: Gcode für Notenbandstanze

Beitrag von Piet Paardekam »

As we say: "There are more roads leading to Rome...".
I think that the challenge can be to build a punching machine that accepts Gcode in such a way that you never have to change the parameters in the microcontroller of the machine. Then you can finetune the machine with changing only the parameters in your gammafile for Midiboek and in Midiboek menu-parameters. You can set the Y-value with HARTA and finetune it with the calibration-setting in Midiboek. X is influenced bij SNELH. If you need return to homes to compensate stepper-slip (G28) then you can do that in the excelsheet.

By the way: do you know if there are existing stepper driver modules that work with Mach3 and are connected with the PC via USB? And does Mach3 support USB of course.
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallo Piet,
gibt es ! Für mich noch nicht interessant,da stehen noch genügend XP-Rechner mit Parallelschnittstelle rum. Und die Steuerungen sind jetzt spottbillig und für den Zweck vollkomen ausreichend !
Dateianhänge
USB-Controller Mach3.jpg
USB-Controller Mach3.jpg (166.15 KiB) 9248 mal betrachtet
Benutzeravatar
Piet Paardekam
Beiträge: 85
Registriert: Sa 19. Nov 2016, 14:43
Wohnort: Zutphen Niederlande
Kontaktdaten:

Re: Gcode für Notenbandstanze

Beitrag von Piet Paardekam »

Vielen Dank Manfred
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallo,
mein endgültiges Excel-Sheet ist unter meinem Beitrag Lochstanze mit Schrittmotor zu finden.
Benutzeravatar
EMBE
Beiträge: 50
Registriert: So 1. Mai 2016, 13:16
Wohnort: St.Johann/BW

Re: Gcode für Notenbandstanze

Beitrag von EMBE »

Hallo Piet,
beim aufräumen auf dem PC habe ich noch das gefunden: Ich hatte damals auch dieses Bord in der engeren Auswahl. Wer selber gern lötet eine kostengünstige Sache !

http://www.einfachcnc.de/aid-377-CNC-Sc ... nfach.html
Antworten