Hello Guest it is September 17, 2021, 04:13:35 AM

Author Topic: Csmio-s with Opt laser  (Read 2712 times)

0 Members and 1 Guest are viewing this topic.

Csmio-s with Opt laser
« on: October 23, 2019, 05:28:09 AM »
Hi

I connected the 5v TTL input of the opt laser on the analog 0 output in the controller, and the other TTL input of the laser to digital output 2 of the controller. I can switch the digital pin 2 with the M62/63 commands. But then the laser is switch on on full power. So for cutting it is fine.

Now I am battling to get the PWM working for engraving. I can not get the spindle analog value to work. I went through all the manuals and settings and I think I'm missing something. So now I want to try something different. The idea is to make my own custom mcodes to set the  analog 0 value directly on and off in the macro's, and the I can write my own post processors for the values. But now I am over my head with lua.

I emailed the support at Cslabs but either they do not understand English or do not want to help.

Can somebody maybe help me with the code to set the analog 0 value in the register.



Thanks

Johan

Offline Tweakie.CNC

*
  • *
  •  8,798 8,798
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Csmio-s with Opt laser
« Reply #1 on: October 23, 2019, 07:39:45 AM »
Hi Johan,

I am not sure you are going about this the right way. A TTL input is digital and only responds to two distinct states – High or Low (excluding the High Z of tri state logic) so connecting it to an analogue output will only produce ON at full power or OFF.

Ideally, to control a laser with adjustable output power you need to gate the digital PWM signal with the M62/M63 commands. This gives laser ON / OFF at the set PWM value.
There are a number of different ways to achieve this but my best (easiest) solution is described in this thread; https://www.machsupport.com/forum/index.php?topic=12444.msg265104#msg265104
(For Mach3, read Mach4 and for M11/M10 read M62/M63)

Hope this helps.
« Last Edit: October 23, 2019, 07:41:39 AM by Tweakie.CNC »
KEEP SAFE !

Offline Tweakie.CNC

*
  • *
  •  8,798 8,798
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Csmio-s with Opt laser
« Reply #2 on: October 23, 2019, 07:55:03 AM »
I made this video a few years back (before the M62/M63 commands had been added to Mach4) when I gated the PWM with The A axis Direction signal.
The toolpath alternates between Cut and Engrave as the PWM is altered and it serves to illustrate the gating principle I have described.

https://www.youtube.com/watch?v=8fUg6ebWut0&feature=youtu.be

KEEP SAFE !
Re: Csmio-s with Opt laser
« Reply #3 on: October 23, 2019, 10:16:50 AM »
Hi  Tweakie

Thanks for the speedy reply. The controller's analog output is 0 to 10V PWM, and the digital output is 24V. The laser have 2 inputs. Input one is labeled 5V TTL and input two is just labeled TTL and that one can use PWM to 24V. On the 5V input I connected a 4K2 resistor. That is the only two inputs on the laser. On another controller output I connected a solid state relay for the power supply, and is currently connected on the flood output. If i switch the laser's power supply on it takes about 3 seconds to stabilize. So I cannot use it to switch the laser on with the long delay. If I switch the power supply manually and I use the M62/63 P1 commands to activate the laser everything works perfectly but I can only cut. I know there must be a way to manually set the analog register's value in a M command but I am running in circles. I tried the following code but now I'm stuck.

function M200()
   local inst = mc.mcGetInstance()
    local hreg = mc.mcRegGetHandle(inst, "CSMIO-IP/Analog Output 0");
   regvalue = 5;
   mc.mcRegSetValue(hreg, regvalue)


end

if(mc.mcInEditor() == 1) then
    -- If you are in the mcLua editor, this will cause your script to execute if you Run or Debug
    -- Make sure your Capitalization and numbers match that of the function you are calling
    M200()
end


Any thoughts?

Thanks

Johan
   

Offline MXJ

*
  •  17 17
    • View Profile
Re: Csmio-s with Opt laser
« Reply #4 on: May 29, 2021, 10:30:33 PM »
Hi Johan,

Did you managed to get the laser working?

Cheers
Re: Csmio-s with Opt laser
« Reply #5 on: May 30, 2021, 05:39:03 AM »
Hi

Yes, currently I am using a CNC adapter with the laser. The 0 to 10v analog output go straight into the adapter for the raster engraving. For vector engraving output 0 of the CSMIO go through a variable resistor to the 0 to 5 volt input of the adaptor. Then I change the intensity of the laser beam manually with the pot and it work nice for me. A volt meter is connected to the 0 to 5 volt input so I can adjust the intensity precise.