BR063

Encoder Input to control Servo RPM

36 posts in this topic

I have a spindle that has a variable speed controlled by a potentiometer and a VFD (125-275 RPM). The spindle is raised and lowered for rapid up and down via a ball screw and a motor and VFD. The ball screw nut is geared for a fixed feedrate so when the spindle rotates the spindle feeds down. I need to change this to allow multiple feed speeds. In doing so I am replacing the VFD drive on the spindle feed with a Servo motor and drive.   I wish to add an encoder to the spindle and feed this to the machines CP1L high speed input. Based on spindles RPM I would like to lower the spindle at a specific feedrate as well as raise and lower the spindle fast and slow when the spindle RPM is at 0. I have never programmed a servo drive and motor before in CX-Programmer before but it is my understanding that this possible. Any help would be appreciated.

Share this post


Link to post
Share on other sites

Even low resolution encoder pulsetrain will be too fast for the  CP1L high speed input, if the spindle rotates at 4-digit and probably upper 3-digit RPM.

I would use a cam with inductive sensor, generating one pulse per turn, with 50%On/50%Off ratio. A 100Hz response sensor will work up to 6000RPM.

For 1,2-digit RPM, however, you may need more pulse per turn, that is encoder, or better another inductive sensor watching a sprocket. 

 

Share this post


Link to post
Share on other sites

My spindle speed is limited to a range of 125 to 250 RPM max when synchronized feed rate is required. The spindle when stopped will only need to one of two preset speed to raise and lower. At those RPM the high speed counter won't keep up? I was told it would the encoder quoted to me was a E6C2CWZ1X2000PR2M.

 

Share this post


Link to post
Share on other sites

1. What model CP1L are you using? Must have transistor outputs to control a servo using High Speed Pulse outputs.

2. Why are you replacing the VFD with a Servo? Better speed control, higher torque? You CAN control the speed of the VFD from the CP1L. What model VFD do you have? Some newer models have pulse train inputs capable of controlling speed using the CP1L high speed outputs.

3. With the quadrature encoder you have mentioned the maximum high speed input frequency is 50kHz [10kHz for J model CP1L]. So at your maximum speed of 250 rpm an encoder resolution of 200 pulses/rev is the maximum encoder resolution you can use.

Share this post


Link to post
Share on other sites

I am using a CP1L-M60DT, which I believe to be Transistor output. 

I am replacing the VFD with a servo so that I can have better control at low RPM. I have tried to get what I want in feeds using the VFD but without the results I want. Currently the machine is gear reduced to give me a 0.002" feed rate on the spindle RPM. The ball screw nut is geared to that feed rate. I need to add a second roughing speed. I only use the VFD to spin the Ball screw for spindle advancement. In order to get the feed rate I need with the VFD I need such a large range of RPM to control the feed rate for both cutting and 2 speed rapid advance. So the variance for feed rate is around 6 to 12 Hz for cutting feed and the Rapid advance is too slow at 120Hz. So with the slower end of the scale the RPM is not very consistent (torque and RPM)and the higher end is too slow. Rather than change all the geartrain, I figured it would be easier to remove it all and fix the ball screw nut and drive the ball screw with a servo motor.

The encoder I am using, my intent was to add this to the spindle RPM and monitor its RPM. When I want synchronized feed I will use that to set the speed of the servo output to drive the ball screw to give me either feed rate of .002" or 0.006" per rev. When I wish to raise the spindle up and down I will just run a set Servo speed for 2 speeds regardless of the spindles 0 RPM.  Does this seem feasible?

Share this post


Link to post
Share on other sites

The CP1L model you have has SOURCING transistor outputs so your selected servo must have pulse train inputs that match this specification.

You can control the servo using either PULSE & DIRECTION or CW & CCW high speed outputs from the CP1L.

Rather than adding an external encoder use the encoder output signals from the servo drive [a common feature of most servos] as high-speed inputs to the CP1L.

You then have full control of speed and position of the servo within the PLC.

Adding CW limit , CCW limit and ORIGIN sensors would enhance the operation of your system.

Attached is excellent document from Jay Anthony at MRPLC that covers Motion using a CJ1M. Though the physical I/O connections are different, the principles apply equally to the CP1L.

[268]Omron_CJ1M_Motion_Introduction.pdf

Share this post


Link to post
Share on other sites

