Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: bobskolnick on March 22, 2007, 12:44:02 AM

Title: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on March 22, 2007, 12:44:02 AM
Hello,

I posted a little while back on the Lazy Cam Forum that I am having problems with my Z-Axis drifting.  I thought the problem was mechanical but it wasn’t.  I have an old oscilloscope I am using to look at the signals but without a test plan I am just looking at pretty signals without knowing what to look for.  Does anybody have any suggestions?

Hardware & Software Specs:
Mach 3: Version R2.0.024
LazyCam: 2.00.032 Standard Edition

Computer: 2.53 GHz, 512 MB RAM
Drivers: Gecko G340 DC Servo
Motors: Brush DC Motor with US Digital Encoder
Machine: Homemade 3 axis Gantry CNC Router

Here is a copy of the Lazy Cam posting:

I have been having some problems with my Z axis.  I use LazyCam to import a JPEG and convert it to G-Code.  I load the code into the Mach 3 Controller.  About half way through the cutting process I notice that my cutter is no longer in the material.  It looks like the cutter has been slowly ramping in the positive Z direction.  If I look at the Z axis during the engraving process it is moving up and down the way I would expect, but it must be slowly incrementing itself in the positive (upward) direction.  However if I look at the Z axis DRO it is indicating a negative value which would seem to indicate that the cutter should be in the material.  Am I missing a setting? I am confused.  Any suggestions?

I am using the following software versions:
Mach 3: Version R2.0.024
LazyCam: 2.00.032 Standard Edition

Thanks.


Also here is a copy of the first  few lines of the G-Code

N45  G1 X5.4960  Z-0.0750  F60.00
N50  Y0.0160  Z-0.0671 
N55  Y0.0240  Z-0.0703 
N60  Y0.0320  Z-0.0662 
N65  Y0.0400  Z-0.0680 
N70  Y0.0480  Z-0.0703 
N75  Y0.0560  Z-0.0677 
N80  Y0.0640  Z-0.0653 
N85  Y0.0720  Z-0.0677 
N90  Y0.0800   
N95  Y0.0880  Z-0.0686 
N100  Y0.0960  Z-0.0668 
N105  Y0.1040  Z-0.0674 
N110  Y0.1120  Z-0.0653 
N115  Y0.1200  Z-0.0677 
N120  Y0.1280  Z-0.0653 
N125  Y0.1360  Z-0.0645 
N130  Y0.1440  Z-0.0688 
N135  Y0.1520  Z-0.0697 
N140  Y0.1600  Z-0.0671 
N145  Y0.1680  Z-0.0656 
N150  Y0.1760   
N155  Y0.1840  Z-0.0665 
N160  Y0.1920  Z-0.0677


Thank you.

Regards,
Bob
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: Brian Barker on March 22, 2007, 08:42:33 AM
Did you get the cable drivers for the US Digital encoders? I Have had problems in the past with noise on the encoder lines if I didn't use them (They are only about 10.00USD)
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on March 22, 2007, 09:14:14 AM
Thanks Brian, I will try that next.  Any other troubleshooting suggestions?
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: cybertek on March 23, 2007, 12:57:54 AM
I Think i Know what the problem is
The Multiplier Board on the G340
I have a same problem
Mine is set to 1X turns out on direction changes you can lose steps
You can By Pass the Multiplier board by removing it and putting a opto in its place
I Don't remember the PN3 but there is one the mx board for reference
it is soldered in though.
I Blew one of my drive by trying to hook up encoder shielding,
Forgot to power down and my ERR\RES jumper made contact with ARM+
Poof drive was assassinated!   Hope Marris can overnight a replacement
Will post back when i get my opto installed  (UPS please come soon)
You can test this out if you put a 20ms pause before a direction change
Marris is working on a MX Replacement board upgrade to fix this problem
based on some new fancy chip released

Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: cybertek on March 23, 2007, 09:40:23 PM
Got my opto's in today
fixed the problem
i repeated the same gcode 300 times
no more drift
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on March 27, 2007, 01:08:53 PM
Cybertek, Wow, how were you able to pinpoint it to the mulitplier board?  The funny thing is I don't even need the multiplier, I got it because at the time I thought it was a good feature that would provide some flexibility to my design. 

I can't even begin to tell you how many different tests I have done to try and find the problem.

Does the mfg of G340 post these design bugs anywhere?  Do you think they would be willing to swap the hardware if this is a design flaw?

Anyway I had some specific questions about your post

"You can By Pass the Multiplier board by removing it and putting a opto in its place
I Don't remember the PN3 but there is one the mx board for reference
it is soldered in though."

What is a:
- opto
- PN3
- mx

How do you remove the multiplier board?
Are there any rework instructions posted anywhere?
Rather than making changes to the driver hardware would it be easier to purchase the G320?

Thank you.

Regards,
Bob
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: cybertek on March 27, 2007, 02:42:25 PM
With lots of frustration but marris is the one that sugjested the solution
A G340 is a G320 the 340 has the extra Multiplier board added
Order HCPL2531-ND from Digi-Key or Gecko
pop the cover remove the multiplier board it 1x1 board
pop the opto in its place they cost 1.63 each
Your Problem is solved
Marris of Gecko is working on a upgrade board to solve this problem
but it is not a design flaw it is us pushing technologies to there limits
when i purchesed my drives i thought to this would give me more options
Turns out i should have used stepers insted for my application
but i thought servo drives were the Hot Items of the industry

Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on March 28, 2007, 02:28:42 AM
Thank you very much for the info.  I have spent the last several months and several hundreds of dollars (new cables, new couplings, etc.) trying to fix this problem.  You may have saved me from pulling my hair out and several more dollars and hours of troubleshooting.

