Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: comet on January 31, 2018, 02:53:22 PM

Title: I Need a macro written will pay.
Post by: comet on January 31, 2018, 02:53:22 PM
Hi ,
     I want to connect a measuring laser to mach3 to be used in a bed of nails type scanner rather than nodding the "Z" axis up and down mach would read the output of the laser .
I'd be happy to pay for the work and any electronics needed to interface. I'm in the UK.

 Tony
Title: Re: I Need a macro written will pay.
Post by: rcaffin on February 01, 2018, 05:46:23 AM
Writing a macro is not hard, but setting up the optics and electronics for the laser is going to be $$$.
You will need someone very local.

Cheers
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 07:47:47 AM
Well I have a keyance measuring laser which will output some industry standard communication via its amplifier, so I guess that's a good start!
Tony
Title: Re: I Need a macro written will pay.
Post by: TPS on February 01, 2018, 09:39:08 AM
Hi,

can you post type and maybe Manual of that keyance laser.
then we will see.

Thomas
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 10:31:02 AM
Hi Yes the sensor is a keyance il300 .

Tony
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 10:33:17 AM
And the amplifier a il1000 not sure how you upload the specsheet but its all available on keyances site
Tony
Title: Re: I Need a macro written will pay.
Post by: TPS on February 01, 2018, 11:14:18 AM
ok,
had a quick look on Keyence Hompage

il300 has range from 160 to 450 mm
il1000 can have following Outputs

±5 V, 1 bis 5 V, 0 bis 5 V Ausgangsimpedanz 100 Ω*1
4 bis 20 mA, Max. Lastwiderstand: 350 Ω*1

so first question, witch type do you have ?
second question, what Hardware (BOB or Motion Controller) do you use, to see how it could be connected.

Thomas


Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 12:36:48 PM
  Thomas thanks for your interest I do appreciate it.
   The motion controller is a uc300 usb  from cnc drives,
the IL 1000 im not so sure on as I cant see any referance to type of output.
there is a pin out list on it but it just says analog out ?
serial number is:
#f2f211308 if that helps?
maybe you can set it for volts or amps? via its menu?

  As an aside I have quite a bit of experiance building electronic circuits and messing with pics and ardueno's if that helps

Regards
  Tony
Title: Re: I Need a macro written will pay.
Post by: TPS on February 01, 2018, 12:48:35 PM
Tony,
the uc300 Sounds good, it has 2 analog Inputs 0-10V.

tryed to download the Manual for the il1000, had to registrate to
get it, but registation is not veryfied till now.

i will come back here as soon i have the Manual.

can you please describe what you exactly want to do with this sensor.

Thank you Thomas
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 02:00:52 PM
Thomas,
    the plan/experiment is to be able to take lasers output and replace the z axis position in the digitizing program.
 You would zero the X&Y as usual through mach on the servos, but z would just be there as a bracket to hold the laser it does not move,apart from initial set up to zero the laser.
The laser would be zeroed on the bed of the machine or another conveniant known point, that could also be the highest or lowest point on the job to be scanned.
obviosly if you zero the laser on the bed or lowest point you would zero close to its maximum sensing distance, and vice versa.
  So if you put a say 25mm block under the laser it would read +25mm on the output of the laser, and so on.
You would run a digitizing program very similar to and possibly based on arts program, but instead of the z axis going up and down "probing" at every step,
 the laser would be triggered or read at each x-y position and then that figure would be put into
the digitizing points cloud file as the z cordinate.
    This would increase the scanning speed immensly but still retain high accuracy.
Hope that makes sense ?

Regards
 Tony

   Thanks again for your help
   Tony
Title: Re: I Need a macro written will pay.
Post by: TPS on February 01, 2018, 02:33:09 PM
Tony,
still got not Response from Keyence for the manual.
i think i will have a phone call tomorrow.

Your "project" with this laser sound's like an new "Challenge", but if you want i am
in this Challenge.

let's start (but when i think about it, we started allready ;))

Thomas
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 02:57:52 PM
Thats great Thomas,
   I dont know if this has even been done before. could be new ground were treading on.
