spindle encoder

This Section is for users to discuss hardware

Re: spindle encoder

Postby cncdrive » Sun Dec 25, 2016 6:28 am

Take a look at these encoders: http://www.cui.com/product/resource/amt10-v.pdf
These are capacitive encoders with adjustable resolution.
You can set the resolution to different values with changing the micro DIP switches inside the encoder.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: spindle encoder

Postby mccafferty » Sun Dec 25, 2016 2:03 pm

Wow, thanks to spumco and cncdrive for taking the time for such complete responses. Much clearer now.

I had a couple thoughts.... I have extra ports on the UC300ETH-LPT5. I could use one of those ports just for encoders (I have two since my machine is a combination machine). Either a high speed breakout or maybe direct. Since the encoder cable is short and shielded and it's 5V powersupply is the same as the UC300, there shouldn't be groundloops.

Also, just in case, I snagged this from ebay. http://www.ebay.com/itm/332009702192
mccafferty
 
Posts: 22
Joined: Tue Nov 29, 2016 7:01 pm

Re: spindle encoder

Postby spumco » Tue Dec 27, 2016 5:22 pm

My spindle encoder is now installed and functioning, more or less.

Encoder is a Photocraft HS-20 100PPR model, with A/B/Z quadrature signals. 5-26VDC differential line driver output circuit with the A+/B+/Z+ signals going to my VFD, and the A-/B-Z- signals going to my breakout board as inputs to UCCNC.

My motor pulley is 54 teeth and the spindle is 36, so I've had to set the pulley ratio in UCCNC to 0.75:1. Setting it to 1.5:1 resulted in some hair pulling on my part. Duh.

My next questions for CNCDrive:

1. The commanded (Sset) speed doesn't match the displayed (Sact) speed. At Sset = 1000Rpm, Sact = 1170Rpm. I thought UCCNC would adjust the PWM to bring the actual speed closer to the commanded speed. Do I need to adjust the trim pot on my spindle control board, or does it not matter because for rigid tapping UCCNC will base the Z-axis motion on the Sact and not the commanded speed?

2. The Sact speed doesn't match the measured spindle speed. Using a strobe tachometer on the spindle, there is a difference of about 150Rpm. For example, if I set Sset = 3500Rpm, Sact = 4069Rpm, but the strobe measures 3917Rpm. Any idea, aside from the strobe not being accurate, why there is a difference between displayed and measured spindle RPM?

Thanks,
Spumco
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: spindle encoder

Postby mccafferty » Tue Dec 27, 2016 6:11 pm

Hmmm.... I would think the x+ & x- would have to go to the VFD +/- input and then parallel your breakout board on to that
mccafferty
 
Posts: 22
Joined: Tue Nov 29, 2016 7:01 pm

Re: spindle encoder

Postby spumco » Wed Dec 28, 2016 12:20 am

Mccafferty -

The "+" and "-" are differential signals. A+/A-, B+/B- and so forth.

They are usually sent to a receiving device that will take differential signals and combine them in to a single signal internally. They are used because they make the signal much more resistant to interference from outside RFI/EMI - such as the noise VFD motor power conductors.

A related technique for minimizing interference is using twisted pair wires.

In my case, the encoder cable is short and shielded, and the VFD wires are in metallic conduit and separated from the encoder cable. The A-, B-, and Z- are split off from the "+" wires in an enclosure separated from the VFD and go to the BOB. These three signals form a complete 'single-ended' signal group which can be used by the BOB/ETH400/UCCNC.

The other signal half is A+, B+, and Z+ and those are sent to the VFD. Both the VFD and BOB are restricted to single-ended signals as they don't have the circuitry to accept differential signals.

Some VFD's do. As an example, the Automation Direct GS3 line has an optional feedback card. If you poke around on their web site, you'll see that the card has inputs for differential signals.

You can also purchase converters which will take a differential signal and convert it to single-ended and vise-versa. Use a single-ended encoder output, convert it to differential and run the cable all the way across a factory to a remote PLC where it's converted back. Less chance of interference across the long run if the bulk of the transmission line is differential.
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: spindle encoder

Postby spumco » Wed Dec 28, 2016 12:34 am

CNCDrive,

So I've been fiddling with the settings all day, and while my earlier questions still stand, it appears that after tuning the trim pot on my spindle control board and adjusting all the settings I can in UCCNC, there is still a significant difference between set speed, reported actual speed, and measured spindle speed.

One thing I noticed was that the encoder PPR needed to be set to 200PPR. My encoder is advertised as 100PPR, but maybe this is a cultural difference in the definition of "PPR." Perhaps because both A & B signals each have 100PPR the software expects a setting of 200PPR in the configuration.

Changing this setting gets the Sset and Sact speeds close enough to each other, and they are very close to the speed reported by the VFD (which is using the same encoder signals in flux vector mode).

The remaining problem is that the spindle is exactly 1.5x faster than both the Sset and Sact speeds. If I command 2000RPM, Sset shows 2000Rpm and Sact shows 2112Rpm - close enough. But the spindle is turning at 3000Rpm.