I wish this was disclosed up front!  It is not a big deal so long as you know about it.

I ordered the parts from digikey but I would still like to exchange them for the G320 just in case any new bugs are discovered I know I am working off a known design configuaration rather than having modified it myself.  I am very conservative when it comes to tracking design changes.  I have been burnt before:-)

Last question.  How do you know which way to plug in the opto or does it matter?

Thanks again for the help.  I REALLY appreciate it.

Regards,
Bob
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: cybertek on March 28, 2007, 12:39:44 PM
Look at the opto on the Multiplier Board
Same as that one is placed

or

close to the Dir connector
look at the drive with the connection terminals facing you

                           . . . .
                           . . . .
                    pin1 '

0 0 0 0 0 0 0 0 0 0 0 0
                        dir step Com


Hope this helps
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on March 29, 2007, 01:15:11 AM
Well I contacted sales at gecko and they basically said the same thing you suggested.  That is, pull the daughter board and insert the opto, which they offered to send me for free.

When I get this done I will come back to the post and let you know if it solves the problem.  I hope so!

Thanks again and your directions are great, thanks for the help.

Regards,
Bob
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: bobskolnick on April 15, 2007, 11:57:49 PM
Just to wrap things up, I pulled the daughter board and inserted the opto.  I also had to swap the common ground to common 5V on the drivers which was a small hassle.  The problem was solved!!!!

I still can't believe that there isn't disclaimer about this limitation.  I mean Gecko must know people use their drivers for CNC routers and I can't be the first customer that had this problem; so why not step up and say something?

Well thanks again.

Regards,
Bob
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: Mariss on April 16, 2007, 10:51:54 PM
OK, I'll step up and say something.:-)

1) Application: The G901/902 was designed originally to fill our OEM customer needs that had legacy full-step and half-step controllers, proprietary and PLC mostly, yet wished to take advantage of the smoothess microstepping drives offer. The vast majority of these applications are point-to-point at best and are embedded in the machinery they control. The are not CNC applications and they certainly aren't constant velocity (CV) CNC applications. The G901/G902s met and still meet their needs to a tee.

2) The problem: People in the CNC community started using the G901/G902s in CNC CV applications and they are singularly unsuited for that purpose. The G901/G902s synthesize 1,2,5 or 10 pulses for every received step pulse. If full-step mode is selected, 10 synthesized pulses are sent to the base 10-microstep drive, it emulates a full-step drive and everything works wonderfully. The problem is the multiplier is not not psychic; it can issue the 10 synthesized pulses only after it has received an input step pulse. This can take 50mS to complete (10 pulses with a spacing of 5mS between each pulse). If the direction is changed during that 50mS, some pulses will be in the correct direction, the remainder will be in the wrong direction. The result is a 'drift' in the accumulated axis position during CNC CV motion. Non-CNC, non-CV applications have a dwell time after each motor move so this is of no consequence.

a 3) The solution: Design a 4-quadrant pulse multiplier. The G901/G902s use CD4000 and 74HC series logic and not a whole lot can be packed onto that board using that solution. Unfortunately a 4-quadrant multiplier requires a whole lot more logic. Enter the CPLD (complex logic programmable device). This is a tiny (5mm or 0.2" square IC) $1 part that packs the logic equivalent 200 or more 74HC ICs inside it. The G203V drive is our first foray in using CPLDs in a motor drive. It gave me the luxury of designing a perfect step motor drive when the amount of logic required is no obstacle. Having done so makes me wonder how I ever did without CPLDs.

I ran-off a quick 4-quadrant CPLD-based multiplier design prototype board. It uses the same position error accumulator our G320 servodrives use and they are certainly error-free. The design requirements for a 4-quadrant multiplier have a more than passing resemblance to what's required for a PID servo.  It will be a step pulse multiplier that cannot be spoofed by any CNC CV application.

The prototype board is much smaller (1.2" by 0.8" or 30mm by 20mm). I'm getting double-duty from it because it also will be a test vehicle for 0603 parts, QFN packaged CPLDs and new 6-mil  (0.15mm) design rules. That the multiplier will work as expected is a given; rather it will be a manufacturability test-bed for more compact circuitry. Circuit components will be more than 3 times smaller now (0603 vs 0805).

The test-bed part is important. If it works OK then circuit real-estate shrinks to 40% of present size and the 4-quadrant pulse multiplier circuit gets incorporated on a future G203V board at no increase in price. It will cost a little less than the G210 and far less than the G212 if you are familiar with our drives. The 4-quadrant multiplier will have a brief career as a G903 to service the 3,000-some G203Vs out there. It will have a longer career as a G904 to replace the G901/G902s.

Hope this long post helps explain why we are where we are and where we are headed. There are a lot of things afoot including the G320 which gets the 'CPLD treatment' late this summer.

Mariss

Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: Chip on April 17, 2007, 02:05:15 AM
Hi, Mariss

Will increasing the step & direction pulse length in Mach3 help dampen this issue some, not sure of the actual max values, there seem to be 2 places this can be set, Motor Tuning and Ports & Pins, maybe up to or more than 15 us.

Just reading through some posts tonight, Have used your drives, stepper & servo, None with micro-step option though.

Thanks, Chip
Title: Re: Z Axis Drift Problem...Losing Counts on a Servo System?
Post by: Mariss on April 17, 2007, 12:19:16 PM
No. The step pulse width set in motor tuning is microseconds wide while the dwell time is 50 milliseconds, a time period 10,000 times longer.

Mariss