Spindle encoder question

If you have a question about the software please ask it here.

Spindle encoder question

Postby spumco » Mon Oct 03, 2016 10:34 pm

All,

First time poster, very new at this CNC thing. I'm currently re-wiring everything on my mill and am planning to use UCCNC as the control software with an ETH400.

Basic hardware:
ETH400
CNC4PC C23 BOB
Hitachi WJ200 015SF VFD
Marathon 3P motor with Dynapar HS35 encoder.

The encoder wiring to the VFD seems pretty straight-forward. Encoder A+ to "EA" pin, and B+ to "7" pin and set the parameters to match.

Here's my question: How do I get the encoder signal from the VFD to UCCNC?

The software setup asks for A & B pins. The VFD has an "EO" pin, which is the "pulse train out" terminal. I think this sends a 10VDC signal - but of what?

My BOB requires 5VDC inputs - maybe a resistor would help here to drop the voltage. But does anyone have an idea how I can get the A+ and B+ signals to the BOB so UCCNC can pick it up?

Can I split the signal from the encoder upstream of the VFD and send the A+ & B+ to the BOB and the VFD at the same time?

Or am I missing something fundamental here about encoder signals and/or UCCNC?

[If this isn't the appropriate forum since this may be more about the VFD than UCCNC, let me know and I'll move over to CNCZone. I'd just planned on lurking here as much as possible while learning the software and ETH400.]

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

Re: Spindle encoder question

Postby cncdrive » Mon Oct 03, 2016 11:04 pm

Hi and welcome to the forum.

This is our official support forum, so you are at the good place. :)

From your description I think you missunderstand what an encoder is and what it's purpose is.

An incremental encoder is a position measuring device. Mostly rotary position, but linear ones also exists. (e.g. in printers)
The "incremenetal" means that it does not output an absolute position angle information, but only an increment data of the position or in other words the change in the position.
Incremental rotary encoders are mostly built just like a mouse wheel with 2 LEDs and 2 optical gates and a wheel with several cuts.
So, as the wheel rotates the sensors detects the light of the LED when the LED lights through the slot.
The 2 sensors are aligned in a way that the light/no light or on/off signal detection is phase shifted with 90° to eachother.
These 2 detected signals can be used as position data and the lag of A to B or B to A determinates the current direction of the wheel rotation.
Some more description is on this site: http://www.dynapar.com/Technology/Encod ... l_Encoder/

And incremental encoders can be not only optical, but also there are magnetic and capacitive ones, but they all producing the same kind of A, B signals plus the Index.
The Index gives a single pulse per turn and it produces that signal on the same position, so it gives the absolute angle position when detected.

The purpose of using an encoder on the spindle motor shaft is only for Rigid tapping on mills and Thread cutting on lathes.
With using the encoder position the UCCNC can syncronise your Z axis to the spindle rotation taking the programmed pitch into account creating a tapped hole.
Like how Derek did in this video: https://vimeo.com/140955027
The left and right hand taps can be programmed with the G33.1 and G33.2 codes.

Controlling the spindle speed is a different topic, the UCCNC can do that with PWM output which BOBs can convert to 0-10Volts or just amplifying the PWM amplitude to 0-10V and then the VFD can smooth it out,
or sometimes direct connection of the PWM signal is enough if the input of the VFD is isolated and if it can be setup for 0-5Volts and has an adjustable low pass filter on the input.
For just controlling the spindle speed you do not need an encoder, the UCCNC can control the spindle executing the 'S' command, e.g. S1000 and you have to configure the Spindle to PWM mode in the Configuration and setup the miniumum and maximum speed ranges and the minimum and maximum PWM duty cycles.
cncdrive
Site Admin
 
Posts: 4750
Joined: Tue Aug 12, 2014 11:17 pm

Re: Spindle encoder question

Postby spumco » Mon Oct 03, 2016 11:59 pm

Thank you for the reply.

I'm using the encoder to provide feedback to the VFD for closed-loop (flux) vector control. It is an incremental quadrature encoder with an index signal. The encoder permits the WJ200 to improve torque and speed accuracy at low frequencies. The VFD can also do simple positioning and homing (servo) with an encoder - although that will require a serious education for me to implement.

Spindle speed will be controlled with 0-10VDC and direction relays as you described. However, I'd like to set up the mill to do rigid tapping and gear the spindle to the Z-axis. An indexing signal would be a bonus for a future ATC (if something like a CAT40 is used).

Brushless AC servo amplifiers/drives I've seen or read about have a 'pass-through' feature for the encoder signal. The drive receives the encoder signal and will manage the position error correction with whatever PID is set. The signal can be passed through to the controller (or other device) for trajectory planning correction or electronic gearing for threading. The drive encoder outputs are exactly the same as the inputs.