Pulley ratio is set properly (0.75) and enabled. No combination of adjustments results in Sset, Sact, and measured speed being close.

Thanks again for the help
-Spumco
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: spindle encoder

Postby cncdrive » Wed Dec 28, 2016 1:03 am

PPR means pulse per revolution, if your encoder has 100PPR resolutions means that one channel of your encoder will make 100 pulses per revolution,
however there are channel A and channel B, so the 2 together will make 200 pulses.
Furthermore the encoder is counted in quadrature mode which is the way how 99% of how servo drives are also counting, because it gives the highest possible resolution from the encoder.
Quadrature mode means that the A and B channels' rising and falling signal edges are also counted and since one pulse is formed by one rising and one falling edge that will give you 400 counts on the two channels per revolution in total. So, if your encoder has 100PPR resolution then the encoder has 400CPR resolution when counted in quadrature mode and that is how the UCCNC is doing it.

The spindle speed problem you described should be a totally separate thing, because the UCCNC does not control the spindle based on the encoder speed.
Do you control your spindle in PWM mode?
How the UCCNC controls the spindle in PWM mode is that you setup a minimum and maximum RPM range and you also setup a minimum and maximum PWM duty cycle.
The minimum RPM will then equals to the minimum PWM and the maximum RPM will equals the maximum PWM output and the midway values of programmed RPMs will be proportional in between.

And the pulley ratio setting will multiply the Sact only, for example if your spindle is running at 2000RPM and your pulley ratio is 0.5 then the Sact will read 2000RPM*0.5 = 1000 RPM.
And when enabling the pulley ratio you can have different min. and max. spindle velocity ranges, because the different pulley ratio will change your RPM range at the same driving motor velocity,
so when the pulley ratio is enabled then the UCCNC gets the min. and max. velocity values from the pulley settings slot you selected and will adjust that to the min. and max. PWM values as described above.

And when you cutting threads or doing rigid tapping then the not perfect spindle speed is not a problem, because the syncronisation is done to the spindle actual speed and position measured by the encoder,
so if you program e.g. 200 RPM, but your spindle is running at 190 or 210 will still make a perfect pitch on the thread or tap. (ofcourse I'm assuming here that the bit lower or higher speed will be still inside of the RPM range which will be OK for your tapping tool or lathe knife on the particular workpiece. In other words I'm saying that electrically and programmatically the thread or tap pitch will be still made to what you programmed.)
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: spindle encoder

Postby spumco » Thu Dec 29, 2016 6:57 am

We're in business!

(CNCDrive: answering your earlier question - yes, my spindle is PWM controlled)

After reading the reply about 10 times and fussing with the Min/Max RPM and PWM duty cycles, the spindle Set speed, reported (Sact) speed, and measured speed are extremely close. Set speed and measured speed are within 0-10 RPM of each other from 200-7400RPM.

Sact is off by about 20RPM across the range. For some reason, changing the encoder PPR from 200 to 208 resulted Sact and measured speed being much closer. At 200PPR the deviation was about 100-150RPM higher than measured. At 208PPR the deviation is more like 10-20RPM. No clue why, as I'm using a timing belt and I can see no reason why the encoder (and UCCNC) would report a different speed than measured if the PPR was set per the encoder dataplate.

I'm confident that the measured speed is accurate as I'm now using both a strobe and a photo tachometer and they're within 1RPM of each other at every speed. Not that I care at the moment, but we'll see if my 'fudge' has any negative effects on tapping.

Axis calibration resulted in about 0.0002"-0.0005" deviation between measured and the DRO over 6". I can life with this since my ability to measure over longer distances is nil.

So... looking good so far. A few more days of coolant, axis lube, and some other commissioning items and I can report back on rigid threading with UCCNC.

Again, thanks for all the help.
-Spumco
spumco
 
Posts: 306
Joined: Mon Oct 03, 2016 10:10 pm

Re: spindle encoder

Postby mccafferty » Thu Dec 29, 2016 1:32 pm

Congrats!
mccafferty
 
Posts: 22
Joined: Tue Nov 29, 2016 7:01 pm

Re: spindle encoder

Postby mccafferty » Fri Dec 30, 2016 1:43 pm

cncdrive..... thanks for your comments and clarification. Very helpful.

I want to make sure I understand completely. Some of my hardware has not arrived so all I can do at the moment is think about this stuff. ;?)

The UCCNC software uses AB&Z during threading operations. During other operations, it only uses Z to determine RPM. During threading operations, the RPM is typically lower so as long as the electronics can read all three channels threading will work fine. During other higher speed operations, if A&B inputs are unable to read due to frequency limitations, it will have no affect on the operation as only Z is used.

Is this correct?

Secondly:
On spindle RPM, does UCCNC close the loop? In other words, for spindle RPM, does UCCNC simply output the PWM signal scaled to what the RPM should be? OR, does it close the loop using Z feedback to tweak the spindle speed to the setpoint?

Thanks very much for your support.
mccafferty
 
Posts: 22
Joined: Tue Nov 29, 2016 7:01 pm

PreviousNext

Return to Hardware

Who is online

Users browsing this forum: No registered users and 6 guests