Author Topic: Halftone image generator plugin - "Semitone"  (Read 16063 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4782
    • View Profile
Halftone image generator plugin - "Semitone"
« on: October 26, 2017, 17:45:59 pm »
I thought it was about time we had a halftone image plugin.

Please find attached version 1, works with CamBam v0.9.8 and v1.0

Test image also attached.

Once installed it appears in, Plugins->Semitone

Request !
How can I make the custon script in the drill MOp modal for R and F ? (look at the g-code sample)

Code: [Select]
M3 S16000
G0 X0.0 Y0.0
G98
G81 X0 Y0 Z-0.309295 R3 F300
G81 X5 Y0 Z-0.61859 R3 F300
G81 X10 Y0 Z-0.309295 R3 F300
G81 X15 Y0 Z-0.309295 R3 F300
G81 X20 Y0 Z-0.309295 R3 F300
G81 X25 Y0 Z-0.61859 R3 F300
G81 X30 Y0 Z-0.309295 R3 F300
G81 X35 Y0 Z-0.309295 R3 F300

Edit: Version 1.11 attached
1. buttons added to change foreground and background colours of simulation

Edit: Version 2.1 attached
The gcode will have to stay as above for now.
See this post for what's new, http://www.cambam.co.uk/forum/index.php?topic=6927.msg56554#msg56554

Edit: Version 2.2 attached
See this post for what's new, http://www.cambam.co.uk/forum/index.php?topic=6927.msg56556#msg56556

Edit: Version 2.3 attached
fixed a crash bug with some images.

Edit: Version 3.0 attached
Spiral method added, the centre can be located anywhere in the frame.
Picture shows output in CutViewer

Edit: Version 3.1 attached
Lines method added.
Picture shows output in CutViewer
« Last Edit: November 10, 2017, 11:32:58 am by EddyCurrent »
Made in England

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8494
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #1 on: October 26, 2017, 19:21:28 pm »
Eh... I don't think they can BE modal in the PP.  A quick-n-easy PBP would fix it, though!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4782
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #2 on: October 26, 2017, 19:23:58 pm »
Thanks, that's what I thought
Made in England

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4782
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #3 on: October 26, 2017, 19:34:00 pm »
Okay I tried it with .NET 3.5 and it works, so the attached version in the first post is okay for CamBam v0.9.8 and v1.0

Also I forgot to mention I have not tried it for real yet ! but I hope to tomorrow
« Last Edit: October 26, 2017, 19:36:52 pm by EddyCurrent »
Made in England

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1511
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #4 on: October 26, 2017, 23:17:40 pm »
Hi Eddy
This is a snippet from cnc-cookbook
 
Quote
Multiple Holes Until G80 Cancels the Cycle
As mentioned, these drilling cycles are modal. That means you can just real off a bunch of XY coordinates once the cycle is initiated, and the machine will happily execute the cycle at each location. To cancel the cycle, use G80. After executing the G80, the machine returns to G00 mode
so the R value is modal but the feeds are determined by the type of drilling operation "G-somevalue" there are a few of these to choose from.

Dave



Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6583
    • View Profile
    • Cambam V1.0 French Doc
Re: Halftone image generator plugin - "Semitone"
« Reply #5 on: October 27, 2017, 01:58:49 am »
Hello

Very nice !

Thanks for this new plugin !

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4782
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #6 on: October 27, 2017, 07:34:11 am »
Hi Eddy
This is a snippet from cnc-cookbook
 
Quote
Multiple Holes Until G80 Cancels the Cycle
As mentioned, these drilling cycles are modal. That means you can just real off a bunch of XY coordinates once the cycle is initiated, and the machine will happily execute the cycle at each location. To cancel the cycle, use G80. After executing the G80, the machine returns to G00 mode
so the R value is modal but the feeds are determined by the type of drilling operation "G-somevalue" there are a few of these to choose from.

Dave

Dave,
If a CamBam Canned Cycle Drill MOp is used, the R and F values are modal but it seems that when a custom script is used they are not.
Made in England

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1511
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #7 on: October 28, 2017, 02:09:49 am »
Hi Eddy
Have a look in the GRBL pp were Andy wrote code for this, GRBL doesn't know about canned cycles.
I can't remember the details but it may give you some useful info.
Dave
edit Nice plugin BTW.

Offline BR52

  • Wookie
  • ****
  • Posts: 358
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #8 on: October 28, 2017, 03:56:22 am »
Hi Dave
It will be, Is that what you're talking about?
https://github.com/garciasa/grbl-drills-cambam

   Armando

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1511
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #9 on: October 28, 2017, 09:24:13 am »
HI Armando

No I Hadn't seen that one,but it may be useful, I was talking about a thread here.

Dave

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4782
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #10 on: October 28, 2017, 15:01:49 pm »
Just playing now  ;D

Background and foreground colours for the simulation can now be changed, click the coloured buttons on the form to change.

Version 1.1 attached to first post.

Also keep this in mind !

The depth calculations are based upon a V cutter coming to a sharp point of zero diameter but in practice this may not be the case.
As the tool will be zeroed to it's tip, the maximum hole diameter may therefore be exceeded when cutting on the machine.
« Last Edit: October 29, 2017, 09:24:53 am by EddyCurrent »
Made in England

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1835
    • View Profile
    • pixelmaker
Re: Halftone image generator plugin - "Semitone"
« Reply #11 on: November 01, 2017, 10:55:59 am »
hello Eddy
thank you for this plugin. I use the old Haftoner for this work.
Perhaps in one future version it is possible to change the grid angle.  ;D
A grid angle of 41° looks best. It is the angle that is used for color black in print separation.

Ralf

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2476
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #12 on: November 01, 2017, 13:27:11 pm »
Hi Eddy, nice idea in that plugin.
Besides the dot raster there is also a linear one - parallel lines with varying width. Usually at an angle different from vertical and horizontal. This way the tool does long stokes with varying depth. Much like the heightmap generation but there are many (resolution defined) parallel lines and the user can control the angle.
The same technique is used for pressure engraving on stone or other hard materials. A diamond coated ball bit is used and instead of real Z movements a variable pressure is applied.
I've been, for a long time now,  planning a pressure engraving adapter which will convert Z step commands into PWM voltage applied to a coil.

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1421
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #13 on: November 01, 2017, 13:48:51 pm »
Dragon,
Why not just use a spring loaded tool where Z depth compresses spring to different pressures? Spring rates are in force per compression distance. So you might have spring that has 100 lbs per inch rate. A Z of -.5 would produce a 50 lb force.
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2476
    • View Profile
Re: Halftone image generator plugin - "Semitone"
« Reply #14 on: November 01, 2017, 17:55:44 pm »
I have made some experiments with a spring but with no good result. Besides, what I have seen as working designs do not use springs. The forces are not that great.
The tool is driven by a small high rpm motor similar to those of small grinders like Dremel. The spindle axis is at an angle to the material surface to provide sufficient peripheral speed. The force is generated either by an electromagnet or a DC motor which is not rotating but rather producing variable torque. There is a spring but is lifts the tool when no voltage is applied.
I think such solution is easier to tune than a mechanical spring one and can modulate the force at higher rates.