My problem is that UCCNC needs a 'normal' encoder input, but I don't understand the WJ200 encoder output scheme and how to get an appropriate encoder signal to UCCNC for rigid tapping. The terms in the VFD manual are confusing as there doesn't seem to be an industry standard term - or at least I've seen multiple terms for each function ("pulse train input" = "encoder input").

There is a parameter called "pulse train input monitor" that can be set in the VFD (Code C027, F15) for the EO terminal. Does this sound like the "pass-through" function I'm describing? If so, how do I get the signal - whatever it is - to UCCNC in a format the software can understand?

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

Re: Spindle encoder question

Postby cncdrive » Tue Oct 04, 2016 12:46 am

I looked up the manual of that VFD and it describes:

P004 Pulse train input mode selection for feedback

Four option codes:
00…Single-phase pulse [EA]
01…2-phase pulse (90° difference)
1 ([EA] and [EB])
02…2-phase pulse (90° difference)
2 ([EA] and [EB])
03…Single-phase pulse [EA] and
direction signal [EB]

So, with option 00 you use a single channel signal, e.g. one channel A or B of an incremental encoder or simply one opto gate sensor or other type of single channel sensor.
This way you can't detect the direction of rotation only the frequency->speed of rotation and this information is not enough for the UCCNC for rigid tapping and thread cutting, it needs both A and B channels and also the Index.

I don't know what is the difference yet between option 01 and 02, this basic description looks like the same, the difference is probably described later in the manual...
But these options are the incremental encoder what I described you (this is what the UC also understands), it needs the A and B channel signals from the encoder and it seems it does not require the index
which is logical as it only controls speed or the position in an incremental way, the VFD does not need to know the absolute position angle.

The option 03 is basicly step/direction interface where you have one pulse and one direction signal. This is again not OK for the UCCNC encoder input for rigid tapping and threading.

And that it can't pass through the signal does not sounds like a big problem for first, because you could simply buffer the signal and then connect that to the UC.
However I do not recommend to use single ended signals like this to be routed on long distances and machine frames in noisy environments, so unless the machine is small and you can make a separated installation of these wires then I advice you to convert the signals to differential ones at the encoder and convert them back to signal ended at the VFD.
And use another differential line driver again close to the encoder and wire them to the UC and again terminate that with another differential line receiver and connect those single ended lines to the UC.

If you will use a positioning servo drive instead of a VFD then you will also need a servo motor which fits your drive, a servo drive will not work with the same motor which works with the VFD.
And if you will do so then you do not even need an encoder to be connected back to the UCCNC, because you can configure the spindle motor as an axis also and then position it with step/dir signals just like the other axis you have on the machine, so you can rigid tap for example with simple linear motion commands G1.
Also you can then configure a step/dir spindle, but you have to do a switching between the axis mode and the spindle mode which can be done externally with some external TTL gates and some macros or internally with a macro which rewritting the configuration.
However depending on your power requirement a servo spindle can be costy if you need high power and also the RPM range of the motor might be lower than a AC motor, but again what is optimal depends on your system and what you want to do exactly and how much you want to spend on the spindle.
cncdrive
Site Admin
 
Posts: 4750
Joined: Tue Aug 12, 2014 11:17 pm

Re: Spindle encoder question

Postby spumco » Tue Oct 04, 2016 2:29 am

I won't be changing to a servo spindle - that was essentially an example of the encoder pass-through as I understand it.

Function P004 (01) and (02) are, as you suspected, described later in the manual for the Simple Positioning mode. They appear to be used to for the rotation coordinate system and I think are unnecessary for the VFD in Speed Control Mode.

Reading through the parameters, it appears that I set P003 to option (01) so the VFD enables the EA input, and P004 to (00). This appears to be all I need for accurate low-speed operation. So far, so good, since I don't need accurate positioning.

As you say, this single-input pulse train is not enough for UCCNC to use. However... you mentioned 'buffer the signal'?

Is this where I simply connect the encoder A+ & B+ wires to a distribution block (or similar) and connect the same signal to the VFD (A+ & COM only) and the breakout board (A+ & B+ & COM)? If this is the case, it seems too easy.

As far as physical layout goes, the mill is fairly small. I estimate about 24" distance from the VFD to the breakout board and ETH400. The BOB and ETH400 are in a low-voltage enclosure and all 115/230VAC equipment is in a separate enclosure, including the VFD. The 230-3P motor wires will be inside metallic conduit outside the mill and terminate in flexible metallic conduit in a cable track. There is also an RFI filter upstream of the VFD. All control circuits are 24VDC, with some signal circuits stepped down to 5VDC and 12VDC (spindle speed).

You've jumped past my understanding with 'single-ended signals' and differential line drivers. I have no clue what those terms are, but I get the idea that your advice is about certain configurations being unacceptably subject to RFI/EMI from the VFD.

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

Re: Spindle encoder question

Postby cncdrive » Tue Oct 04, 2016 9:05 pm

