Sign in to follow this  
Followers 0
Guest Guest_rock

cqm1 cpu44 - encoder help

13 posts in this topic

Have a question that I hope someone can help with. Have a older piece of equipment that we are going to put back into production with some modifications that has a omron cqm1 - cpu44 plc. I have read all of the post that deal with encoders but still confused about something. I am trying to figure out how to connect a encoder that would give me 360 pulses per revolution 0-360, and use this to control when certain things would happen. When the encoder has made one revolution, then start back over at 0. For example at 150-175 degrees turn on a glue gun. I have done this using one of the omron programmable cams, but wondering how to do this through the display. The machine has a omron nt20m display. Any advice would be greatly appreciated.

Share this post


Link to post
Share on other sites
Hello Rock The CQM1-CPU44 has two dedicated Absolute encoder ports. These ports will accept either 8,9 or 10 bit GREY code abosolute encoders. For a 360 degree type you will require a 9 bit 360 degree GREY code encoder. The counter value is store in Memory locations: IR232 - 233 (Counter 1) IR234 - 235 (Counter 2) Because the encoder is absolute, the counter values will automatically start back at zero after 359 degrees. To operate outputs off this encoder, a simple way would be to use the ZCP() ladder function (area range compare) which will turn on a flag when the encoder count is within a defined range. Port connection detail diagram is attached. Hope this helps Nibroc

Share this post


Link to post
Share on other sites
Thanks for the info This is a older machine that the manager wants to pull out of storage and do some prototype experiments with, and because it will not go any farther after the we finish the experiments, he does not want to approve any funds to upgrade the controls. I have attached a copy of the program that was in the machine that I found a printout of that deals with reading the gray scale encoder and then scaling it. To be honest, I have read the manual on the scaling and the post on this site, but still not 100% clear on the understanding I do have some omron absolute encoders that give 1 pulse per revolution and a couple of omron of omron cqm1h plc's on the shelf that I would like to possibly use. Any advice on what would be the best way to accomplish this would be appreciated. Could the encoder output be connected into the high speed counter input on a cqm1h? If you then monitored the input and turned the encoder shaft, would you not see the counter increment from 0-360? And then the Zcp instruction be used to determine when to turn certain things such as solenoid valves, etc. on. . Once again Thanks Print.txt

Share this post


Link to post
Share on other sites
Hello Again, Had a look at the code you posted. The GREY code encoder connected to your CPU44 was an (OMRON?) type 720 resolution. This units outputs GREY codes 152 thru 871 (720 positions) this being 98Hex and 367Hex. You will note that these values are settings for the Scaling in your posted program. The program scales 152 thru 871 to 0 thru 359 degrees. It then applies a zero offset, this offset is stored in DM917. The final result, (position) is stored in DM912. The zero offset simply allows you to 'adjust' the 0 degrees position within the PLC, negating the need for mechanical adjustment of the encoder position for alignment. You can use the ZCMP function on DM912 to operate your outputs. Personally I would change the Scaling to be 0 thru 719, this would give you better accuracy. I have posted a copy of an Omron encoder specification, note on page 4 it shows that the 720 resolution unit outputs 152 thru 871. Yes, you can connect standard INCREMENTAL encoders to any CQM PLC's built in high speed inputs. For your application I would stick with the CPU44/GREY code system. Hope this Helps Q107_E1_2.pdf Edited by Nibroc

Share this post


Link to post
Share on other sites
Thanks alot I still trying to learn this encoder position and scaling , just one of those things that for some reason just not sinking in like i would like, sorta drives you nuts, but sooner later it will all fall together.

Share this post


Link to post
Share on other sites
I understand the Scl part after reading your explanation, but do not quite understand the zero offset after it scales 152 thru 871 to 0 thru 359 degrees. I understand that the results of the SCL are placed in dm890, but do not fully understand the instructions where it does the CMP - DM890 and DM917. Could you explain if possible, since you have a lot better understanding than i do. Thanks

Share this post


Link to post
Share on other sites
Hi, The Zero Offset. The SCL function simply scales the encoder to 0 to 359 degrees. An ablsolute encoder outputs a fixed position depending on where the encoder shaft is. As we turn the encoder, the position changes. Once the encoder is coupled to a mechanical system, the zero point will always be in the same place each time the encoder performs one revolution. Usually we want the zero (reference) position to be a certain point in the rotation of the mechanical system, which may not align with the encoder zero point. Two ways to fix this are: 1. (Mechanical method) Move the mechanical system to where you want 'zero' to be, disengage the encoder (loosen the grub screw) and turn the encoder until it reads zero, retighten the grub scew. 2. (Software method) Move the mechanical system to where you want 'zero' to be, read the encoder value in the PLC, set this value as the offset. Although the encoder reports a non-zero position, the offset corrects this. Let me know if you need me to explain any more. Nibroc

Share this post


Link to post
Share on other sites
Thanks You have been a big help. Kept looking at the SCL and just could not grasp it, and then boom, I read your explaination and it hit me like a ton of bricks. Take care

Share this post


Link to post
Share on other sites
Rock, Here's a PDF with some figures and a graph that may help clarify your confusion. It gives some concrete examples of how the system works. Let me know if you have any questions. MickeyBob Encoder_Scaling.pdf

Share this post


Link to post
Share on other sites
Great explanation. Should post it on the Omron Download section of Mr Plc. From the post that I have read over the last year, it appears it would be very useful to a lot of folks

Share this post


Link to post
Share on other sites
Thanks Nibroc and Jay Now have this machine in operation after replacing the cqm1 plc with a cqm1h-cpu51 plc with the absolute encoder innerboard. Nibroc Thanks for your explanation of how the code worked in the original program. It was a great time saver for me. I now understand how the code is being read in into the plc and converted to display 0-360 on the screen. The only thing that still confuses me a little is the part in the code where it does the following The program scales 152 thru 871 to 0 thru 359 degrees. It then applies a zero offset, this offset is stored in DM917. The final result, (position) is stored in DM912. I do not quite understand the zero offset, but will study it a little more, have been more concerned with just getting the new plc with the omron encoder that both you and Jay suggested (e6c3-ag5c) to work and being able to eliminate the old non omron encoder and a interface board that was built and installed inline between the encoder and the cqm1. ONCE AGAIN - THANKS

Share this post


Link to post
Share on other sites
Just thought you guys might want to know that I am the guy who wrote the original program for this machine. The problem that caused the most trouble in doing this is the fact that the table and range compare instuctions insist that the first paramater be smaller that the second. This makes it a bit tricky if you want to setup a window that starts at say 300 degrees and ends at say 20 degrees. This took a while to figure out. Basically, when the data for the ON and OFF points of the electronic cam portion of the program are entered via the NT20 display, they are checked to see if the ON value is larger than the OFF value. If this is the case, the value is are traded and a bit is set in a register that indicates that the output of the compare function must be inverted. You did a great job of deciphering my code. The comments I'm sure helped. Have a GREAT day! wborst

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