arkypita / LaserGRBL

Laser optimized GUI for GRBL
http://lasergrbl.com
Other
1.25k stars 496 forks source link

LaserGRBL burns Images inverted #292

Closed truvisual closed 6 years ago

truvisual commented 6 years ago

Hi, when i load an image to burn it in grayscale, it burn the white regions, so it's inverted. And letters in vector will not burned. So what's wrong on my cpu_map.h? Or ist the issue a other reason? Maybe the SPINDLE_DIRECTION_BIT 5 is wrong? Here is my cpu_map.h, a part of it:

// Define spindle enable and spindle direction output pins.
  #define SPINDLE_ENABLE_DDR      DDRH
  #define SPINDLE_ENABLE_PORT     PORTH
  #define SPINDLE_ENABLE_BIT      3 // OC4A PH3  MEGA2560 Digital Pin 4 - Ramps 1.4 Servo 4 Signal pin
  #define SPINDLE_DIRECTION_DDR   DDRH  //  DDRE
  #define SPINDLE_DIRECTION_PORT  PORTH //  PORTE
  #define SPINDLE_DIRECTION_BIT   5 // MEGA2560 Digital Pin 5 - Ramps 1.4 Servo 3 Signal pin

  #define SPINDLE_PWM_MAX_VALUE     1024.0 // Translates to about 1.9 kHz PWM frequency at 1/8 prescaler
  #ifndef SPINDLE_PWM_MIN_VALUE
  #define SPINDLE_PWM_MIN_VALUE   1   // Must be greater than zero.
  #endif
  #define SPINDLE_PWM_OFF_VALUE     0
  #define SPINDLE_PWM_RANGE         (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)

  //Control Digital Pin 6 which is Servo 2 signal pin on Ramps 1.4 board
  #define SPINDLE_TCCRA_REGISTER    TCCR4A  //    TCCR4A
  #define SPINDLE_TCCRB_REGISTER    TCCR3A  //    TCCR3A
  #define SPINDLE_OCR_REGISTER      OCR3A   //    OCR3A
  #define SPINDLE_COMB_BIT          COM3A1  //    COM3A1

  // 1/8 Prescaler, 16-bit Fast PWM mode
  #define SPINDLE_TCCRA_INIT_MASK ((1<<WGM40) | (1<<WGM41))
  #define SPINDLE_TCCRB_INIT_MASK ((1<<WGM42) | (1<<WGM43) | (1<<CS41))
  #define SPINDLE_OCRA_REGISTER   OCR3A // OCR3A  16-bit Fast PWM mode requires top reset value stored here.
  #define SPINDLE_OCRA_TOP_VALUE  0x400 // PWM counter reset value. Should be the same as PWM_MAX_VALUE in hex.

  // Define spindle output pins.
  #define SPINDLE_PWM_DDR   DDRE
  #define SPINDLE_PWM_PORT  PORTE
  #define SPINDLE_PWM_BIT   3 // OC3A  Port E, Bit 3  PIN 5  PE3MEGA2560 Digital Pin 8
arkypita commented 6 years ago

have a look on google http://lmgtfy.com/?q=grbl+invert+laser+logic http://lmgtfy.com/?q=grbl+reverse+ttl

or ask to grbl github page https://github.com/gnea/grbl

this is not the right place