Welcome, Guest. Please login or register.
Did you miss your activation email?
August 23, 2017, 06:48:27 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  General CNC Chat
| |-+  Share Your GCode
| | |-+  Stringing MDI Instructions together
Pages: 1   Go Down
Print
Author Topic: Stringing MDI Instructions together  (Read 1989 times)
0 Members and 1 Guest are viewing this topic.
willower
Active Member

Offline Offline

Posts: 8


View Profile
« on: January 09, 2017, 03:15:49 AM »

I have a small Machine (600mm X 300mm) on which I use an XBox controller as my pendant. I also have a laser crosshair (vitually identical to the Tweakie setup) which I use to position the X and Y axes for the progarm start point.

Trouble is, I have the pendant configured to prevent diagonal moves - this because I find it a lot easier to keep to straight X or Y moves to get me close to the required start point. I can then 'jog' at slow speed to get me right over the start point i require - again using the pendant.

However, when I use the 'Tweakie' macro to move the cutting head to the required start point, Mach3 seems to have great difficulty in deciding which X or Y move to make to get me there. The motors make a lot of weird noises but do eventually get me to the right point. It seems like it struggles to do it smoothly as one continuous move.

I would prefer to do the moves singly (rather than a diagonal) as I dont want to change the configuration on the pendant for the reasons already stated above.

I admit to being absolutely useless with VB in Mach3 - its like it's written in Chinese to me, just can't get my haed around it at all, I find the whole VB thing a bit of a black art!

However, I can (just about) get the result I am looking for via the MDI Line instructions - providing I concentrate.

My thoughts are that I would like to string together two lines that I use via the MDI to make the moves required but with some sort of  'WAIT' instruction between the lines so that they dont both happen concurrently - and attempt this diagonal movement again.

Can someone possibly point me in the right direction with this?

Many thnks if you can....
Logged
Tweakie.CNC
CNC is only limited by our imagination.
Global Moderator
*
Online Online

Posts: 6,709


Super Kitty.


View Profile WWW
« Reply #1 on: January 09, 2017, 04:39:40 AM »

Quote
I would prefer to do the moves singly (rather than a diagonal) as I dont want to change the configuration on the pendant for the reasons already stated above.

I admit to being absolutely useless with VB in Mach3 - its like it's written in Chinese to me, just can't get my haed around it at all, I find the whole VB thing a bit of a black art!

In my macro try replacing the single line;

Code "G91 G0 X" &Xmove & "Y" &Ymove ' Makes an incremental move the distances that you set

with;

Code"G91 G0 X" &Xmove
While IsMoving ()
Wend
Code "G0 Y" &Ymove

This should then perform the axes moves seperately.

Tweakie.
Logged

Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
willower
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #2 on: January 09, 2017, 05:34:08 AM »

Many thanks Tweakie - I'll certainly be giving this a try...
Logged
willower
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #3 on: January 10, 2017, 02:21:48 AM »

OK, I've modified the code as suggested and, yes, it now moves as I would like it to. However, it still sounds lile the X and Y steppers are fighting with each other while the moves are being made.

When I make a 'straight' move using the controller joysticks, the move is as smooth as silk. But when I invoke the Macro via the Xbox Controller button, the motors seem to 'stutter' into position, not smoothly as I would expect.

Any ideas why this shold be? Huh
Logged
willower
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #4 on: January 10, 2017, 02:41:33 AM »

Just a thought, this is the code I am using at the moment - just so you can see if I have made any mistakes?

Xs = GetOemDRO(59) 'X-Scale DRO

Ys = GetOemDRO(60) 'Y-Scale DRO

Xmove = -1.5386 * 1/Xs 'Move distance adjusted for X-Scale factor

Ymove = 1.0863 * 1/Ys 'Move distance adjusted for Y-Scale factor

DeActivateSignal(OUTPUT5) 'Turn off laser

Code"G91 G0 X"  &Xmove
While IsMoving ()
Wend
Code "G0 Y"  &Ymove
While IsMoving () ' Waits while that happens

Wend

Code "G90" 'Goes back to absolute moves

DoOEMButton (1008) 'Zero X-Axis DRO

DoOEMButton (1009) 'Zero Y-Axis DRO

Logged
Tweakie.CNC
CNC is only limited by our imagination.
Global Moderator
*
Online Online

Posts: 6,709


Super Kitty.


View Profile WWW
« Reply #5 on: January 10, 2017, 02:44:23 AM »

I suspect that if you run the macro from an on-screen button your motors will run smoothly (as intended) so the problem lies with the communication between the XBox controller and Mach3 which is basically being asked to run two macro's at the same time. There may be an easy way around this but I will leave that to someone who is more familiar with the XBox related plugin.

Tweakie.
Logged

Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
willower
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #6 on: January 10, 2017, 03:10:43 AM »

Great answer, had never really thought about it that way.

Sounds to me that you are about right with this, as you say, there is bound to be a little confusion if it is actually running two macros concurrently.

Why didn't I think of this?
Logged
Machinehead57
Active Member

Offline Offline

Posts: 47


View Profile
« Reply #7 on: June 25, 2017, 05:37:09 PM »

Your machine and drawing should reference a X0,Y0 corner or certain spot on the sheet. That way you would line up on that point zero x and y then run. Your gcode should carry you to the starting point of the cut.
Logged

I have this ultimate set of tools I can fix it.
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!