Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bfive on April 11, 2012, 03:37:36 PM

Title: Problem: Losing position if more than one axis wired up to breakout board
Post by: Bfive on April 11, 2012, 03:37:36 PM
Hi all,


My system:
I'm using Smoothstepper USB to a breakout board with step/direction servo drives. The machine is using ballscrews and linear bearings, no backlash compensation, very little friction/sticking in axis movement.

The problem:
I've been struggling with a mysterious loss of position with my machine. It is extremely bad such that I'll run some G-code for 20 seconds then send it back home, only to find it off of zero by an inch. It seems to only happen mostly to one axis, although sometimes I can readily see both X and Y positions off. Also, if I feed rate override to a lower speed (like 10%), it seems to exacerbate the problem, or at least make it more obvious. It's strange because I can run a lot of code at high speed (feedrate override 200%) and be off by less than if I ran the same code at a low speed (feedrate override 10%).

My troubleshooting:
I've swapped drives, swapped signal cables, fiddled with Mach3 settings, all without a good result. I think I may be on to something, though. Last night I tried disconnecting all the signal cables (enable, step, direction, GND) from every axis except one. With only one axis wired up, it seems that the problem goes away. However, once I connect another axis to the breakout board, the problem resurfaces. It doesn't matter if the drive is disabled in Mach, just the fact that the other axis is wired to the breakout board seems to induce the position loss.

Any ideas of the cause?

Many thanks!
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 12, 2012, 02:21:51 PM
Do you have shielded cables, especially for Step/Dir signals?
What kind of drives?
What kind of breakout board?
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Bfive on April 12, 2012, 07:17:59 PM
Hi Hood,

Thanks, for replying.
I have unshielded ethernet cables for step/direction, and realize that this could be a source of interference. I'm using the twisted pair of wires, one as signal, one as ground for each of my step/direction signals. I do have some shielded cable that I will try to test with. Should I ground the cable shield to the breakout board or to the drive side or does that not matter?

Also I'm using a really really old CNC4PC C10 breakout board. I think I got it sometime in 2005 or something, so it's a very early version. My machine has been sitting around most of the time since then, half-finished and only partially tested. Have there been problems with early versions of this board? I had some issues with lost position even when I used the parallel port at a low frequency. I also ordered a new breakout board to test or use wiith other projects.

Another question: do I need to power the breakout board with +5V? It seems to run with just the power from the parallel port, and I'm not running any relays or more power-hungry things from it (just step/direction/enable). Could I be creating a ground loop by powering the breakout board with a 5V power supply, which has a different ground from the 5V of the PC side? Sorry, my understanding is kind of vague. I've read a lot but not quite digested it all.

Thanks!
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: tripleblack on April 12, 2012, 09:23:30 PM
i would power the breakout board from the pc.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 13, 2012, 10:32:34 AM
Sorry dont have a clue about the CNC4PC BOBs, never used them, I would imagine it best to look up their documentation and see whats required. Regarding shields, you take one end of the shield and connect all grounds at a single point such as a stud in your control cabinet.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: tripleblack on April 13, 2012, 12:15:48 PM
just reread your post. yes, the c10 must be powered from the pc. either by tapping the usb port or just connect into an unused connector off the pc power supply. red 5v+ , black-. also the enable jumper on the board. i have 3 of these boards and have not had any problems.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Ya-Nvr-No on April 13, 2012, 09:42:55 PM
Just to see if it corrects the issue.
Have you tried turning on the rapid override on the settings page, and setting it to a lower value (try 100-150)? Not sure how fast your rapids are, but start limiting the rapids and see if you see results.

If it does that would suggest to me that there might be an issue with motor tuning.
When I tune one motor at a time they seems fine, but when they all start moving together they have issues. So I don't push the limits at tune, I shoot for 70-80% of max rate at tune.

Wish I had a better handle of the proper way to tune and use the max rate for motors.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: RICH on April 14, 2012, 06:43:34 AM
Quote
Wish I had a better handle of the proper way to tune and use the max rate for motors.

Can you post some specifics Ya-Nvr-No?
What kind of motors ...steppers or servos?

It would help me in a write up that I have been picking away at.

Bfive, hope you don't mind my post and don't want to highjack your thread.
Thanks,
RICH
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Bfive on April 18, 2012, 02:41:32 PM
Thanks for all the input guys,
I've played with motor tuning (now set very conservatively) and other software settings, but I think the issue was/is hardware. I got a new breakout board, powered from a separate 5V usb port (and 5V jumper enabled on smoothstepper). So I have one USB port going to the smoothstepper as signal, another USB port providing 5V power (all from the control PC). So far it seems to have resolved the problem. I've only done very limited testing, but it seems to no longer have a massive loss of position after a few moves. I'll update if anything else comes up.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 20, 2012, 07:30:30 PM
Hello Folks,

I am having a similar problem with a new 2 axis machine I am building. It is using Baldor servo motors with Microflex drives, a Smoothstepper and a C25 BoB plugged directly into the SS.  There is also a joypad plugged in which is used to jog the machine.

The motors have been tuned and the steps adjusted. If I tell the axis (via MDI) to move x10z5 everything is fine. If I then tell it, via MDI, to move back to x0z0, the z axis wants to move in the wrong direction and trips the limit. However, if I send it first to z0, it will go there and then x0 it will do that too. Seems strange.

