Hello Guest it is October 16, 2019, 03:53:32 AM

Author Topic: I Need a macro written will pay.  (Read 2648 times)

0 Members and 1 Guest are viewing this topic.

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #20 on: February 02, 2018, 04:25:05 AM »
Cheers Thomas I shall have a play with that later today on the bench.

Offline TPS

*
  •  1,389 1,389
    • View Profile
Re: I Need a macro written will pay.
« Reply #21 on: February 02, 2018, 06:43:11 AM »
hello Tony,

attached a first (very raw) Version for the wizard.

please expand to your addon Folder.
then copy m400.m1s and m401.m1s to your Profile/macrofolder.

add this code:

Code: [Select]
'calculate the actual value from laser
'based on (rawvalue * multiplicator) - offset
actmm = GetUserDro(1000) * GetUserDro(1150)
SetUserDro(1151, actmm )
SetUserDro(1154, 1000.0 - actmm -GetUserDro(1153))

to your macropump.m1s and make sure macropump is enabled in General config.

restart Mach3.

then you should see the wizard witch is named "laser digitizise wizard"

open the wizard and test.

Thomas
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #22 on: February 02, 2018, 09:50:26 AM »
wow thats great work, i shall be looking at this over the weekend, so watch this space !

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #23 on: February 12, 2018, 04:28:35 AM »
Hi Thomas I am nearly ready to get back onto this, im afraid paying work has got in the way :(
  I sent you an email did you receive it?
Also macro pump what is that? I don't seem to have a macropump.m1s file anywhere?
other than that I've done as you say and the new laser wizard comes up, looks good.

Tony
« Last Edit: February 12, 2018, 04:40:46 AM by comet »

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #24 on: February 12, 2018, 04:51:43 AM »
Got it --I think!
I have made the macropump.m1s in vb editor, there is just your code in that file, or should there be other code?

Tony

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #25 on: February 12, 2018, 04:54:03 AM »
Got it --I think!
I have made the macropump.m1s in vb editor, there is just your code in that file, or should there be other code?

Tony

Offline TPS

*
  •  1,389 1,389
    • View Profile
Re: I Need a macro written will pay.
« Reply #26 on: February 12, 2018, 05:03:09 AM »
Got it --I think!
I have made the macropump.m1s in vb editor, there is just your code in that file, or should there be other code?

Tony

no no other code is needed.
you have to make sure,that macrupump is enabled in config -> General config.
if not enable it and restart mach.
Thomas
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #27 on: February 12, 2018, 06:06:33 AM »
  Yes I just need to check the wiring of the laser to amp and verify its output, I have already allocated a input.
can you explain
The top left figures (laser parameters) and how to use /set them?

  Regards
   Tony Horton

Offline TPS

*
  •  1,389 1,389
    • View Profile
Re: I Need a macro written will pay.
« Reply #28 on: February 12, 2018, 06:22:00 AM »
ok, we have the following things in the laser Parameters aeria:
laser raw value-> witch is the value comming from the analog Input (DRO 1000 regardin to the UC300 Manual)

multiplicator -> is the multiplicator to get mm from the raw value

actvalue -> is laser raw value * multiplicator

setpoint (the left one) -> is a known height whre you can "calibrate" the laser to your bed by putting the
laser to this known height an press the "set" button

act value with Offset -> is the result of all

setpoint (the right one) -> is just 1000.0 - setpoint (the left one) 


the main calculation is (see code for macropump):

        actmm = laser raw value * multiplicator
   act value with Offset = 1000.0 - actmm - Offset

i had to use this 1000.0 minus something, because the raw value will be bigger on a deep Point of your
bed then on a high Point.

so i had to reverse the measurement.

hope i could explain the idea in my bad englisch.

btw, after the laser is giving an voltage to the analog Input, the value in Parameter -> laser raw value should Change.

Thomas

 
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline comet

*
  •  315 315
    • View Profile
Re: I Need a macro written will pay.
« Reply #29 on: February 12, 2018, 06:24:10 AM »
Thanks Thomas,
  looking forward to getting it together.
  Tony