themoonlight

Motion Control

11 posts in this topic

Hi all,

I am new to this forum and this is my first project in motion control.so I am wondering if anyone can send me a sample code for controlling the motor speed using feedback reading from the encoder?

Thanks

Share this post


Link to post
Share on other sites

Model numbers of the PLC, Servo Drive, Servo Motor, and Encoder are necessary pieces of information. Sample code is available from Rockwell, ask your distributor for details.

Share this post


Link to post
Share on other sites

Hi JRoss,

I am using 1769-L36ERMS Controller, PF527 sto connected to motor and encoder  844D-B4AC2F. I have run the motor without the feedback and works fine. then connected the drive to the drive and run both of them and aslo managed to get them work.

Now I need to control the motor using the feedback speed from the encoder (close loop) by writing a ssimple codes but actually I stuck! 

I have also contacted Rockwell for sample codes and they sent me something made me more confused. 

I am looking for some help from you guys and appreciated in advance.

Thanks,

 

Share this post


Link to post
Share on other sites

How is the encoder connected to the system and where is it mounted? Are you using the encoder as the feedback for the motor (i.e. servo-like operation), or as a master device that the motor will follow?

The PF527 can be set up as a motion axis in the motion planner and commanded like a motion axis. I've used this to have a PF527 controlled conveyor follow a Kinetix 6500 controlled conveyor in a master slave relationship.

Share this post


Link to post
Share on other sites

First of all, thanks for prompt reply.

Second, the encoder is connected to the drive 25-ENC-2 board and in the software,  under pf527 properties added the motor axis to the drive.

Then created motion group and move the motor to the motion group.

In the axis properties under general properties i configured the motor for velocity loop. So i can use the encoder as the feedback to the motor.

Under the feedback option, I added the encoder and its specification.

Now my question, is how to use the speedfeedback (encoder reading) and compare it with refrence input to inctease/decrease the motor speed. Other word, controling the motor speed using feedback 

Thanks, 

 

 

Share this post


Link to post
Share on other sites

I'm still not sure what you are trying to do. It sounds like you want the motor to follow the encoder, but the only thing you can do with your setup is use the encoder as feedback for the motor so that when you tell the drive to go to a certain position or speed, the encoder reports the position and speed to the drive so that it can correct any errors.

If you want to have the drive/motor follow the encoder, in other words the encoder moves forward so the motor moves forward, that will you to wire the encoder into the system differently, or get a second encoder.

Share this post


Link to post
Share on other sites

Hi all,

Thanks Kaiser_will for sharing this link. I got my motor running with my encoder. if I need to generate a sine wave to ramp up then down  the speed of the motor which motion commands is good for this tasks?

Thanks,

Share this post


Link to post
Share on other sites

You're going to continuously ramp the motor speed up and down? I would investigate the camming instructions. You can create a curve and execute it continuoustly. You'll create a virtual master, set your drive to follow the virtual master with a cam profile executing continuously, then start the virtual master.

Why are you doing this?

1 person likes this

Share this post


Link to post
Share on other sites

There's a motion reference manual on the AB website. Also talk to your distributor about your application for more specific help. The online instruction help within Studio 5000 is pretty good, that's where I start when trying to understand a new instruction. And there's nothing like just trying things. Create a couple of virtual servos. Add motion instructions to a routine or use Motion Direct Commands (right-click on the axis object) to command the servos in different ways. Use Trending to monitor position, velocity, etc. When you think you have a handle on it, try it with real hardware.

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