I was planning on using the external encoder to monitor the RPM of the spindle which is controlled by the VFD and potentiometer. I am not sure what the RPM of the spindle is as per the operators adjustment of the potentiometer (Spindle RPM could be 100-250 RPM). Would I not just use that data and a scale function to output the required pulse to attain a constant feedrate? Or am I missing something? I realize I need to scale the RPM pulse output from the PLC based on the ball screw pitch, drive chain ratio and spindle's current RPM.

Share this post


Link to post
Share on other sites
14 hours ago, BITS N BYTES said:

3. With the quadrature encoder you have mentioned the maximum high speed input frequency is 50kHz [10kHz for J model CP1L]. So at your maximum speed of 250 rpm an encoder resolution of 200 pulses/rev is the maximum encoder resolution you can use.

250 rpm = 4.17 revs/sec, so the maximum encoder resolution that could be used when counting 4x per pulse (quadrature) is 3000 ppr. 

3000 x 4 =12000 counts / rev.  4.166666 * 12000 = 50000 Hz. 

Share this post


Link to post
Share on other sites
2 hours ago, BITS N BYTES said:

The CP1L model you have has SOURCING transistor outputs so your selected servo must have pulse train inputs that match this specification.

You can control the servo using either PULSE & DIRECTION or CW & CCW high speed outputs from the CP1L.

Rather than adding an external encoder use the encoder output signals from the servo drive [a common feature of most servos] as high-speed inputs to the CP1L.

You then have full control of speed and position of the servo within the PLC.

Adding CW limit , CCW limit and ORIGIN sensors would enhance the operation of your system.

Attached is excellent document from Jay Anthony at MRPLC that covers Motion using a CJ1M. Though the physical I/O connections are different, the principles apply equally to the CP1L.

[268]Omron_CJ1M_Motion_Introduction.pdf

I am going to use a R88D-KT08H which does have pulse train inputs. Using this, what is the proper way to issue a SPED command based on what the high speed counter reads from the spindles encoder. I figure the spindle running at 150 RPM will produce a count of 2.5 revs/sec. The 2000 ppr encoder counting 4x per pulse is = 20000 Hz. With my gear ratio and 5mm ball screw pitch I figure I need to run my servo at 6.53 RPM to get 0.002" feed rate and 13.06 to get 0.004". That is a reduction of 1: 22.97 and 1: 11.48 respectively. Not sure yet how that is done yet but that is what i am trying to achieve. For fast and slow approach with 0 RPM at spindle I will need to run 120 RPM and 1500 RPM for the slow and fast advance.

Share this post


Link to post
Share on other sites

Correction:- IF the complete part number of the PLC is CP1L-M60DT-D then the outputs are SINKING and should interface directly with the Servo wired as Open Collector Inputs.

Easiest way of scaling your desired speeds is to use the APR instruction. This will scale input speed from encoder to desired output speed for servo.

If you intend to use the SPED command this suggests you are only concerned with RPM and not concerned about position. Remember that this command has no ACC/DEC associated with it. So the ACC/DEC parameters in the Servo drive will be the governing factor as to motor performance.

Share this post


Link to post
Share on other sites

Thanks, 

I am not concerned with the position when i am running at the set feed rates as long as it is synchronous with the spindle RPM. I have a limit switch at the top and bottom of the total stroke that will stop the feed at the bottom. There is a 2-hand anti tie down that activates spindle rotation so spindle rotation and feed will stop when the operator releases or it hits either limit switch. I may look at the homing function more closely in the future when i have time to play with this but for now the limit switch should be sufficient.

Share this post


Link to post
Share on other sites
57 minutes ago, BITS N BYTES said:

Correction:- IF the complete part number of the PLC is CP1L-M60DT-D then the outputs are SINKING and should interface directly with the Servo wired as Open Collector Inputs.

Easiest way of scaling your desired speeds is to use the APR instruction. This will scale input speed from encoder to desired output speed for servo.

If you intend to use the SPED command this suggests you are only concerned with RPM and not concerned about position. Remember that this command has no ACC/DEC associated with it. So the ACC/DEC parameters in the Servo drive will be the governing factor as to motor performance.

The easiest way? I looked at the APR instruction and can barely understand it. I guess I have a lot of research ahead of me. This is proving to be tougher than I thought. Thanks

Share this post


Link to post
Share on other sites

As it appears from your description you are using the servo in velocity mode to control it's rpm then homing and end limits would not be required.

Don't give up so easily. Your application is extremely simple!

 

APR instruction example:-

 

http://forums.mrplc.com/index.php?/topic/30950-proble-with-scale-function-in-cp1l/#comment-145675

Share this post


Link to post
Share on other sites

