That code hasn't changed for some years. All pwm use the same function including heaters and they go all 0-255 for intensity. Will recheck code if I see a limit to 100.
is there a code to turn the LASER on at minimum to see where it starts working and to position the material in the correct position?
That is, if I put a wood and I have to make an incision in a specific point, I can't know exactly where the laser starts working except for attempts to move, since I often have only one piece to be engraved, I risk always being wrong.
I would therefore need before starting the job to turn on the laser and be able to move it to find the starting point.
No, laser TTL is only on full power during moves or off. Not sure about other lasers but mine has a focus point when it gets it's12V power that I can use. I have connected that to a fan output so I can enable/disable this while the laser logic enables the laser or disables it.
For TTL logic I use one of the free pins on the extension pins. That just needs only %V but no high amp. So fan controls if laser gets power at all and the pin controls if laser should be enabled.
A laser is no extruder! You do not control it with temperatures. You need to configure it as laser by setting the laser pin and using the laser mode. Also D9 and D10 have both main voltage output. TTL input only needs 5V so that can destroy the layer electronics. Do not do that. Use config tool and enable laser support and you get the extra pin definition for the laser and also posiility to switch into laser mode using
That is NOT what I said. I said to NOT connect TTL to the 12V outputs as they damage the laser. Put them on a 5V output! I also said to put main power to fan output to be controlled with M106. That does mean the regular fan not the cooling fan that requires hot extruder which you do not have. And furthermore do not heat up - it is a laser not a extruder! That will fail with missing heater and temp. sensor as you saw.
If you follow this in laser mode a g1 move will enable laser when you previusly send M3 (laser on) until M5 (laser off) is send or if there is an increasing E value.
Comments
case 106: // M106 Fan On
if(com->hasI()) {
if(com->I != 0)
Printer::flag2 |= PRINTER_FLAG2_IGNORE_M106_COMMAND;
else
Printer::flag2 &= ~PRINTER_FLAG2_IGNORE_M106_COMMAND;
}
if(!(Printer::flag2 & PRINTER_FLAG2_IGNORE_M106_COMMAND)) {
if(com->hasP() && com->P == 1)
setFan2Speed(com->hasS() ? com->S : 255);
else
setFanSpeed(com->hasS() ? com->S : 255);
}
break;
So no limit. This calls setFanSpeed
void Commands::setFanSpeed(int speed, bool immediately) {
#if FAN_PIN >- 1 && FEATURE_FAN_CONTROL
if(Printer::fanSpeed == speed)
return;
speed = constrain(speed, 0, 255);
Printer::setMenuMode(MENU_MODE_FAN_RUNNING, speed != 0);
Printer::fanSpeed = speed;
if(PrintLine::linesCount == 0 || immediately) {
if(Printer::mode == PRINTER_MODE_FFF) {
for(fast8_t i = 0; i < PRINTLINE_CACHE_SIZE; i++)
PrintLine::lines[i].secondSpeed = speed; // fill all printline buffers with new fan speed value
}
Printer::setFanSpeedDirectly(speed);
}
Com::printFLN(Com::tFanspeed, speed); // send only new values to break update loops!
#endif
}
At the beginning you see constrain to 0-255.
This calls setFanSpeedDirectly:
void Printer::setFanSpeedDirectly(uint8_t speed) {
uint8_t trimmedSpeed = TRIM_FAN_PWM(speed);
#if FAN_PIN > -1 && FEATURE_FAN_CONTROL
if(pwm_pos[PWM_FAN1] == trimmedSpeed)
return;
#if FAN_KICKSTART_TIME
if(fanKickstart == 0 && speed > pwm_pos[PWM_FAN1] && speed < 85) {
if(pwm_pos[PWM_FAN1]) fanKickstart = FAN_KICKSTART_TIME / 100;
else fanKickstart = FAN_KICKSTART_TIME / 25;
}
#endif
pwm_pos[PWM_FAN1] = trimmedSpeed;
#endif
}
Here TRIM_FAN_PWM could be the problem
#if !defined(MAX_FAN_PWM) || MAX_FAN_PWM == 255
#define TRIM_FAN_PWM(x) x
#undef MAX_FAN_PWM
#define MAX_FAN_PWM 255
#else
#define TRIM_FAN_PWM(x) static_cast<uint8_t>(static_cast<unsigned int>(x) * MAX_FAN_PWM / 255)
#endif
As you see if you defined MAX_FAN_PWM 100 then 100 then what you describe would happen, but you would need to set this explicitly. But maybe you did.
Use config tool and enable laser support and you get the extra pin definition for the laser and also posiility to switch into laser mode using
I also said to put main power to fan output to be controlled with M106. That does mean the regular fan not the cooling fan that requires hot extruder which you do not have. And furthermore do not heat up - it is a laser not a extruder! That will fail with missing heater and temp. sensor as you saw.
If you follow this in laser mode a g1 move will enable laser when you previusly send M3 (laser on) until M5 (laser off) is send or if there is an increasing E value.