PWM depending on Z axis walue ? Superimposing a pic

More
16 Jul 2016 18:23 - 16 Jul 2016 18:30 #77549 by tommylight
I have a problem, namely, spent 5 hours yesterday trying to configure one of the parport pins to output a PWM value depending on the Z axis depth.
I build engraving machines for stone or glass or whatever you put under it, as they use a diamond bit at high speed to scratch the surface, mounted at an angle 15-20 degrees, with another motor doing the pressure on that bit.

Here are videos of 3 of them working, so can see how it all works and they can do.





Now i need to make that work with Linuxcnc, so image2gcode can be used for generating the tool path, but i need the Z axis values to output PWM on a pin, strictly dependent on that Z axis value.
I did try the M3/M5 route, M67/M68 but it is not what i need, and it will not work.
Just a nudge in the right direction (if any exist) would be appreciated.
I also need to know if there is away to have the picture that image2gcode used to generate the tool path, show in the preview screen in AXIS, that would be awesome.

Regards,
Tom
B.TH.W, feel free to use the idea, and if anyone needs more pictures or info, let me know.
Last edit: 16 Jul 2016 18:30 by tommylight. Reason: More info

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

More
16 Jul 2016 19:20 #77550 by PCW
why not just use the Z commanded value in the hal file perhaps gated with Spindle on?
The following user(s) said Thank You: tommylight

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

More
16 Jul 2016 20:28 #77554 by tommylight

why not just use the Z commanded value in the hal file perhaps gated with Spindle on?


Sanity check :
net the Z commanded value to output to spindle on? Will give it a try, should be easy !!!
Damn i need a lot of sleep, it was 3:05 Am last night when i left for bed.
As always, thank you very much, PCW.
Tom

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

More
17 Jul 2016 17:15 #77572 by tommylight
Well......it did not work, as the cmd will send just the command for going up or down and stop, i need it to have and keep the actual value, as example:
10 levels of shade ( in my case pressure ) from 0 or 1 to 9 or 10 ( or 0 to1 ), now if Z is at for instance 4 i need it to output that constantly as a pwm value until it changes to 5 and then keep that value until 0 .
Just figured out, i need to have the pwm change based on actual Z gcode.
So, image2gcode will need to produce a depth map of 0 to -10 (or +10) for Z axis, and based on that i need it to output changing PWM to one of the pins.
Back to more fiddling.

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

More
17 Jul 2016 18:36 #77575 by PCW
Yeah, you will need to scale your Z to match your PWM range
Also you should set you Z acceleration as high as possible*
so it does not slow your "modiulation"

* (there may be a limit to how high this can be set without breaking something in the TP
but as long as it can get to the next PWM value in 1 servo period there's little advantage in setting it higher)

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

More
17 Jul 2016 21:59 #77583 by tommylight
Done, the actual test still remains undone since i am finishing 2 new machines and i do not have anything ready to test on, but i have paraport testers with LED that show exactly what is needed for the hardware, signalling wise.
I am attaching the complete config for anyone that wants to endeavour into making that type of machine.
Now some more info:
The config uses quadrature outputs for steppers that can be changed to step/dir or anything else,
It has a VCP panel to show what is going on with output pins,
It uses milimeters, not inches, again easily changed if needed,
The software used for image to gcode is dmap2gcode from
www.scorchworks.com/Dmap2gcode/dmap2gcode.html
with utmost respect for them,
Image-to-gcode that is included with LinuxCnc works, but it uses G2 and G3 on the X-Z plane so it need a lot of cleaning, while dmap2gcode needs just replacing the Z with an S and removing the negative values.
Now some details of the machine:
Everything except the head assembly is and can be same as any cnc machine with regards to X and Y axis so any router or plasma or mill can be modified for this, the head or Z axis needs a bit more details.
The head assembly is made of one bigger DC motor with a mount attached to its shaft for mounting another high speed spindle ( has to be light weight under 50 to 60 grams to work ), to drive the high speed spindle there is another DC motor mounted somewhere else on the head assembly that drives the high speed spindle via a small belt, powered directly from 12 or 24V DC depending on the motor, it does not need speed control, the faster it can spin the better.
That bigger motor is driven by a NPN darlington transistor controlled from pin 2 of paraport in my case, can be changed to whatever, on the negative side, while the positive wire from power supply goes directly to it.
.................................................................
Here are pictures of the last one i built, might be easier to see the details of the head assembly.

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

More
18 Jul 2016 19:06 #77608 by tommylight
Forgot the config, sorry.
Attachments:

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

More
29 Jul 2016 00:36 - 29 Jul 2016 00:38 #78121 by tommylight
That did not work as i was hopping, so i modified the config to use a spindle PWM, so i just need to change the Z with an M67 E0 Q........<Z axis values here, and make negative values positive from 0 to 10, did a PWM scale of 10 so now it does what it should for the machine. Still slows down on some parts while running gcode, but it is bearable.
Now i have to figure out dmap2gcode to output some more reasonable values, as a dark gray shade goes to 6 or 7 and that is unacceptable for my setup.
I will upload the new config tomorrow.
Tom
Last edit: 29 Jul 2016 00:38 by tommylight.

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

More
21 Aug 2016 23:33 #79221 by tommylight
Well tomorrow came and went, but i did not have time to fidle with it, so today i had some time to mess about and the results are more than i was hoping for.
I am attaching the whole config with dmap2gcode already set up and ready for this, or for laser pwm control as it is viable fully for that too, the only difference being the tool diameter and the stepover.
There is an older version that works with LinuxCnc 2.7.x and the newer version for 2.8.pre1
Attachments:

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

More
20 Sep 2016 22:27 #80696 by tommylight
What are the chances of superimposing a picture on the plot screen when i open a gcode file?
Basically i need to have the picture of the job running on Linuxcnc so i will attach the screen shot and the actual picture. I need to see that picture behind the toolpath, or in front but transparent.
Attachments:

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

Time to create page: 0.083 seconds
Powered by Kunena Forum