Hello Guest it is February 13, 2026, 03:21:06 AM

Recent Posts

Pages: « 1 2 3 4 5 6 7 8 9 10 »
21
My remapping function of power isn't satisfying yet. I must say that i didn't take the easiest photo. I made a quick user interface (Python).

Lessons Learned :
To avoid white lines caused by a mismatch between the requested travel distances and the minimum step resolution allowed on an axis, I implemented a step-based logic where the commanded distance is computed by multiplying the number of Y-axis steps by the axis counts-per-unit value.
The same resolution was initially used for the X-axis motion; however, the system was unable to keep up with the resulting instruction rate, causing the feed rate to drop to 2400 instead of the requested 3000. As a result, the resolution had to be reduced.
22
General Mach Discussion / Re: Mach3 velocity setting
« Last post by Andrey67 on February 07, 2026, 03:12:36 AM »
Thanks!
But in the video I see 25000Hz. And I use ESS Smoothstepper and the manufacturer recommends not to change the frequency to 25000Hz.
Is it necessary to split the step size?
23
General Mach Discussion / Re: Mach3 velocity setting
« Last post by Tweakie.CNC on February 07, 2026, 02:47:12 AM »
If your machine, computer, motors & their drivers can handle the increased velocity then increase your Kernel Speed (Config / Ports & Pins). This will enable higher Velocity settings to be entered in Motor Tuning. Mach will need a restart to secure the change.