If I use the joypad and the "jog to gcode" to record some motion, it gets completely lost and misplaces several inches on each axis!!

Any thoughts on this?

Thank you,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 21, 2012, 04:38:20 AM
Cant see how that would be but if you attach your xml I will see if I can replicate it here.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 23, 2012, 02:37:00 PM
Thanks Hood,

Sorry for the delay. I wanted to reload a few things, which I did, but still having the same issue.

xml file is attached...

Thanks again,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 23, 2012, 04:15:45 PM
Does the DRO show the Z moving in the wrong direction?
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 23, 2012, 04:31:49 PM
I have it setup to move the way it needs to for the process... minus X is toward the spindle centerline and minus Z is towards the chuck.

The xml I uploaded had the mill screen active, since the lathe screen doesn't have enough system adjustments. I am using the v2.0 joypad plugin which allows me to reverse the motion within the settings.

As I noted previously, if I use an MDI command the motion is okay, but the jog to gcode gives it alzheimer's.  ???

Thanks,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 23, 2012, 04:44:25 PM
Not sure I am following, you said if you commanded a X10Z5 move from MDI then commanded a X0XZ0 move, again via MDI, the Z would move the wrong direction but if commanding the Z first it would move correctly.
Is that correct? If so when you command the X0Z0 move via MDI does the Z show the wrong direction in the Z DRO?
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 23, 2012, 05:05:01 PM
Sorry Hood,

Since I re-installed the software, the MDI commands are working properly.

However, if I use the jog to gcode plugin, the system loses inches in both axis. Hope this makes sense.

Thank you,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 24, 2012, 04:42:19 AM
So when you are using the Jog to G Code plugin are you moving the axis via your keyboard to jog or is it a joystick or?
Do the DROs show the position its meant to be or do they show the distance the axis has actually moved?
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 24, 2012, 09:52:07 AM
The jogging is done using a joypad (Logitech).

I noticed this morning that if I move it one axis at a time, everything seems to be okay. If I move both axis simultaneously, which is something I need to do for the teaching process, occasionally there is some growling from the servos. It looks like there may be some lost travel during this growling and the servo drives both kicked a "following error" alarm today during one of these growling sessions. At that point, there was a lot of lost travel.

Davey Boy
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 24, 2012, 10:15:44 AM
Sounds like the first thing you need to do is get the tuning on the servos sorted as they should not be out from commanded position by very much at all or they should trip.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 24, 2012, 10:21:38 AM
I'm into the manuals now trying to confirm all the settings. I'll let you know what I find.

Thank you,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 26, 2012, 03:36:49 PM
OK, I confirmed that the servos are tuned properly, but there is something really strange happening...

Move one axis by itself and everything is good. They could move for hours individually and the readouts are correct.

It seems that the errors are occurring only when X is moving in the + direction and Z is moving in the - direction at the same time.

If I jog X in the + and then move Z +, no problem.
If I jog X in the + and then move Z - , Z moves less than the DRO shows.

If I jog Z in the - and then move X - , no problem.
If I jog Z in the - and then move X +, X moves less than the DRO shows.

 ??? ??? ???

Davey Boy
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 26, 2012, 04:36:12 PM
I see in your xml you have the motors on different ports, is there a reason for that?
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 26, 2012, 04:39:20 PM
It was just easier to wire that way.

Shall I move them to a common port?

Davey Boy
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 26, 2012, 04:42:19 PM
Its worth a try, might also be worth using normal pins like 2, 3 , 4 etc. Could be your BOB doesnt like it.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 26, 2012, 05:34:19 PM
I moved both motors to port 1... Z on 2+3 and X 5+6.  Seems to be the same issue.

Davey Boy
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 26, 2012, 05:58:11 PM
It does seem strange it is only in one direction. Are you using single ended step/dir signals? Have you got them shielded and grounded correctly if they are just single ended?
If the drives are not tripping then it would seem to suggest that the signals are not getting through correctly.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on April 26, 2012, 06:43:39 PM
The signals are single ended. 

I'll run through the wires again to be sure I haven't missed something.

Thanks,
Davey Boy.
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on April 27, 2012, 03:59:48 AM
I notice you have 4MHz set in SS for X and Z axis, your steps per unit and Velocity suggest you only require 422KHz or there abouts. Set the X and Z to 512KHz in SS plugin and all the other axis you are not using set them to 32KHz.
Hood
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Davey Boy on May 01, 2012, 02:07:47 PM
I found it Hood.

I thought the SS was grounded, since it had what looked like a jumper on the pins. However, after I spent MANY hours going over every possible ground or wiring potential issue, I decided to have a look at that ground point. When I removed the jumper (spacer?) I found it didn't have a connection between the pins. I replaced it with a jumper I had on hand and now it seems fine. Both axis move the way they should.

Now I just need to collect up all that hair I've pulled out and stick it back into my scalp.

Thank you very much for your help with this!

Davey Boy
Title: Re: Problem: Losing position if more than one axis wired up to breakout board
Post by: Hood on May 01, 2012, 02:15:29 PM
Good to hear its working now :)
Dont worry about the lack of hair, it doesnt hurt :)
Hood