The encoder pass-through means that the drive or VFD has an encoder input and an encoder output also which is often implemented in servo drives,
because in many cases the encoder is feedback to the servo drive, but it also has to feedback to the CNC controller.
So, the drive inputs the encoder signals and it also outputs the signals. What the drive do with these signals as minimum is it re-buffers the signals.
In some cases the output is configurable for example an encoder divider/electric gearing can be programmed, so the output CPR could be different than the inputs CPR.
In some other cases the motor has a digital encoder using somekind of digital protocol to get the position data from the encoder, e.g. EtherCAT, CAN bus etc.,
and an incremental output is provided from this position data by the drive. In this case the drive reads the digital data and then outputs the appropriate signals producing incremental pulses from the motor encoder digital signals.
This is called pass-through because the drive outputs the encoder signals it reads from the motor encoder, so the signals can be reused elsewhere.

If the drive does not have this encoder signals pass-through option and the encoder signals have to be reused elsewere is the case what I was writting about in my previous post.
If the signals are single ended and the drive and controller accepts this format then you could connect them directly to both the drive and the CNC controller assuming that the encoder outputs can drive out both inputs together which is not always the case, depends on how the signals are terminated in the drive and in the CNC controller, how much current can be sinked/sourced from the encoder. Again not a short story, could be writting about it for pages, so I cut this here.

A differential line driver/receiver are ICs. E.g. 26LS31 and 26LS32. (Look up the datasheets of these ICs)
The line driver is the transmitter and what it does is it converts the single ended signal to differential, so for example you have signal A and the transmitter converts and outputs it to the same signal A and the inverted signal _A, so you have A and _A from signal A.
The receiver doing the inverse operation, it inputs and converts the differential signals to single ended ones, e.g. A and _A to A.
When transmitting the differnetial signals the 2 signals A and _A are terminated together with a low value resistor, so a fair amount of current will flow always in the wires making them kind of EMI immune.
So the purpose of this signal conversion is that single ended (RS423) signals are kind of noise sensitive, because the current return path is the common ground in the cable,
while differential lines (RS422) are much more noise immune, because you can transmit the signal A and signal _A in a crossed wire pair and then the sum of current in the wire pair will be always 0,
because the 2 wires always have the inverted polarity to eachother.
The other things is that a drive which inputs differential signals can detect cable cut, because it is detectable if the signals have the correct polarity or not,
it can compare if one signal has the opposite polarity as the other or not. With single ended wires this is not possible.
And by standard RS423 can be routed upto 10meters max., RS422 can be routed upto 100meters.
cncdrive
Site Admin
 
Posts: 4750
Joined: Tue Aug 12, 2014 11:17 pm

Re: Spindle encoder question

Postby spumco » Tue Oct 04, 2016 9:46 pm

I am indebted to you for the education.

It also appears I incorrectly assumed the encoder was the standard, current model supplied with Marathon motors. It is, in fact, a BEI HS35F incremental encoder. If I understand your explanation, my encoder provides a differential signal. Here are the outputs:

A+
B+
Z+
V+
0v
CG
_A
_B
_Z

Ignoring the VFD connection for the moment, how do I connect this to UCCNC? Do I purchase a differential to single-ended converter and the A+, B+ are connected to two pins on my BOB (and then the appropriate pins are set in UCCNC)?

If that's the case, then the VFD manual shows a virtually identical arrangement (2-phase) for connecting the encoder.

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

Re: Spindle encoder question

Postby cncdrive » Tue Oct 04, 2016 11:13 pm

Yes, that's an incremental encoder with differential outputs.
To connect them to the drive the adviced way is to convert the signals to single ended ones with a line receiver,
which is a circuit with terminating resistor and/or snubber and a diff.line receiver chip e.g. a 26LS32.
Then you will get a A and B and Z signal. The Z is the Index.

And yes, the A is exchangable with _A and the B is exchangable with _B and Z is exchangeable with _Z.
And also the A with B channels are exchangable. Exchanging any of these will always reverse the counting direction,
because if with one selected connection rotating to a selected direction for example A follows B then making any of the mentioned signals exchanged all will change the count direction, so if you make one exchange then B will follow A and if you then again make an exchange then again A will follow B etc etc.
And also you can exchange the count direction in the UCCNC software, there is a checkbox for that, because it is important to make the motion controller to count to the correct direction,
otherwise the rigid tapping and thread cutting operation will not start, the software will just wait for the encoder to count to the correct direction and then you need to change that setting to make the count direction right.

And with the signal conversion the only important thing is that A and _A should be connected to the same channel on the diff.line receiver and the same with B and _B and Z and _Z, I mean the signal and the invert signal must be paired on the receiver channels.
cncdrive
Site Admin
 
Posts: 4750
Joined: Tue Aug 12, 2014 11:17 pm

Re: Spindle encoder question

Postby spumco » Wed Oct 05, 2016 12:08 am

You are my new favorite internet friend.

It's a certainty I'll be back to pester you with further questions, but for now... thank you.

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


Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 33 guests