Project

General

Profile

laser.on in config.txt is ignored??

Added by joostn over 9 years ago

Hi,

I have everything working now except for the laser ON/OFF signal. I have the cheap chinese laser cutter which needs the laser signal to be pulled down. I want to connect this to the TIP110 transistor (rev 5 board). So I need LaserOn to be low when idle, and high when lasering. I've tried setting laser.on both to 0 and 1, but in either case pin 5 of the mbed is high when idle and low when lasering.

If I look in pins.h and stepper.cpp I see this:
#define LASEROFF 1
#define LASERON 0
*laser = ( current_block->options & OPT_LASER_ON ? LASERON : LASEROFF);

and I see no references to GlobalConfig::lon anywhere in the source code. So it looks like the laser polarity is actually hardcoded and laser.on is ignored?

I'm using the firmware which was posted a couple of days ago here:
http://redmine.laoslaser.org/boards/3/topics/734

As an alternative I've connected the laser signal to the optocoupler output. This works because it has the opposite polarity, but now the laser is powered on during boot, which I'm not really happy with.

Secondly, there's LaserOn and LaserEnable. I assume LaserOn is what I need to feed to the laser power supply, but what is LaserEnable for?

Thanks!
Joost


Replies (6)

RE: laser.on in config.txt is ignored?? - Added by joostn over 9 years ago

Ok, the power on during boot was caused by having the jumper in J41. When pin5 is high-Z this causes the optocoupler to turn on via R32, R15 and Q1.

So it's working now (via the optocoupler, by removing the jumper).

RE: laser.on in config.txt is ignored?? - Added by jaap over 9 years ago

Hi Joost,

We usually connect laser on and laser pwm via the optocoupler to the laser PSU. Laser enable is not used.
  • laser pwm is connected to replace the variable resistor that regulates laser power
  • laser on is connected to the PSU to turn the laser on and off, usually in parallel to the "test" button on top and in serial with the laser on/off switch.

More info: http://redmine.laoslaser.org/projects/laos/wiki/Pwm

RE: laser.on in config.txt is ignored?? - Added by joostn over 9 years ago

Hi Jaap,

But this basically means that Q1 is not usable, beacause LaserEnable is always active-low?
I've added some notes to that wiki page, feel free to edit.

My PSU needs a 20-50 khz PWM signal. I'm worried about the optocoupler bandwidth (haven't actually tried though) so that's why I'm using the transistor output. This is working fine.

RE: laser.on in config.txt is ignored?? - Added by jegb about 8 years ago

I am at this point too now, everything works except laser on (in my case is active high).
Would be possible to change the code to use thet variable?

Meanwhile i will use an hex schmitt inverter after the opto.

RE: laser.on in config.txt is ignored?? - Added by jegb about 8 years ago

LaosMotion.h currently includes this macro:
#define LASERON 0 //logic is Active LOW, Idle HIGH (pull up)
#define LASEROFF 1

Wouldn't make sense to have this instead?

#define LASERON (cfg->lon==0? 0 : 1) // logic is Active LOW if laserOn configuration value is 0, Active HIGH if laserOn configuration value is 1
#define LASEROFF (cfg->lon==0? 1 : 0)

not sure if my mbed source copy is latest, but anyone with latest branch could test and validate this?

RE: laser.on in config.txt is ignored?? - Added by jegb about 8 years ago

I tested this and it works. the macro needs to be in pins.h not LaosMotion.h though.

    (1-6/6)