Hello Guest it is April 18, 2024, 08:48:28 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zoidberg1977

Pages: 1
1
General Mach Discussion / Mach DRO freezes, motor moving
« on: August 24, 2010, 03:38:40 PM »
Hello all,

I have a quite weird problem. I'm using a VB macro to compensate my backlash using linear encoders.
If an axis changes direction, I use the following code to detect when the encoder starts to move (backlash compensated).
Lets say the actual position is x=100mm and the next move goes positiv, then move x-axis until encoder
is at 100.05mm (position_stop) -> backlash in positiv direction compensated.

dooembutton(307) 'jog x-axis positive
Do While GetOEMDRO(208)<position_stop
Loop
dooembutton(334) 'stop jogging of x-axis

This works quite OK, but sometimes during the move the main Mach3 X-axis DRO (oemdro(800)) as well as the encoder
DRO (oemdro(208)) freeze shortly but the motor continues moving. Then after two or three seconds the DROs work again,
but then the total movement was already too big, e.g. not 0.05mm but 0.6mm. This happens totally random
(20 backlash compensations are OK then it happens one time and afterwards it is OK again).
Maybe it has something to do with the GetOEMDRO(208) function, but this would not explain the freezing of the
Mach3 main x-DRO I think ????

Does anybody have an idea????

My computer is a laptop with Pentium 4 CPU with 2.8GHz and about 800MB Ram (200MB or so are stolen by the graphics card,
shared memory). I heard that problems might arise using laptops because of some energy saving features. But I'm
not sure if this has something to do with it because of the random nature of the problem.

I hope somebody can help..
Greetings Thomas

2
VB and the development of wizards / Encoder position to Mach3 DRO
« on: July 21, 2010, 10:21:34 AM »
Hello everybody,

I have a rather simple question (at least I think so) but this problem is driving me nuts for hours now >:( >:(
I have linear encoders mounted to all three axis. I want to update Mach3 DROs with the encoder postions.
I have written a small VB programm that gets the encoder position by "getoemdro(29)" for the x-axis.
Then I do a "G92" command with this position, so that it updates the x-Mach3 DRO. But this command also changes
the position of the encoder (on the settings page of Mach3) what it shall not do !!!!!! >:(
The encoder position shall remain as it is, so that both Mach3 DRO and Encoder have the same position.
I also tried to change the encoder position after the G92 command back to its original value by "setoemdro(29,value)".
Also no success, Mach3 always adds some stupid offsets or something like that so that the encoder value is not correct.
I also tried to use just Setdro(0,"encoder position") without the G92 command, but this also changes both values (the Mach3 DRO
and the encoder position on the settings page).
I also used the button "to dro" on the settings page near the encoder DRO. This updates the Mach3 DRO nearly correct (there is always a
difference of about 0.005-0.01mm) but it seems that the new value is not really used. When I do a G1 command to a new position afterwards it does not
use the new updated position but the old position. So the updated value is displayed on the Mach3 DRO but internally it works with the old value.

If anyone knows a way to change the value of the Mach3 DRO to a new value from the encoder (e.g. G92 command) without affecting the Encoder position itself please help!!

Greetings
Thomas


3
Hello again,

yes I tried the normal backlash compensation but the problem is that the backlash is different for different positions
lets say on the x-axis (e.g. at x=0 it is 0.2mm and at x=300 it is 0.3mm).

But I think I have got a workaround for my problem. I use the already mentioned DoOEMButton(250) which disables
the x-axis movement directly when the encoder starts to move. I have now splitted the move command (G01 X1 F6)
into several smaller movements, lets say steps with 0.2mm distance and the next command is only executed when the encoder
has not moved. So each Gcode command is executed completely and I do not have to stop. When the encoder has moved for about 0.03mm
the backlash is compensated and I use the "Encoder to DRO" button to update position to the Mach DRO.

In this way it takes about 2-3 seconds before the backlash compensation is completed and the normal gcode programm is continued.
It is not optimal but if there is no other way to interrupt a running gcode command I think it is the only option.

Greetings
Thomas

4
Hello everybody,

i have wirtten a macro to compensate for backlash of my x,y,z spindle (trapezoidal thread).
On every axis I have a glass scale encoder which gives me the correct position of each axis.
What I'm doing now is checking (before a gcode execution) if the direction is changing.
If so I do a Gcode command in the corresponding direction with travel distance 1mm and feedrate
6mm/min (G01 X1 F6). Inside the "do while ismoving loop" I'm checking if the corresponding encoder
is moving (which is not the case as long as the backlash distance is not reached). When the encoder
starts moving the backlash is compensated and I exit the "do while ismoving loop".
After the loop I do a stop with DoOEMBUTTON(1003) to not move the axis any further (onyl backlash
compensation). And last but not least I update the Mach3 DRO with the actual encoder position, and also
do a G92 command with the position from the encoder.

The problem is that the DoOEMBUTTON(1003) terminates the VB-Script, what it shall not do  >:(.
I also tried using DoOEMBUTTON(250) which disables x-axis movement to stop directly when the encoder
starts moving. This works without terminating the script, but the further script execution is halted until
the Gcode execution (G01 X1 F6) is finished, which takes some time because the movement is very slow.

Does anyone know a way(trick) to use DoOEMBUTTON(1003) without terminating the VB-Script?
Or another way to interrupt and cancel a running Gcode command from a visual basic script without terminating the script itself?

I'm searching in the forum for two hours now and could not  find anything  :-[...please help

Greetings
Thomas

Pages: 1