I understand that I wire the encoder on my spindle into the CP1L's high speed counter. In order to monitor its frequency rather than value how do i do that. Is it through the PRV instruction? I need to monitor that value to set my pulse output in realtime. If the spindle rpm goes up or down my feed has to as well.

Share this post


Link to post
Share on other sites

Use PRV2. Extrapolate the result as an input X to the APR and use the APR Y output as the value for pulse output using SPED.

Pretty basic programming.

Share this post


Link to post
Share on other sites

Is this close? Or am I in left field?

I need fast and slow feed when the Spindle's RPM is at Zero in addition to 2 different feed rates while the spindle is running at any RPM.

CP1L_SERVO_SPEED_CONTROL.cxp

Share this post


Link to post
Share on other sites

Doing GOOD. BUT the APR fields must be in sequential order starting with the APR control word. You are skipping X0, Y0, X1, Y1 by 10 words.

So suggest for EACH APR as follows.

Control word for APR_FEED_1 D99. and DATA fields for X0,Y0,X1,Y1 D100, D102, D104 D106.

Control word for APR_FEED_2 D109. and DATA fields for X0,Y0,X1,Y1D110, D112, D114 D116.

Will review early next week and send you suggestions. Meanwhile don't forget you can run CX simulator to test your application and see results.

Hints:- Remember that PRV2 gives a BCD result for RPM and can only be used for High Speed Input 0.

You don't have your PLC settings configured for Differential input for Input 0.

 

Think/research thes and I'll get back next week.

 

DOING GOOD. You WILL get there!! Have a great weekend

Share this post


Link to post
Share on other sites

Thanks, Bits n Bytes for being such a good mentor, :clap:

Share this post


Link to post
Share on other sites

More details for you to consider.

Use BINARY for all values vs HEX. Much easier to interpret.

Just because your spindle speeds are up to 275rpm, consider using 1000 rpm as the value for X1 in the APR. Again much easier to understand.

Your graph will be 0-1000 on the X-Axis. The two APR Y1 values [FAST and SLOW] are then the pulses/sec you would need to run  the servo if the spindle was at 1000 rpm.

The APR will now scale any value between 0-1000 rpm and output pulses to the servo follower.

Also note the new PLC settings for HSC 0. This must be downloaded to the PLC and THE PLC power cycled before it takes effect.

Simple sketch attached and updated program with new comments.

 

HAVE FUN 

APR.pdf

CP1L_SERVO_SPEED_CONTROL2.cxp

HSC 0.JPG

Share this post


Link to post
Share on other sites

Thanks alot for the help. That's a really neat instruction. I need to have  both CCW and CW rotation for the Rapid to lower the spindle when it is at 0 rpm. Spindle raise with 0 rpm will only be fast. Does this look about right? Also on wiring this up does the plc only use the A and B phase or is the Z phase also needed in this application?

CP1L_SERVO_SPEED_CONTROL3.cxp 

Edited by BR063
Wiring encoder question

Share this post


Link to post
Share on other sites

Looking at this, I am not sure where your value of #0c00 for source word on the MOV instruction to configure APR control word D100 comes from. Please explain. I thought this was suppose to be the PRV2 value.

Edited by BR063

Share this post


Link to post
Share on other sites

The CP1L manual shows the APR can be configured for "Unsigned Integer Data [Binary or BCD]".

I have never succeded in getting this to work, possibly bad documentation.

So I have always used the APR configured for Signed Integer Data [Binary].

#0C00" uses 32- bit Signed Binary data and always seems to work OK for me.

 

APR Config.pdf

Share this post


Link to post
Share on other sites

Okay thanks. My mistake I didn't do enough research on how that was configured. I get it now.

Share this post


Link to post
Share on other sites
20 hours ago, BR063 said:

Thanks alot for the help. That's a really neat instruction. I need to have  both CCW and CW rotation for the Rapid to lower the spindle when it is at 0 rpm. Spindle raise with 0 rpm will only be fast. Does this look about right? Also on wiring this up does the plc only use the A and B phase or is the Z phase also needed in this application?

CP1L_SERVO_SPEED_CONTROL3.cxp 

Yes your  changes will operate output in CW/CCW directions.

Only A and B phases required.

Note that in your PRV2 instruction you have defined the pulses per revolution as #8000. This equals binary 32768, do you really mean this??

You can enter the divisor in PRV2 as decimal with the & prefix. Again much easier to work with than HEX numbers. So if your ppr is 200 simply enter &200.

PRV2.JPG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now