Sign in to follow this  
Followers 0
jeffhansen

Speed control with encoder feedback

4 posts in this topic

Firstly - I'm relatively new to using Omron, having just completed my first project using a CP1H-XA. For my next job, I'm replacing a C1000H with a CJ1G-CPU43H. Most of the code converted straight over, with only a couple of errors due to Analog I/O, but that is not my issue. I'm upgrading an existing installation, and wish to integrate several speed control functions into the PLC. I have a rotary encoder, which I am using as a speed feedback, not for position, so am only going to use the A output, and feeding it into a CT021 counter module. The output is analog 0-10V, DA041 card. So basically, I need to compare the speed input PV to a SV set via the HMI. I've not used the CT021, and I'm finding the manual rather confusing. What I'm looking for is - is there code required to set up the CT021? - What will be the address of the data register for PV? - Should I use PID, and if so, is there an easy way? I'm happy to be pointed toward the right pages of whichever manual. Thanks for your help. Jeff

Share this post


Link to post
Share on other sites
The manual for the CT021 is W401-E1-02 (CJ1W-CT021 High-speed Counter Units OPERATION MANUAL). SECTION 3 is about setup, and SECTION 4 about exchanging data with the CPU. Operating a counter in a nutshell: You have to choose a counter type and a counter signal type. This can be done in the IO table, or direct with DM words. See section 3-2 and 3-3. You have to open the counter gate for each counter. See section 4-2-3. (page 102). Current counter value appears in n+22, n+23 for counter 1, and n+27, n+28 for counter 2. (n = CIO2000 + (Nx10), address of the first word of the block of 40 CIO words that are allocated to the Unit) The DA041 requires similar setup and operation, as described in W345-E1-09 (Analog I/O Units OPERATION MANUAL) Hope this helps :) Edited by dweste

Share this post


Link to post
Share on other sites
I said I was new to this! I didn't know I could edit in the IO table. Thanks dweste! So...... I'm going to use the CT021 to give me a rate output, by setting the Time Window Rate Measurement to, say, 200mS. I then extract the rate History Date by using IORD #1F01 #00020003 D500 As far as I can make out, this will put the rate measurement for the two counters into D500 and D501. I'm then going to compare the PV with the SV plus/minus a hysteresis factor, and increment or decrement the output to the speed control if required. If I set up a self resetting timer to control the INC/DEC, I can control the rate at which the output changes, thus preventing oscillation. As I don't need precise control, this should do the job, rather than using PID. Looking at it now, I should have just put a 24VDC digital input card in to do the job, as the process is very slow, the encoder pulse frequency is low, and I could have made a simple rate counter in ladder. Any thoughts on this?

Share this post


Link to post
Share on other sites
I never used the rate measurement myself, but it should do the trick. With low pulse frequencies, you could even make your own rate measurement in the PLC, using a normal PLC timer. By then, your CT021 will be obsolete. A normal input card is sufficient when the pulse frequency is very low, AND the PLC cycle time is low. I did it myself one time, but take care! I ended up optimizing the program for cycle time because I missed pulses every now and then. Another option would be the CTL41 counter card, 100kHz instead of 500 kHz (CT021), 4 channels instead of 2 and cheaper.

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
Sign in to follow this  
Followers 0