Laser fires and moves erratically
Quote from Valle on December 24, 2017, 12:37 amI'm using a Windows 10 laptop with Inkscape 0.92.0 to control a K40 that has had the tube and psu replaced with these: http://www.lightobject.com/40W60W-PWM-CO2-Laser-Power-Supply-AC110V-P72.aspx http://www.lightobject.com/SPT-45W-CO2-Sealed-Laser-Tube-1M-P751.aspx. I have attached photos of how my old controller was connected as well as how I connected the Gerbil. I started by running Inkscape as administrator and streaming a cut command to the laser. Nothing happened. I tried again with a different usb cable. This time the tube fired 3 or 4 times in quick succession, then the laser head started moving around, but not at all in the shape of the circle it was supposed to cut. Even though I checked the box for the laser to home, it never did. The laser head stopped moving after a few seconds and then Inkscape froze up on the laptop. (See attached photo). Unplugging the usb from the laptop caused Inkscape to start responding again and to display this error:
Traceback (most recent call last):
File "laser.py", line 3367, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 283, in affect
self.effect()
File "laser.py", line 3361, in effect
if self.options.stream == True : self.gcodetocontroller((self.serial_ports()),((self.options.directory+self.options.file)),((self.options.directory+self.options.file+"_log")))
File "laser.py", line 3132, in gcodetocontroller
while sum(c_line) >= RX_BUFFER_SIZE-1 | s.inWaiting() :
File "C:\Program Files (x86)\Inkscape\python\lib\site-packages\serial\serialutil.py", line 572, in inWaiting
return self.in_waiting
File "C:\Program Files (x86)\Inkscape\python\lib\site-packages\serial\serialwin32.py", line 257, in in_waiting
raise SerialException('call to ClearCommError failed')
serial.serialutil.SerialException: call to ClearCommError failed
I tried adding a 10nF capacitor between GND and the PWM wire as some in the forum have suggested, but it made no difference. I have also tried turning everything off/on and rewiring everything to no avail. I get the same behavior and error every time. I even plugged the old board back in to see if it still works and it does.
I'm using a Windows 10 laptop with Inkscape 0.92.0 to control a K40 that has had the tube and psu replaced with these: http://www.lightobject.com/40W60W-PWM-CO2-Laser-Power-Supply-AC110V-P72.aspx http://www.lightobject.com/SPT-45W-CO2-Sealed-Laser-Tube-1M-P751.aspx. I have attached photos of how my old controller was connected as well as how I connected the Gerbil. I started by running Inkscape as administrator and streaming a cut command to the laser. Nothing happened. I tried again with a different usb cable. This time the tube fired 3 or 4 times in quick succession, then the laser head started moving around, but not at all in the shape of the circle it was supposed to cut. Even though I checked the box for the laser to home, it never did. The laser head stopped moving after a few seconds and then Inkscape froze up on the laptop. (See attached photo). Unplugging the usb from the laptop caused Inkscape to start responding again and to display this error:
Traceback (most recent call last):
File "laser.py", line 3367, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 283, in affect
self.effect()
File "laser.py", line 3361, in effect
if self.options.stream == True : self.gcodetocontroller((self.serial_ports()),((self.options.directory+self.options.file)),((self.options.directory+self.options.file+"_log")))
File "laser.py", line 3132, in gcodetocontroller
while sum(c_line) >= RX_BUFFER_SIZE-1 | s.inWaiting() :
File "C:\Program Files (x86)\Inkscape\python\lib\site-packages\serial\serialutil.py", line 572, in inWaiting
return self.in_waiting
File "C:\Program Files (x86)\Inkscape\python\lib\site-packages\serial\serialwin32.py", line 257, in in_waiting
raise SerialException('call to ClearCommError failed')
serial.serialutil.SerialException: call to ClearCommError failed
I tried adding a 10nF capacitor between GND and the PWM wire as some in the forum have suggested, but it made no difference. I have also tried turning everything off/on and rewiring everything to no avail. I get the same behavior and error every time. I even plugged the old board back in to see if it still works and it does.
Uploaded files:Quote from Guest on December 24, 2017, 7:48 amHi
is the heat sink on the stepper driver touching the pins?
Mine arrived with it shorting out some pins and I had to twist the heat sink a bit to get it back on the centre of the daughter board.
Hi
is the heat sink on the stepper driver touching the pins?
Mine arrived with it shorting out some pins and I had to twist the heat sink a bit to get it back on the centre of the daughter board.
Quote from Valle on December 24, 2017, 4:02 pmThanks for the suggestion. One of the heat sinks was misaligned, but didn't appear to be shorting anything. I re-positioned it and got the same erratic behavior as before unfortunately.
Thanks for the suggestion. One of the heat sinks was misaligned, but didn't appear to be shorting anything. I re-positioned it and got the same erratic behavior as before unfortunately.
Quote from Guest on December 25, 2017, 7:57 amLooks likes it’s time to break out the terminal emulator and start talking to Gerbil directly. If it works then there is an issue in Inkscape/plugin/confit, if it doesn’t work you know there is an issue with Gerbil/wiring/power supply.
Looks likes it’s time to break out the terminal emulator and start talking to Gerbil directly. If it works then there is an issue in Inkscape/plugin/confit, if it doesn’t work you know there is an issue with Gerbil/wiring/power supply.
Quote from Guest on December 25, 2017, 7:59 amTry send it something like $H to home it then G0 Y50 X50
Try send it something like $H to home it then G0 Y50 X50
Quote from Chris Luke on December 25, 2017, 4:16 pmFollowing on from the previous poster, focus on solving the movement problem first (since it should be simpler); on my K40 there's a laser on/off button, I did my initial setup with it disabled so I could observe the gantry movements.
If your steppers don't move as expected, possibly the drive current needs tweaking, or the coil wires are crossed.
If the erratic behavior only happens when trying to engage the laser, that is a big clue; on my setup I initially ran the laser with the stock potentiometer, again to test just the things I wanted to.
If yours runs smoothly with the pot but not the PWM signal then it's likely a noise problem. I think I got lucky with my 0.1µF solution; I suspect you may need a fuller RC combination, such as the 1k series resistor and 0.1µF cap that Paul had mentioned on my thread a day or so ago. Unless you can get an oscilloscope on there you won't really know what sort of noise you're dealing with, but this page may help with figuring out values to try: https://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/
Following on from the previous poster, focus on solving the movement problem first (since it should be simpler); on my K40 there's a laser on/off button, I did my initial setup with it disabled so I could observe the gantry movements.
If your steppers don't move as expected, possibly the drive current needs tweaking, or the coil wires are crossed.
If the erratic behavior only happens when trying to engage the laser, that is a big clue; on my setup I initially ran the laser with the stock potentiometer, again to test just the things I wanted to.
If yours runs smoothly with the pot but not the PWM signal then it's likely a noise problem. I think I got lucky with my 0.1µF solution; I suspect you may need a fuller RC combination, such as the 1k series resistor and 0.1µF cap that Paul had mentioned on my thread a day or so ago. Unless you can get an oscilloscope on there you won't really know what sort of noise you're dealing with, but this page may help with figuring out values to try: https://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/