TTL (PWM) Laser head and Mesa 7i76

More
29 Sep 2023 19:13 - 29 Sep 2023 19:13 #281873 by PCW
No, that's the 0-10V analog output

The (5V) PWM output would be on P2 (XCLK)
Last edit: 29 Sep 2023 19:13 by PCW.

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 16:47 #282077 by swepeter
Something really strange is going on.i have a PS for 5 V that powers the raspberry pi and the mesa card and I have a PS for 12V that I have connected to the BOB to. when I connect the cable between the mesa and the BOB there is something that starts beeping and the 5V PS only gives out 1V and the Pi dont start of cause. What can cause this?  

photos.app.goo.gl/TdpXLu7YHBWZhK1X7

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 17:01 #282078 by PCW
It sounds like you have the 7I96 set to supply 5V power via P1 (W8 UP)
This will short out the 5V supply if you do this with normal parallel port
breakouts

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 17:14 #282081 by swepeter
Ok. I have not applyed your fw patch yet. Do i need to do that first ? Or is it a physical pin?

Thanks so much!

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 17:15 #282082 by swepeter
This?
Attachments:

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 17:17 #282083 by PCW
Yes (page 3 in 7I96 manual)

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 18:58 - 02 Oct 2023 20:48 #282089 by swepeter
Great that worked.

I have now worked to get the laser working but I am not getting al the way
This is how it looks now: github.com/swepeter/PrintNC/tree/LASER
CNC.hal: github.com/swepeter/PrintNC/blob/LASER/PrintNC.hal
CNC.INI: github.com/swepeter/PrintNC/blob/LASER/PrintNC.ini
Cusom.hal: github.com/swepeter/PrintNC/blob/LASER/custom.hal

This is the command right:
off: M67 E0 Q0
on value 204 out of 255: M67 E0 Q204

Changes are more or less:

loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=[EMCMOT]MAX_SPINDLES
loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=1 num_pwmgens=1 num_stepgens=5
loadrt pid names=pid.x,pid.y,pid.y2,pid.z,pid.s,pid.a,M3Trigger.trigger_pin,pid.l
loadrt abs names=abs.spindle,abs.laser

# ---- LASER ---- 

loadrt pwmgen output_type=0,0

addf pwmgen.update            servo-thread
addf pwmgen.make-pulses       servo-thread  
addf pid.l.do-pid-calcs       servo-thread
addf abs.laser                servo-thread


# *******************
#   LASER
# *******************

setp   pid.l.Pgain     [LASER_0]P
setp   pid.l.Igain     [LASER_0]I
setp   pid.l.Dgain     [LASER_0]D
setp   pid.l.bias      [LASER_0]BIAS
setp   pid.l.FF0       [LASER_0]FF0
setp   pid.l.FF1       [LASER_0]FF1
setp   pid.l.FF2       [LASER_0]FF2
setp   pid.l.deadband  [LASER_0]DEADBAND
setp   pid.l.maxoutput [LASER_0]MAX_OUTPUT
setp   pid.l.error-previous-target true

net laser-index-enable  <=> pid.l.index-enable
net laser-enable        =>  pid.l.enable
net laser-vel-cmd-rpm     => pid.l.command
net laser-vel-fb-rpm      => pid.l.feedback
net laser-output        <=  pid.l.output


# *******************
#   LASER PWM
# *******************
setp   hm2_7i96.0.pwmgen.00.output-type 1
setp   hm2_7i96.0.pwmgen.00.scale 100
setp    hm2_7i96.0.pwmgen.pwm_frequency 5000

setp hm2_7i96.0.pwmgen.00.enable true

net laser-speed-cmd <= spindle.1.speed-out => pwmgen.1.value
net laser-on <= spindle.1.on => pwmgen.1.enable
net laser-pwm <= pwmgen.1.pwm => hm2_7i96.0.ssr.00.out-01
# Establecer la velocidad máxima del husillo en RPM
setp pwmgen.1.scale 11000


[LASER_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2000.0
Last edit: 02 Oct 2023 20:48 by swepeter.

Please Log in or Create an account to join the conversation.

More
02 Oct 2023 22:00 - 02 Oct 2023 22:30 #282097 by PCW
Closer to this:
(delete everything else)

# *******************
#   LASER PWM
# *******************
setp   hm2_7i96.0.pwmgen.00.output-type 1
setp   hm2_7i96.0.pwmgen.00.scale 100
setp    hm2_7i96.0.pwmgen.pwm_frequency 5000

net laser-on  hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-01
net laser-pwm hm2_7i96.0.pwmgen.00.value

Edit, added SSR 1 for laser enable

I would switch the laser power with this output
(directly if it's within the 7I96 outputs current/voltage range)


 
Last edit: 02 Oct 2023 22:30 by PCW. Reason: Add SSR

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 14:32 #282161 by swepeter
net laser-on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-01
This line is only for protection not to turn the laser on right? I have a physical switch for that.

I am testing with this code and do not get a signal from the laser:
; LightBurn 1.3.01
; LinuxCNC device profile, absolute coords
; Bounds: X1300 Y0 to X1320 Y20

;USER START SCRIPT
G90 (Incremental distance mode)
G17 G21 (Active Plane: XY)(Metric Mode)
G40 G49 G80(Tool Diameter, Length compensation & canned cycles OFF)
G64 P0.05 Q0.05(Path Blending)
M600
G90 (absolute distance mode)
G57 (Coordinate System)
;USER START SCRIPT

G21
G90
; Cut @ 200 mm/min, 40% power
M8
M67 E0 Q0
G0 X1300 Y0 F0
; Layer Labels
M67 E0 Q102
G1 Y20 F200
Attachments:

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 14:52 #282163 by PCW
signals laser-on and laser-pwm are unconnected in your hal file
they must be connected to appropriate LinuxCNC pins

Its important to have LinuxCNC control the Laser power on/off so its immediately
disabled if linuxCNC has a fault

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.108 seconds
Powered by Kunena Forum