Hello Guest it is January 18, 2020, 05:22:54 PM

Author Topic: How fast can you send G90 and get accurate feedback on the current XYZ position  (Read 1582 times)

0 Members and 1 Guest are viewing this topic.

Equipment: ESS ethernet smoothstepper

Option 1: I have a project where I need to send G90 commands to the CNC. The increments would be very small 0.019685".  How many G90 commands can i send in a second and how accurate would be the position reported back to Mach3 in that time frame?
I may need to adjust Z after each G90 command is executed so I need the exact X position at the time its processed.

Option 2: I'm at X=0, I send a G90 X10 command and I'm running at 60IPM. Will mach accurately report X current position as it traverses the 10"? If it will how often will I get that information back while its traversing that 10"?

I'm writing a remote control app that will use a laser displacement sensor (distance sensor) to measure distance  from the object in Z as the X axis moves. I need to know how often I can get accurate information back to match the current X and Y with the distance reported back by the  sensor.

Is the X and Y position calculated in Mach or reported back from the controller?

Thanks.

« Last Edit: August 19, 2018, 02:45:24 PM by stevesy »
Hi,

Quote
how accurate would be the position reported back to Mach3 in that time frame?

Mach is not a feedback control system. So you can send it a given distance, it will move that distance within the limits
of accuracy of the machine. The DRO will show the distance you programmed, not necessarily the distance actually
traveled.

You could attach a linear scale to the axis and have Mach monitor that. Mach3 would read a linear scale at the macro pump rate,
about 40 times a second. Mach4 would read it at the PLC rate, about 200 times a second.
My wife left with my best friend...
     and I miss him!
Hi,

Quote
how accurate would be the position reported back to Mach3 in that time frame?

Mach is not a feedback control system. So you can send it a given distance, it will move that distance within the limits
of accuracy of the machine. The DRO will show the distance you programmed, not necessarily the distance actually
traveled.

You could attach a linear scale to the axis and have Mach monitor that. Mach3 would read a linear scale at the macro pump rate,
about 40 times a second. Mach4 would read it at the PLC rate, about 200 times a second.

A linear scale? Do you mean a separate piece of equipment? - NVM, it is piece of equipment.
 
So no way to match up Mach's position with this sensor then. Is there a way to tell when the command is complete? So if I send a G90 command and know when its complete I could thne take a sensor reading then, and then issue another G90 command. If I can how many can I send in a second, 40 times?
« Last Edit: August 19, 2018, 02:54:53 PM by stevesy »
Hi,

Quote
So no way to match up Mach's position with this sensor then
Yes that can be done, but t is not as straightforward as you assume. I assume from
your reply that you cannot attach a linear scale? That would be the most direct and accurate solution.

Note G90 is a positioning mode, not a motion code. If you want to travel at max axis speed you use G0 or if you wish to travel at the current feedspeed,F,
then use G1.

You could issue a series of commands moving 0.01 say each time and measure/record the Z distance between each move. The speed at which that would happen
is dependent on the acceleration capability of the axis.

Craig
My wife left with my best friend...
     and I miss him!
Hi,

Quote
So no way to match up Mach's position with this sensor then
Yes that can be done, but t is not as straightforward as you assume. I assume from
your reply that you cannot attach a linear scale? That would be the most direct and accurate solution.

Note G90 is a positioning mode, not a motion code. If you want to travel at max axis speed you use G0 or if you wish to travel at the current feedspeed,F,
then use G1.

You could issue a series of commands moving 0.01 say each time and measure/record the Z distance between each move. The speed at which that would happen
is dependent on the acceleration capability of the axis.

Craig

I could attach a linear scale but I'm trying to keep cost down. Laser displacement sensors aren't cheap, so I already have a bit of investment in this project :)
Unfortunately I didn't think that Mach3 was not showing accurate position as it travels. In hindsight I guess I should have.

I'm more worried that the smoothstepper would be my bottleneck, if its just the acceleration of the axis then I think I would be fine. Unless of course I'm not seeing something I should again :)

Offline ger21

*
  • *
  •  6,291 6,291
    • View Profile
    • The CNC Woodworker
Mach3's display only updates 10x per second. If you are doing this from a macro, it's often a good idea to wait 1/10-1/4 second before reading the DRO to make sure it's accurate.
If I had to guess, I'd say there's no way you can send 40 moves per second.
Remember, Mach3 is a buffered system. Meaning the current movement has already previously been sent to the ESS. So there is some delay built into the system.

There are a few things that the ESS can do in realtime, like monitor home switches, and probing inputs.
But I don't think there's any chance that it'll do what you want.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
I guess joeaverage's idea of an encoder would work then. It's rack and pinion so maybe I can use a rotary encoder with arduino or something.

I can read the laser sensor at 50hz so even if I could get readings every 10th of a inch running at 60 IPM I could still get pretty accurate measurements.  I could just divide 1/10 of an inch into the 5 readings I get from the sensor. I would imagine it would be within 0.5mm accuracy on the position of X as it traveled that distance which is plenty for something like wood.

I guess the only real way to tell is do it. I'll report back just for fun after this weekend. I have the sensor and the means to measure it now. I'll write the code for the remote control over the next week and post my results from the test.

-Steve

Just a quick update....

I'm getting reports back about every 0.2" at 60 IPM in simulation mode. So basically 5 per second. Not good at all for what I'm trying to do.
I guess I'll go get an encoder and work with that.
Hi,
try Mach4 its about five times faster.

You're up against the fact that Windows and therefore Mach is not a real time system. Even if you could induce Mach to read a signal at a faster rate
Windows will take its own time, and if you don't like it....tough. Windows it not and has never had any pretensions as a realtime system.

Do you strictly need Mach? The reason I ask is that if you don't require the trajectory versatility that Mach and Gcode offer could you not use a microcontroller?
If I understand your application you require your machine to advance in one axis at a given speed while you record the Z depth at the same time.
I presume you end up with a file of data points (x,z).

Craig
My wife left with my best friend...
     and I miss him!
Yes I could use a microcontroller but I'm not familiar with sending commands to the CNC controller with anything other than Mach3. If you have a suggestion of where I could get a C# example of moving an axis with the smoothstepper that would be awesome. However, my understanding is the smoothestepper is running at 10hz, still too slow for the effort I would need to put into it I think.

Yes, you are correct. I'm basically going to do a raster running across X given a length and then stepping Y by say 0.5mm then scanning across X again getting Z with this laser displacement sensor that I can get readings from at 50hz (every 20ms).

I will use OpenGL to plot the data on the screen in a point cloud and build triangles for a mesh, then allow the user (Me) to save to an stl file. All that part is complete. Well, the prototype is complete. I can take a 2.5d point cloud and plot and save a mesh to a stl file. It's just getting the data accurately at the X/Y position where I'm a little stuck. I ordered a rotary encoder to hook up to the gantry so that should produce an accurate X position.
https://www.sparkfun.com/products/11102
IO https://numato.com/product/8-channel-usb-gpio-module-with-analog-inputs






« Last Edit: August 20, 2018, 02:31:12 PM by stevesy »