Tweakie.
24
General Mach Discussion / Mach3 velocity setting
« Last post by Andrey67 on February 07, 2026, 02:15:24 AM »
Hello,
I can't increase the velocity value above 1114.2 mm's per min at  1500 steps per.
Why is that?
But I found a video ( https://youtu.be/e9_ye1-ISjQ?si=2RM-vy9GemApRJIv&t=368 ) where the user increases the velocity to 3000 and then to 5000 mm's per min at 1000 steps for. Why can't I do this?
25
I spent some time figuring why there was no difference in small power percentage, the PWM was too high (20000Hz).
With 5000Hz, gray are less quantized. I'm not sure whose the most guilty pokey's card or the laser. (I'm assuming the latter)

I'll pursue my tests and post a picture when i'm satisfied.
26
Back to my Gcode converter, configuring the ideal settings is tricky. It seems that my Laser is very sensible. It's a laser tree 80W.
With a range limit of 9.5 to 20%, I got the nuances I want but the burning wood is not a linear process. So I'm trying to change the power map and what's best than a histogram (in attachment) to see my image translation in power ?
27
Note : In a Gcode, to ensure the successfull sending of the notification :
M5    -- Stop the laser in this case
M334 -- our macro to send notification
G4 P2 -- Pause 2s 
M30 -- Program end
28
I had some troubles with my macros not working anymore. I don't know why but .mcc wouldn't create. It was admin restrictions, just had to allow total control on the folder.
I took the occasion to test a notification system when the job is done on my smartphone, with the application "ntfy". I just need to add M334 at the end of every Gcode.
Code: [Select]
function m334()
    local inst = mc.mcGetInstance()
   
    local topic = "mach4_momo"
    local message = "Job's done ! Wake up !"
   
    -- curl command
    local cmd = string.format('curl -d "%s" http://ntfy.sh/%s', message, topic)
   
    mc.mcCntlSetLastError(inst, "Execution : " .. cmd)
   
    local success, reason, code = os.execute(cmd)
   
    if success then
        mc.mcCntlSetLastError(inst, "NTFY : Success (Code " .. tostring(code) .. ")")
    else
        mc.mcCntlSetLastError(inst, "NTFY : Error (" .. tostring(reason) .. ")")
    end
end

if (mc.mcInEditor() == 1) then
    m334()
end
29
Mach4 General Discussion / Re: Mach4 on 2 computers working together
« Last post by KatzYaakov on February 05, 2026, 02:17:40 PM »
I use many machine 2 computer that use mach4 and one is supervisor
It's CNC with labeling station that stick the lane on prev station before boards cut
If need details send me mail
30
Hi Tweakie,
It's a honor to have you since I red your laser project topic several years ago.

I made a python script to convert an image in Gcode, not that bad but more tuning is needed to get the fullscale gray level potential of my laser. Here's the code :
Code: [Select]
from PIL import Image, ImageOps

# --- PARAMÈTRES UTILISATEUR ---
input_image_path = "IMG_3901.jpg"
output_file = "IMG_3901.nc"

target_width_mm = 50.0   
feedrate = 3000         
line_step = 0.14         

min_power = 10            # Blanc / Gris très clair
max_power = 25           # Noir profond (Saturation à partir de 20)

# --- REGLAGE DU CONTRASTE ---
# gamma > 1.0 : éclaircit les gris moyens (donne plus de nuances dans les zones sombres)
gamma_correction = 1.6 

# --- CALIBRATION DYNAMIQUE ---
laser_latency_ms = 16.0
boost_at_3000 = -0.25
reference_feed = 1500.0
pre_move = 15.0         

# --- CALCUL DE L'OFFSET ---
base_offset = (feedrate * laser_latency_ms) / 60000
extra_boost = 0.0
if feedrate > reference_feed:
    extra_boost = boost_at_3000 * ((feedrate - reference_feed) / (3000.0 - reference_feed))
current_offset = base_offset + extra_boost

# --- TRAITEMENT IMAGE ---
img = Image.open(input_image_path).convert('L')

# 1. Égalisation et Contraste pour utiliser toute l'échelle de puissance
img = ImageOps.equalize(img)
img = ImageOps.autocontrast(img, cutoff=1)

# 2. Redimensionnement proportionnel
original_w, original_h = img.size
width_pixels = int(target_width_mm / line_step)
height_pixels = int(width_pixels * (original_h / original_w))
img = img.resize((width_pixels, height_pixels), Image.Resampling.LANCZOS)

real_width_mm = width_pixels * line_step
real_height_mm = height_pixels * line_step

# --- GÉNÉRATION G-CODE ---
gcode = []
gcode.append(f"( Image: {input_image_path} | Gamma: {gamma_correction} )")
gcode.append("G21 G90 G17 G94")
gcode.append("M3 M67 E0 Q0")

# Boucle de gravure (de bas en haut pour origine en bas à gauche)
for py in range(height_pixels - 1, -1, -1):
    y_pos = (height_pixels - 1 - py) * line_step
    is_forward = (py % 2 == 0)
   
    if is_forward:
        x_start, x_end, x_dir = 0.0, (width_pixels - 1) * line_step, 1
        x_range = range(width_pixels)
        corr = current_offset
    else:
        x_start, x_end, x_dir = (width_pixels - 1) * line_step, 0.0, -1
        x_range = range(width_pixels - 1, -1, -1)
        corr = -current_offset

    # Approche (Runway)
    gcode.append(f"G0 X{x_start - (pre_move * x_dir):.3f} Y{y_pos:.3f}")
    gcode.append(f"G1 X{x_start + corr:.3f} F{feedrate}")

    # Gravure de la ligne pixel par pixel
    for px in x_range:
        pixel_val = img.getpixel((px, py)) # 0 à 255
       
        # Inversion et Normalisation (0.0 à 1.0)
        norm_val = 1.0 - (pixel_val / 255.0)
       
        # Courbe Gamma
        corrected_val = norm_val ** gamma_correction
       
        # Conversion en puissance réelle
        power = min_power + (corrected_val * (max_power - min_power))
       
        x_pixel = px * line_step
        gcode.append(f"M67 E0 Q{power:.2f}")
        gcode.append(f"G1 X{x_pixel + corr:.3f}")

    # Fin de ligne et Overscan
    gcode.append("M67 E0 Q0")
    gcode.append(f"G1 X{x_end + (pre_move * x_dir):.3f}")

gcode.append("M5\nM30")

# Écriture du fichier
with open(output_file, "w") as f:
    f.write("\n".join(gcode))

# Affichage des informations
print(f"Fichier généré avec correction gamma {gamma_correction}")
print(f"Nombre de pixels : {width_pixels}x{height_pixels}")
print(f"Taille de sortie : {real_width_mm:.2f}x{real_height_mm:.2f} mm")
I tried to upload an image but an error occured, I uploaded it : https://i.postimg.cc/Zq9d0N0h/IMG-4230c.jpg

Ps : Don't mind the spoiler board, the real one is underneath !
Ps2 : the verification method is broken, forced to listen to it ? (The letters you typed don't match the letters that were shown in the picture)
Pages: « 1 2 3 4 5 6 7 8 9 10 »