Author Topic: Software  (Read 487 times)

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #15 on: July 22, 2018, 07:29:34 PM »
not sure if I am missing something still, tried "marlin fan" and "marlin sd" and used both the "save machine g-code" and "save g-code"  options and all have the same format like ..

Code: [Select]
X72 Y70.5 M03 S0 F2000
X73.3 Y70.5 M03 S255 F700
X74.8 Y118.8 M03 S0 F2000
X74.69 Y119.39 M03 S255 F700
X74.36 Y119.86 M03 S255 F700
X73.89 Y120.19 M03 S255 F700

what I have been doing is ..

Code: [Select]
M5
G01 X72 Y70.5 F2000
M3 S255
G1 X73.3 Y70.5  F700
M5
X74.8 Y118.8 F2000
M03 S255
G1 X74.69 Y119.39 F700
G1 X74.36 Y119.86 F700
G1 X73.89 Y120.19 F700

but the alternate is probably neater and easier to read and probably correct (not tested it yet but am sure it would work).

Code: [Select]
G0 X72 Y70.5 F2000
G1 X73.3 Y70.5 F700
G0 X74.8 Y118.8 F2000
G1 X74.69 Y119.39 F700
G1 X74.36 Y119.86 F700
G1 X73.89 Y120.19 F700


« Last Edit: July 22, 2018, 07:33:09 PM by Stonemull »
A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5935
    • View Profile
    • T2Laser
Re: Software
« Reply #16 on: July 23, 2018, 04:15:36 AM »
I selected only the 2 Marlin post processors and used Save Machine G-Code.

This is the output from my 100-500 feed rate test.

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #17 on: July 23, 2018, 05:13:24 AM »
well thats weird, cause I tried to copy what you have there, just left auto-connect off, only the 2 marlins selected, I still have no G lines, I tried saving the machine gcode thinking perhaps the post processor has not run yet, same deal. Turned off debug mode, tried everything I can think of..

hmm, any more ideas ?


edit: question, when does the post processor run, I cannot seem to get the output to change in that window no matter what mode I select, tried closing and reopening the machine control window etc, tried saving multiple times, tried nano/mega, laser mode on/off, if I turn GRBL mode on (first option) I cannot turn it off, like it stays ticked until I close and reopen machine control screen.

edit2: hang on, I look at the saved data and it is in fact M106 S0 etc, the display on the machine control screen however does not show this and still has no G line starts.

edit3: ok I assume you are saving and then reloading the gcode.

edit4: results are inconsistent, if I close and reopen the program leaving it setup with the 2 marlins selected then it works fine, just selecting them if they were not selected is not enough to get the post processor running though. Might be something to look at if you get bored, apart from that I can work with it :) will recompile my arduino source to use a D10 fan and see how it goes. Looks good though, still not sure how I will get the plasma to punch through at the start yet. Will have another look at what marlin can offer I think.



« Last Edit: July 23, 2018, 06:07:26 AM by Stonemull »
A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #18 on: July 23, 2018, 08:09:00 AM »
ok, tested and it is working now, so thanks for the help Zax.

There will be one huge advantage of using the fan control, I can add a pause after every M106 S255 command and unlike the laser pin it will stay on for the duration .. if I can get it to work that is, I have redirected fan output to pin 8 (laser is still D10 and spindle is D9) and the damn things not working, however if I send a manual M106 S255 via repetier-host then it works just fine, onboard LED illuminates and so does the LED I have on my interface electronics..

relevant part in commands.cpp is ..

Code: [Select]
#if FAN_PIN > -1 && FEATURE_FAN_CONTROL
    case 106: // M106 Fan On
        if(com->hasI()) {
            if(com->I != 0)
                Printer::flag2 |= PRINTER_FLAG2_IGNORE_M106_COMMAND;
            else
                Printer::flag2 &= ~PRINTER_FLAG2_IGNORE_M106_COMMAND;
        }
        if(!(Printer::flag2 & PRINTER_FLAG2_IGNORE_M106_COMMAND)) {
            if(com->hasP() && com->P == 1)
                setFan2Speed(com->hasS() ? com->S : 255);
            else
                setFanSpeed(com->hasS() ? com->S : 255);
        }
        break;
    case 107: // M107 Fan Off
        if(!(Printer::flag2 & PRINTER_FLAG2_IGNORE_M106_COMMAND)) {
            if(com->hasP() && com->P == 1)
                setFan2Speed(0);
            else
                setFanSpeed(0);
        }
        break;
