Engrave Photos with PWM Laser
Hi,
is there anyone experienced in engraving photos with PWM Laser?
just need some setups regarding grayscales as i´m not really satisfied with my results.
I use PLTB450 B 1.6W Blue Laser Diode with PWM capable driver controlled by 12 Bit PWM at 1KHz
Thanks
is there anyone experienced in engraving photos with PWM Laser?
just need some setups regarding grayscales as i´m not really satisfied with my results.
I use PLTB450 B 1.6W Blue Laser Diode with PWM capable driver controlled by 12 Bit PWM at 1KHz
Thanks
Comments
See the photo on the end of the blog article...
http://www.e-tips.it/2017/03/20/incisore-laser/
Seems that for a gray-scale you have to drive the laser with a higher PWM frequency...
but in repetier-firmware, if you change the PWM frequency then it will decrease the resolution of the pwm, so you have less duty cycle value, so you cannot have a good result...
Edit.
I will add a question...
In the repetier, the PWM frequency is fixed?
If the frequency is made by the hardware peripherals and it is a fixed frequency, i will try to increase it with a micro-controller programmed for multiply the frequency...
https://github.com/repetier/Repetier-Firmware/tree/development/src/SampleEventSystems/Laser PWM and DAC
I´ll post some pictures to my GitHub to show some pretty good results.
(may take a cuple of days)
Great! Fantastic work!
I've ordered two PCA9685 board and two solid state relay (i've got to machine).
I will tell you the result as soon i receive the parcel
Great work also with the fix:
Warmup for laser included (to avoid gaps in engraving)
I've downloaded your firmware and i will configure and try it
Edit:
Ops, i've got the MEGA..
use dev firmware and add the custom events , warmup and most other features are included in official repetier-firmware
Can I ask you some confirmation?
I've copy the CustomEvents.h and CustomEventslmpl.h in the repetier firmware path, then compiled and load into Arduino MEGA...
Now I've just to connect the PCA9685 board to the i2c bus like described in the PDF file, and connect to it the laser? Right?
What kind of program have you used to create the G-Code in gray scale mode from a picture? Inkscape? with plugins?
Thanks a lots for your support,
Luca.
in Configuration.h you have to enable Custom events by adding
#define CUSTOM_EVENTS
thats all.
there are multiple programs to generate the gcode .
i use pic engrave pro , there is a demo version available
exit status 1
'firstMove' is not a member of 'LaserDriver'
Edit. solved...just define CUSTOM_EVENTS upper than laser section...of course...
Problem N°2:
exit status 1
'newint' was not declared in this scope
on row:
#if defined(GAMMA_CORRECTION) && (GAMMA_CORRECTION==true)
newint =(com->S);
if (Gamma_on)
{
Outval=pow(newintens/LASER_PWM_MAX,GAMMA)*LASER_PWM_MAX; //Gamma function
LaserDriver::intensity = map((int)Outval,0,LASER_PWM_MAX,LASER_BASE_OFFSET,LASER_LIMIT);// scale gamma function and offset to max
Com::printFLN(PSTR("orig:"),(int)newintens);
}
else
{
Outval=newintens;
LaserDriver::intensity = map((int)Outval,0,LASER_PWM_MAX,LASER_BASE_OFFSET,LASER_LIMIT);// scale offset to max
Com::printFLN(PSTR("Gamma off LV:"),(int)newintens);
}
declaring it, it will compile the code, but i don't think that is a good solution...
Maybe i can declare it at the start of the file?
int newint = 0;
do not modify the code
https://www.repetier.com/firmware/dev/index.php
Then i've add the customevents.h and customeventsimpl.h to firmware folder, and i've add the:
#define CUSTOM_EVENTS
after
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
in configuration file...
The error still the same:
'newint' was not declared in this scope
(before last #endif)
when did you download the firmware files?
downloaded 3 min ago from https://github.com/repetier/Repetier-Firmware/tree/development
compiles without error.
what arduino version do you use?
EDIT::
Typo, please change
newint =(com->S);
to
newintens =(com->S);
thanks for the hint!!!
do you use only the pca9685 or also the mcp23017 and mcp4725?
#define FEATURE_I2C_MACROS false
#define FEATURE_EXT_PWM true
#define FEATURE_PWM_LASER true
#define FEATURE_ANALOG_LASER false
#define GAMMA_CORRECTION true
if not already done you also should set in configuration.h
#define LASER_PWM_MAX 4095
to get the 12bit resolution
Now i can compile without any problem, next week i will try to use the photo engraver with your code and will post the result
But before, i need to setup a mosfet for connect the PCA9685 to the laser...
Thanks
Seems working, but i cannot connect the laser at the moment (i'm using it with a LED) because i need to invert the signal...
from the code:
class PCAPWM
{
public:
PCAPWM(uint8_t address);
void Init(void);
void SetFREQ(float freq);
void SetPWM(uint8_t num, uint16_t on, uint16_t off);
void SetPIN(uint8_t num, uint16_t val, bool invert=false);
private:
uint8_t PCA_addr;
};
Theoretically if i change the invert=false to invert=true the output signal will be reversed?
I will power the laser trough a N-Mosfet, so i have to invert the output signal...
thanks
Edit.
Seems the bool invert=true has no effect on laser output status...
How can invert the output? When the arduino start-up, the output of the PCA should be LOW, and when the laser is powered on, the output should be HIGH
in configuration.h
Change
#define LASER_ON_HIGH 0
to
#define LASER_ON_HIGH 1
so i guess you didnt set up the files correct
beginning of custom Events.h in this case should look like
#define GAMMA_CORRECTION true
may be you should check first if the i2c bus is running....
use nick gammons i2c scanner for example.
"when I change the (#define CUSTOM_EVENTS) to (#define CUSTOM_EVENTS _H) in the Configuration.h folder, then the repeater hodt"
i never wrote to do that.....
you can also check this to see if your Hardware is running
https://learn.adafruit.com/16-channel-pwm-servo-driver/using-the-adafruit-library
USE LED FOR TEST NOT THE LASER !!!!