Are you proficiant with software writing? if not then we will need someone else for sure.
  ill try and download the full manuals as well although i cant promise ill understand them!

Regards
  Tony
Title: Re: I Need a macro written will pay.
Post by: Overloaded on February 01, 2018, 03:07:40 PM
Interesting project Tony, I'll be following along intently.  :)

There is a bit of info in this catalog, in case you don't have it.

Regards,
Russ
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 04:10:22 PM
cheers OL yes ive tried using a laser proxy sensor mounted on a high speed z axis but although succesfull and accurate, it is still a time consuming process.
hopefully we can get to grips with the hardware/software in this method because i feel that the bed of nails method of scanning/digitizing is superior when it comes to accuracy to other
systems, certainly systems that are within the scope of the home machinist .

Regards
Tony


Title: Re: I Need a macro written will pay.
Post by: Chaoticone on February 01, 2018, 06:41:13 PM
If your interested in trying it with Mach4 I posted a teach file script for it not too long ago that may get you almost where you want to be. Would just need to get the register value you will be using for the analog input from the laser instead of Z axis position And automate some moves between readings I think.
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 07:12:12 PM
Chaotcone , yes I would be but that is the sort of stuff that is presently beyond me, but hopefully not for others.Do you have a link?

Tony



Title: Re: I Need a macro written will pay.
Post by: Chaoticone on February 01, 2018, 08:34:40 PM
I don't have a link handy but you can search this forum for Mach 4 Teach File and find it pretty quick I think.
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 09:51:57 PM
Ill have a look, but on reflection I dont think i want to be messing about with mach4 right now, as well as trying to get this project working, atleast if I dont have to.
Title: Re: I Need a macro written will pay.
Post by: comet on February 01, 2018, 10:03:09 PM
Found the laser manual ive attached it
Title: Re: I Need a macro written will pay.
Post by: TPS on February 02, 2018, 03:17:32 AM
Hello Tony,

according to the Manuals i would connect the laser like this (if the UC300 has a external 5V supply)

il1000 Brown uc300 anaolg plug pin1 -> 12V
il1000 Blue uc300 anaolg plug pin2 -> 0V
il1000 orange uc300 anaolg plug pin3 -> analog Input1
il1000 shield uc300 anaolg plug pin5 -> gnd

(if the UC300 has no external 5V supply)

il1000 Brown external power supply -> 10-30VDC
il1000 Blue external power supply -> 0V
il1000 orange uc300 anaolg plug pin3 -> analog Input1
il1000 shield uc300 anaolg plug pin5 -> gnd

and if i understand UC300 Manual we should get a value in OEMDRO(1000)

but you have to do this from the il1000 Manual:

"3-1 Operation When the Power is Turned on for the First Time" (page 3-2)
"3-3 Initial Reset (Initialize)" (page 3-8)

as well.

Thomas







Title: Re: I Need a macro written will pay.
Post by: comet on February 02, 2018, 04:25:05 AM
Cheers Thomas I shall have a play with that later today on the bench.
Title: Re: I Need a macro written will pay.
Post by: TPS 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
Title: Re: I Need a macro written will pay.
Post by: comet 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 !
Title: Re: I Need a macro written will pay.
Post by: comet 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
Title: Re: I Need a macro written will pay.
Post by: comet 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
Title: Re: I Need a macro written will pay.
Post by: comet 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
Title: Re: I Need a macro written will pay.
Post by: TPS 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
Title: Re: I Need a macro written will pay.
Post by: comet 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
Title: Re: I Need a macro written will pay.
Post by: TPS 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

 
Title: Re: I Need a macro written will pay.
Post by: comet on February 12, 2018, 06:24:10 AM
Thanks Thomas,
  looking forward to getting it together.
  Tony
Title: Re: I Need a macro written will pay.
Post by: comet on February 24, 2018, 12:41:36 PM
Can I just give a massive public thankyou to Thomas for his help in getting this project up and running,thank you. what a gent !

Tony
Title: Re: I Need a macro written will pay.
Post by: Chaoticone on February 24, 2018, 09:19:14 PM
 :)