#endif

FAN_PIN is set as is FEATURE_FAN_CONTROL so I guess its hasI and hasP causing my issues, not sure what they are yet..

A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5935
    • View Profile
    • T2Laser
Re: Software
« Reply #19 on: July 23, 2018, 10:25:40 AM »
The display never changes, hence why it's a post processor  ;)

Internally G-code is stored how it's shown on screen but when you send to the COM port or save Machine G-code it is run through the post processor to match the machine. The benefit is you can use the same G-code for different machines or as in this case quickly make changes that different hardware requires.

If you connect to a machine the mode is automatically detected (e.g. if it sees a Grbl welcome string it will enable that mode and take precedent), some of the others work the same way but for SD mode it isn't connecting so that needs to be manually selected.

So do you have it working and the G-code is usable or would some modifications still help? I would prefer any post processor be generic for anyone with the same controller rather than your specific hardware but I'm happy to oblige.

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #20 on: July 24, 2018, 12:49:29 AM »
Yay, my phone line and internet is connected again. Think my exchange blew up.
The only changes I guess I could do with at the moment would be an optional addition to the fan mode to allow a G4 Pxxx delay (where Pxxx is somewhere around P250 to P750 I imagine) directly after each M106 S255, but that is plasma specific to get the initial punch through the material and is pretty easy for me to manually post process it myself, I might even be able to get repetier firmware to add it to the queue as well when required, so not overly concerned.
Maybe it would be useful for other things too like waterjet cutters, or perhaps welding, so up to you if you can be bothered, would make it useful for some other types of devices though.

At the moment I am still struggling to get the damn fan on, he has generic bytes of flags with no telling what they do, I, P and S are just bits 1,2 and whatever in a byte and hasI is a macro to determine if bit 1 is high, what is bit 1 .. so M106 is telling the fan to go on with "immediate = false" which  I guess is queue the command without doing it now, however its not going on at any time in the queue yet.. if  i call the fanspeed routine with immediate= true then the fan comes on but never turns off lol.

A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5935
    • View Profile
    • T2Laser
Re: Software
« Reply #21 on: July 24, 2018, 04:27:32 AM »
Are you using CNC Mode or is this only an XY system?

If you use CNC Mode with Laser Mode disabled then the Spindle Delay is activated and it will do exactly what you want. I can make an option to enable that without using CNC Mode if needed.

I enabled CNC Mode with a Z0, if your machine ignores the Z moves that may be an option.

G21
G90
G00 F600
M107
G00 Z0
G01 X1.89 Y12.1 F5000
M106 S255
G04 P200
G01 Z0 F600
G01 X1.89 Y12.1 F600
G01 Z0 F600
G01 X0.18 Y12.1 F600
G01 Z0 F600
« Last Edit: July 24, 2018, 04:28:26 AM by Zax »

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #22 on: July 24, 2018, 04:44:34 AM »
ah cool, I haven't tried CNC mode, its currently an XY system but I have an unused Z axis here that I may add yet, I am yet to build a base and I am not sure just how flat the metal will be, I may need to add a probe option yet and proper Z control.
Marlin is looking more tempting, repetier laser mode looks like a bit of a stop gap solution.
A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)

Stonemull

  • Hero Member
  • *****
  • Posts: 889
    • View Profile
Re: Software
« Reply #23 on: July 24, 2018, 11:54:33 AM »
Reinstalled Marlin and working my way through configuring it properly, end stops, SD card and remote comms not yet working but display and encoder
I am preferring the menu setup over repetier already so I am sure its worth the extra effort of getting it to work.


A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Wanhao I3+ touch
Hacked Roland DXY-880
CNC3018 engraver
CNC Plasma (work in progress)