Interpolator PCB Design

Although we successfully prototyped a working quadrature interpolator, I can't really use a breadboarded circuit as part of my 3d printer.  Had the IC-NV been available as a through hole component I might have just thrown some perfboard into a project box, but the TSSOP-20 package is really looking for a PCB.  My previous experiences with PCBs all involve a frustrating toner transfer process that produced fairly ugly single-sided boards.  This will be my first attempt at sending a design out to be manufactured.

I basically just stumbled through a few EagleCAD tutorials and figured things out along the way.  The first step was to put together a schematic.  This is just the circuit from my previous post with a few more capacitors.

Next it's time to lay out the PCB.  The circuit itself is quite simple, but space restrictions kept things interesting.  I ended up redoing the design as I learned about proper PCB routing and settled on the following layout.

Finally I did a test fit using cardstock before sending it out to be manufactured.  Since the components I chose are so small, I decided to integrate the circuit into the connector.  This saves the space and trouble of preparing a project box.  The PCB slips between two rows of pins which means I had to specify a non-standard 0.8mm PCB thickness when ordering.

Overall, designing a PCB was both easier and cheaper than I expected.  The one drawback is that the low-cost fabs are all in China and shipping can take several weeks.  This part of the project will be on hold for quite some time until the boards arrive.


Brepo said...

Hi Ryan,
What is the purpose of the additional capacitors in this schematic- did the breadboard circuit have issues? Was the 10um capacitor (C5) capacitor left out of the breadboard version?

Ryan said...

The breadboard ran fine without the decoupling capacitors but I threw them in out of habit.

You want to be somewhat careful in this application because you are dealing with analog signals and servos can produce an incredible amount of EMI under load. For example you probably want the interpolator in a metal box.

I'm not an electrical engineer but I've had grounding/interference problems with other projects so I try to take the safe options.

Brepo said...

Hi Ryan,

I'm still working on getting the breadboard to work. I have the layout exactly the same as what I see in your images, and I've confirmed with the datasheets that everything looks right. When attached to a working motor and drive, I get an under-voltage fault, over-temperature fault, and motor commutation fault all at once.

Would you be at all interested in selling a set of your designed working interpolator cables, pcbs, or even just the design files that I could use for manufacturing? I'm at a semi-standstill here, but I'd also love to contribute to your project which has helped me immensely.


Ryan said...

Unfortunately its been a long time since I worked on these, and I don't actually have the files anymore.

From the faults you are seeing, it sounds like the drive 5V supply is shorting to ground, that is the most likely way for every feedback sensor to report an error.

Brepo said...

That's fully understandable, and thank you again for helping me out this long after you finished your printer! You were right, I didn't have the power wire correctly attached.
Did you use a default motor profile? When I use the 0.5 micron profile the motor does a bunch of jumping around followed by a tracking limit exceeded (stall) fault. I've tried playing around with the tracking limit and even matching it to the motor resolution, to no avail. My supply is only 24V, could that somehow be the issue?

Thanks again,

Ryan said...

The default profiles should be okay more or less regardless of supply voltage, but the resolution has to match.

Assuming your IC-NV configuration exactly matches mine, the servo profile I used is as follows:



Don't copy these directly, but if they are different from yours check the manual and try to figure out why. Small differences in things like current/power limits should be ok, but anything to do with encoder/mm or pole/mm needs to be exact.


Anyways, when testing the servo your process should look like this:

With the servo unpowered, type 1STATUS and check the location of the servo (PA). Move the servo by hand, and check its new position. Do this over and over to make sure it is registering both directions and returning to zero when it should.

Next power on the servo. Does it hold position or immediately run away? If it holds position, try to push it until the servo faults - it should consistantly fight you the whole way. Do this in both directions.

Finally you can attempt a programmed move. If the servo goes crazy then divide the gains by two. If the servo is very slow and hits a tracking error, either double the gains or increase the tracking limit.


You are probably close to getting this working. Once you know what step you fail on it will be easier to narrow down the problem, but it is probably that the encoder or commutation sensors are not properly configured for the motor poles.

Either the configured resolution is wrong; or the commutation wires are mixed up; or the IC-NV is not dividing at the rate you think it is.

Good luck, I know how absurdly frustrating this stuff can be.

Brepo said...

Hi Ryan,

Thanks for the in-depth tips. I've been trying to figure out which, of the issues you mentioned, it could be. My 1MOTOR profile is initially identical to yours, but after moving the motor manually I've found that the PA location gets lower and lower each full move, usually by a few thousand. When I was powering the motor it was immediately jittering and not holding- could this position issue be the root?

When I do the same manual movement test with the original interpolator or no interpolator at all, the positions match perfectly.

You're right, this stuff is absurdly frustrating. I don't know how you figured it all out considering how limited the resources are.

Thanks so much,

Ryan said...

Its good that you've found a concrete problem. The messed up position explains what you are seeing.

Ideally you would hook up an oscilloscope to the sine and quadrature side of the IC-NV and see what is going on, but even if you don't have a scope we can narrow down the issue.

Double check the circuit - Are the sine outputs terminated with a resistor? Are you using a differential driver to interface with the drive? Is the circuit well grounded?

Check for loose connections, be absolutely thorough with this. Sometimes breadboards can be unreliable.

Finally it is possible that EMI is interfering with the circuit, but this is unlikely with the drive unpowered. Are you testing this circuit next to a running microwave or something?

In short, since your circuit is half-working the problem is likely to be something really dumb that will only affect this particular setup. It might be worth taking it apart and putting it back together again if all else fails.

Brepo said...

I think I'll just re-make the entire thing on perfboard over the next few days so there is no question regarding the connections, and then secure it in a metal box as you mentioned earlier. Let's hope it works!

Brepo said...

It is now working! There were a few issues; not everything that should've been grounded was grounded, the A and B wires from one chip to the other were swapped, and the resolution pins of the ic-nv weren't properly soldered (and were therefore giving a 4X resolution instead of a 10X). That last one was especially interesting and required a deep dive into the ic-nv datasheet.
The next step for me is to test out how to properly control the motors with a CNC board or Arduino.

Thank you once again for all your help, Ryan!

Ryan said...

I'm really glad you got it working. Good luck with the rest of your project, and don't hesitate if you run across any more questions.



Email *

Message *