Author Topic: GRBL v1.1f on mac with EleksLaser A3  (Read 3145 times)

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
GRBL v1.1f on mac with EleksLaser A3
« on: September 10, 2017, 11:59:51 AM »
Hey there,

I've recently received and assembled my EleksLaser A3 and Im looking to run it with my Mac but ran into some problems

I've successfully flashed the Arduino with GRBL v1.1f (https://github.com/gnea/grbl/wiki) and can operate the machine with "universal g-code sender". however, I can only operate the x, y-axis, but can't turn on the laser. I've tried M03/M04/M05 commands, but nothing happens. I know it works, as upon connecting the arduino to my mac, the laser comes to live for a few seconds.

The laser control (yellow wire) is connected to D11. However, this pin is always low (0.1 mV) and only D13 is changing states when I use M03/M04, (4.7 vs. 0V). I have not enabled the  "USE_SPINDLE_DIR_AS_SPINDLE_ENABLE" in the config.h, so D11 should act as enable and PWM pin. (I tried enabling it with no success, btw)

during connecting, when the laser flashes for a bit, the voltage goes up to 6.4 mV approximately. Also, I switched to lasermode with $32=1.

Any input is very much appreciated as I don't have experience with programming code. Thanks!

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5862
    • View Profile
    • T2Laser
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #1 on: September 10, 2017, 02:08:51 PM »
You could run T2Laser in a virtual machine and install a valid firmware.

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #2 on: September 10, 2017, 02:14:55 PM »
You could run T2Laser in a virtual machine and install a valid firmware.

thanks for your input, but I really don't want to run a VM. I neither have a windows license nor one for parallels and don't want to buy them.

ThothLoki

  • Hero Member
  • *****
  • Posts: 2011
  • Tinkerer
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #3 on: September 10, 2017, 07:12:21 PM »
You will have to get something like parallels or other real VM in order to make T2 work. WINE will not work (trust me, I tried)
Laser: A5 2000mw with L7 Board / A3 2500mw PWM with Mana SE -- All using T2Laser
3D Printer: Monoprice Maker Select v2.1
Image Resizer Applications (All OS): http://benboxlaser.us/index.php/topic,1434.msg17297.html#msg17297

mrehmus

  • Sr. Member
  • ****
  • Posts: 365
  • Pilot, submariner, model engineer, etc., etc.
    • View Profile
    • Model Engine Builder
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #4 on: September 10, 2017, 08:40:19 PM »
so buy a cheap used win laptop but one that will run Win7 or 10
mrehmus
editor, Model Engine Builder magazine
Elekslaser A3 2.5 watt via Banggood
BCL
Qidi X-one 3D printer
Machine Shop with manual and CNC machines

ThothLoki

  • Hero Member
  • *****
  • Posts: 2011
  • Tinkerer
    • View Profile
Laser: A5 2000mw with L7 Board / A3 2500mw PWM with Mana SE -- All using T2Laser
3D Printer: Monoprice Maker Select v2.1
Image Resizer Applications (All OS): http://benboxlaser.us/index.php/topic,1434.msg17297.html#msg17297

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #6 on: September 11, 2017, 12:52:14 PM »
there might be a misunderstanding here. I'm not trying to get benbox or T2 working on my mac. I'm trying to use grbl flashed onto the arduino and control it via a universal gcode sender.

I'm totally aware that using a win computer would solve all my problems and there are cheap ones out there too, but I didn't buy a cheap cnc laser to buy a PC that I won't use except for the CNC.

there has to be a command/line of code in the C code somewhere that will control the PWM and enable pin that I didn't find yet. maybe there's also something really obvious that I'm missing.
thanks

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5862
    • View Profile
    • T2Laser
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #7 on: September 11, 2017, 01:42:17 PM »
Are you setting the spindle value?

M03 S255

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #8 on: September 12, 2017, 10:00:22 AM »
thanks for your reply.

