Hello Guest it is October 16, 2019, 06:29:28 AM

Author Topic: Controlling Mach with Powerpoint? Is this possible?  (Read 14536 times)

0 Members and 1 Guest are viewing this topic.

Offline Tweakie.CNC

*
  • *
  •  7,947 7,947
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #10 on: May 17, 2011, 01:04:27 AM »
Most interesting idea.

Powerpoint can be event driven so the whole thing could be under Mach control including exposure timing Z movement etc. This could also be achieved, equally as well, using a simple PIC Microprocessor.
No doubt you have carried out preliminary experiments but I think you will be hard pressed to get enough UV from a viewing screen to actually expose UV curable resins but what do I know, I have never actually tried it.  ;)

Please keep us posted on you progress with this great project.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #11 on: May 17, 2011, 01:19:25 AM »
Well if you have any insight on controlling PP with Mach, please let me know. I would be interested in trying anything. Also, I'm not exposing the resin with the computer monitor, I will be using a DLP video projector which is sufficient to expose photo-polymer.

Offline Tweakie.CNC

*
  • *
  •  7,947 7,947
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #12 on: May 17, 2011, 06:22:49 AM »
I presume you will be using two computers here - one for Mach and one for Powerpoint ?

Assuming this is the case then there are many possible solutions, some easy and some complex.

Probably the easiest, that comes to mind, would be to use a Powerpoint Remote Controller which can be modified to have an LPT parallel port output pin operate the slide advance function. (the electronic equivalent of pushing the button).
The Mach GCode could toggle this output pin using something like the M3 / M5 combination.


Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #13 on: May 17, 2011, 01:55:32 PM »
Maybe even easier......

Connect a relay to mach and use the contacts to "press" the space bar of the PP computer.
i.e wire the relay contacts across the keyboard space bar switch (its normally the space bar that indexes to the next slide in PP).

Agreed, it's a bit of a hack, but "simple shimple"  :D

ATB
Derek.
You can "chop it off" but can't "chop it on"
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #14 on: May 17, 2011, 02:06:34 PM »
I think I figured it out. I will use an input on my breakout box to add a switch (optical or audio). Brian from Artsoft told me I can monitor the input with the Macro pump, which when it sees the input trigger, will run the G-code. Now I need to make an optical trigger that will attach to the monitor and between every slice slide will be a blank slide with a graphic shape, say in the top right corner, that will trigger the optical sensor. This should do the trick.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #15 on: May 18, 2011, 09:08:40 AM »
This any use to you as a basis? Save as a macro (say M800.m1s) and run from the MDI or wherever. Change the number of slides and the Z increment and of course the path to your slideshow to suit.

Code: [Select]
Option Explicit

Dim objPPT
Dim objPresentation
Dim s As Integer
Const numSlides As Integer = 10
Const ZIncrement As Double = 1

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Open("C:\some folder\some powerpoint.pps")

Code "G90" 'absolute distance mode
While IsMoving()
  sleep 10
Wend

Code "G0 Z0" 'start Z at wherever
While IsMoving()
  sleep 10
Wend

Code "G91" 'incremental distance mode
While IsMoving()
  sleep 10
Wend

For s=1 To numSlides
  Code "G1 Z" & ZIncrement 'lift Z a tad
  While IsMoving()
    sleep 10
  Wend
  objPresentation.SlideShowWindow.View.GotoSlide (s) 'show the next slide
  sleep 1000
Next

Code "G90"
objPresentation.Close
objPPT.Quit


Ian

Offline kf2qd

*
  •  123 123
    • View Profile
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #16 on: May 18, 2011, 11:39:48 AM »
Now that you explain it better - you don't need mach - What you need is a program that will display pictures in sequence along with some code to index the table up and down. Got anyone involved that can program in Visual C or Visual Basic? Wouldn't have to be a very complex app, but would probably be less work that trying to create a custom interface between Powerpoint and Mach.
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #17 on: May 18, 2011, 12:00:59 PM »
Thank you Stirling!  Ok, this looks good but have no idea what I'm looking at. lol  If you can give me a quick tutorial on how to load this and run it, that would be great! I use Mach but only from the interface, I've never used any custom scripts or macros. So will this locate PPT, open the slide show and run it, while executing the g-code? If so, that's exactly what I need!
I'm assuming that the "G91" is where I insert the Gcode for the movement? I.e. raising the Z .05 then back down .045?  I want the Z to move past the mark then back down into the actual position, this will ensure a fresh, even layer of resin to flow over the build. Also, the code will be the same for each slide because I don't need the Z to return to zero each time, it needs to keep moving, one little bit at a time. So the movement would be (in non code form) raise Z .05, lower Z .045 = +.005 increments for each slide.

Is the sleep in pulses, seconds, steps?? what is this value? 

Also, will this section of code load & execute for each slide? Or does this need to be copied and pasted for each slide (this could be thousands of slides depending on the job)
Code: [Select]
For s=1 To numSlides
  Code "G1 Z" & ZIncrement 'lift Z a tad
  While IsMoving()
    sleep 10
  Wend
  objPresentation.SlideShowWindow.View.GotoSlide (s) 'show the next slide
  sleep 1000
Next

Any additional help would be appreciated. Thanks again!  ;D
« Last Edit: May 18, 2011, 12:03:41 PM by watsonstudios »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #18 on: May 19, 2011, 05:23:17 AM »
...So will this locate PPT, open the slide show and run it, while executing the g-code?

Yes.

OK attached is a modified version. Save it to M800.m1s in c:\mach3\macros\YOUR PROFILE where YOUR PROFILE is shown at the bottom right of the Mach screen. Then either type M800 on the MDI screen or call M800 from a gcode program (you might want to set feedrate first either way). You'll need to edit the file and set the 5 constants at the top as required. Also you may want to make the first slide black.

Ian
Re: Controlling Mach with Powerpoint? Is this possible?
« Reply #19 on: May 19, 2011, 09:40:41 AM »
Thanks Ian. One question I have is ZStartPoint can't be a constant unless it is only implemented at the start of the job. Z will always start .005 higher for each slide and Z cannot always return to zero between each slide, that would crush the object being made. I'm no expert when it comes to code so I could be way off here. For each slide, Z would have to start from where Z ended up from the previous slide and Z can never go back to zero at the end. It has to stay where it is or raise up a bit then stop, end of job. Just trying to understand. Thanks. :)