Author Topic: T2Laser as a pen plotter :)  (Read 3409 times)

vernerl

  • Newbie
  • *
  • Posts: 13
    • View Profile
T2Laser as a pen plotter :)
« on: January 19, 2017, 04:39:39 AM »
After I started using T2Laser with GRBL 1.1 inside, my son an daughter asked me – and what is now with Benbox pen plotter? Yes it was good question, because Benbox not working with this GRBL firmware. If want to use it than avery time we need to write different firmwares to arduino nano again and again.
It made me think 😊 and after some time I found solution – T2Laser as all in one software.
Here is my new video how it works. This drawing on video was imported from DXF.
How I made this:
Looked around in the internet and found GRBL pinout for Z axis: D7 = direction Z axis, D4 = step pulse Z axis
Found some small board with Atmega328p (it is one dead minimOSD from RC fun time) and program it as servo controller from button or input signal: D0 input from our arduino nano D4 pin (we need only direction pulse); D11 output to servo (D11 is PWM output). You can of course use any other Arduino, which is available and use inputs and outputs what You like
Set CNC mode in settings. When we press CNC mode T2 asks about cut depth – there I setted 10mm for example.
Thats all and all is working, only with little mistakes:
1.   When we set cut depth there we can see note: top of material is Z0. If I understand correctly it’s mean – all G codes must be with negative Z milimeters (cutting down), but there all are positive values. For pen plotter sure is nice, because it pushing up a pen.
2.   When drawing is started and ended pen is not pushed up, it draw a line across drawing. There we need to add some G code strings at start and the end of Gcode: G01 Z10 , for example.
3.   G Code not wait for Z axis movement, because it do XYZ movement simultaneously. We can see that G code does not contain separate strings G01 Z0, G01 Z10 or G01 Z0, G01 Z-10.
If someone know, how to make this Gcode correctly, let me know.
It is also interesting what post processor uses GRBL1.1. I have tested many types when save toolpath in Vectric Aspire software – these not work.

Edited later: there is the new arduino sketch file, what works brilliant. Now arduino use both Arduino Nano output pins: Direction D7 and Steps D4. The poroblem is that for GRBL we can't use only Direction pin for Z axis (and not only) direction change. It is because if previously there was adress G01 Z05 and then G01 X10 Y15 (without Z move) 5V impulse on DIR pin changes!  It is tested on many GRBL type softwares and everywhere the reaction is the same.
« Last Edit: January 22, 2017, 12:47:04 PM by vernerl »

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7287
    • View Profile
    • T2Laser
Re: T2Laser as a pen plotter :)
« Reply #1 on: January 19, 2017, 05:20:59 AM »
Very creative!

I believe you can easily fix those issues.

1. Enter -1 for the Z-height, then all commands will be negative.

2. Z0 should not be set "not touching", just move it up and set Z-home.

3. Using debug mode, send $32=0 and it will disable laser mode and put Grbl in CNC mode. Then the Z-axis will move first, not simultaneously.

In the next release I will add an option to change laser mode on/off.


vernerl

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: T2Laser as a pen plotter :)
« Reply #2 on: January 19, 2017, 10:40:01 AM »
Tested all parameters and I am distracted now  :)
1. when I set Z=-1 it draws starnge - sometimes goes up, sometimes no
2. Z home didn't help. At start I push Z Up then Z = 0, but when start drawing it drops down.
3. this  $32=0 nothing changes.
What else interesting: what do You see when push Z Up button? No matter Z axis reversed or not, when push Z UP axis change to negative value. Only what really changes when reversing is Z direction: normally Z Up direction signal switch +5V ON, when reversed - Z UP direction signal switches to 0.
Also, what does it mean what we see after pressing Machine->Display GRBL parameters: $32=0 Laser mode, boolean (1) -  What is the active parameter: $32=0 or boolean (1), 0 or 1?
Sorry for the disturbance, since this topic already is not actual for Laser...

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7287
    • View Profile
    • T2Laser
Re: T2Laser as a pen plotter :)
« Reply #3 on: January 19, 2017, 02:43:39 PM »
1. The generated G-code is correct, so perhaps it is a firmware issue. If you set Z-depth positive then it will generate positive values for black, and if you use negative Z-depth it will be the opposite. How these values are interpreted will depend on the axis settings.

2. It should only drop when it gets to a cut. During rapid moves it will be at Z0.

3. $32 is laser mode, so 1 is enabled and 0 is CNC mode. Reversing the axis causes Grbl to change the direction bit, so when it sends a step pulse the motor will run the opposite direction.

vernerl

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: T2Laser as a pen plotter :)
« Reply #4 on: January 22, 2017, 12:15:03 PM »
1. The generated G-code is correct..
I am very sorry, BUT generated G code for CNC mode is absolutely NOT correct. You can open T2 generated G-code for example in some GRBL1.1 visualizer software (very nice is https://github.com/Denvi/Candle/ ) and You will see how it looks.
Problem is that T2 generated code is like You mill 3D object, not 2D. It is not possible for 2D to make adress to move like this:
G01 X29.765 Y18.055 Z5 F2500 , whats mean if You previosly are on Z coordinate Z0.000 it moves to X29.765 Y18.055 simultaneosly from Z0.000 to Z5
It should look like this:
G01 Z5 // first move Up
G01 X29.765 Y18.055 F2500 //than move to 2D coordinate
If we move also our laser in CNC mode (for 3 axis table), its mean that at one end of movement it will be at focus and at other will out, for example.
At the end, the question arises - what was the idea for CNC mode in laser software?

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7287
    • View Profile
    • T2Laser
Re: T2Laser as a pen plotter :)
« Reply #5 on: January 22, 2017, 12:51:43 PM »
I should have been more specific. It is correct for the intended purpose, which is engraving 3D images using a 3-axis CNC router.

If you set resolution to 0.1, and use black and white mode it will move from Z1 to Z0 in the 0.1 distance, which for your purpose using a pen plotter should work as the pen will almost immediately come off the paper. I've done similar using a drag knife on my CNC and it worked well.

I will add a post processor in the next release to put the Z moves before XY so you can use it for 2D CNC machining.

vernerl

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: T2Laser as a pen plotter :)
« Reply #6 on: January 22, 2017, 02:00:32 PM »
What a 0.1mm...? If the distance is 0.1mm it works of course (move up and down ~ at the same point) but if distance is longer it is unsafe, because along the way can be high barriers. Ok, for cnc with 3 motors and where we processing only flat area T2 g-code is usable, but for uneven surfaces and cnc with servo motor it  is not.
Look. Added some pictures and txt file: first picture is source for T2, txt is G-code what is made after we Auto trace.., set BW mode, CNC mode with -5, *test.jpg is how this code looks for CNC software.
There we can see (inside Red square) how CNC moves from one point to other - it moves diagonal, but for 2D we need pull up Z axis at start point and pull down Z axis at the end point.
Also for other users, attach my post processor what very well works if we make some G-code in other software and after load it to T2 Machine for printout.
« Last Edit: January 22, 2017, 04:14:05 PM by vernerl »

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7287
    • View Profile
    • T2Laser
Re: T2Laser as a pen plotter :)
« Reply #7 on: January 22, 2017, 04:14:28 PM »
Exactly, as my first statement. It is designed for 3D machining of images.

Using vector files your statement is true and I have corrected the G-code, it will be updated in the next release.
« Last Edit: January 23, 2017, 05:06:38 AM by Zax »