I tried that, but no change in behaviour. Max spindle rpm in the default.h is 1000 so I also tried S1000 command with the same result (and S10, S0).

Hooked up my oscilloscope to pin 11 and tried various things: M03/m04 with varying spindle speeds. I didn't measure any AC voltage/PWM at the pin. Curiously I had 11.9 mV DC on the pin today independent of commands. Yesterday I only had about 1 mV.

Is there a non-compiled benbox code somewhere that I could compare the standard grbl code too? would be interesting to see if there are some obvious differences somewhere that could explain my situation.

any further recommendations?
« Last Edit: September 12, 2017, 10:07:23 AM by m-Kresol »

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #9 on: September 12, 2017, 01:49:19 PM »
update:

I disabled the #define VARIABLE_SPINDLE command to check if I could see changes in D12 (this command enables the PWM of D11 and switches D11/D12 (spindle enable&pwm/Z-Limit)

with this, I could pull D12 high and low with M3/M4 and M5. M3/M4 toggled D13 low/high as advertised. Seems there is something off with the PWM functionality?!

I also tried to send a periodic high/low signal to D11 via

Code: [Select]
int ledPin = 3;                 // LED connected to digital pin 11

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(2000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(5000);                  // waits for a second
}

This only lead to a constantly engaged laser. Can someone confirm that D11 has pin number 3 please, just to make sure?

Also: D11 is connected to the S pin of the laser and Servo connector as well as to R1 on the ManaSE board, which goes to the LR120N power mosfet. The jumper underneath the arduino board is NOT connected. Is this correct?

thanks for any help
« Last Edit: September 13, 2017, 09:03:06 AM by m-Kresol »

m-Kresol

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #10 on: September 18, 2017, 12:07:50 PM »
Quote
I also tried to send a periodic high/low signal to D11 via

Code: [Select]
int ledPin = 3;                 // LED connected to digital pin 11

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(2000);                  // waits for 2 seconds
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(5000);                  // waits for 5 seconds
}

This only lead to a constantly engaged laser. Can someone confirm that D11 has pin number 3 please, just to make sure?

I'm not familiar with programming language, so I did not realize that this engaged pin 3. in the grbl soure code, the #define command is always used to first define ddrB and portB and then the pins --> so it's referring to pin B3 (D11), which is different than 3 without defining port/ddr B. I used int ledPin = 11 and everything worked out ok. The laser engaged and disengaged properly, so I know it's working in general.

I also know that the other functions of port B (spindle_direction on D13) work as advertised (pulling HIGH and LOW with M03 and M04 commands), as do the functions of port D (e.g x,y-steppers). The only function that is completely not responding is pin D11, which controls the laser.

I know it's a lot to ask, but I'd be very grateful, if anyone could have a look at the sourcecode around D11 to see if you spot some errors in the code. Thanks a ton.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2164
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #11 on: September 18, 2017, 02:20:59 PM »
I don't think D11 is pin 3. More like pin 11 but I and nowhere near an Arduino.
SARCASM - Just one more service we offer here.

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5862
    • View Profile
    • T2Laser
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #12 on: September 18, 2017, 03:23:57 PM »
Yes, D11 is 3 on PortB.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2164
    • View Profile
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #13 on: September 18, 2017, 04:09:34 PM »
In the Arduino digitalWrite() scheme D11 is portB, pin 3. If you want to toggle D11 using digitalWrite you use 11. If you want to use a more primitive function you would specify PORTB and a bit mask.

On most of our low power GRBL compatible Arduino boards, D3 is connected to the STEP_Y on the motor driver board which is what this example code is toggling, not the laser.
SARCASM - Just one more service we offer here.

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5862
    • View Profile
    • T2Laser
Re: GRBL v1.1f on mac with EleksLaser A3
« Reply #14 on: September 18, 2017, 06:20:10 PM »
I didn't see the code for some reason on my phone, and thought he was talking about Grbl.