Sign in to follow this  
Followers 0
mtchufi

Hi Speed counter reset on CPM1A

10 posts in this topic

Hi, I just started my project using Omron CPM1A to control "position". I used one AB phase encoder to read the position. I ve problem when power up or cpu change from program to Run position as the value of Hi Speed encoder value (on SR248) was reset to "0". So I have to manually bring to home position. Do anyone know the "trick" to restore the Hi Speed counter value after power up? Below is the listing program in STL : LD 253.13 MOV 248 DM0010 (copy the HSpeed PV to DM0010) LD 000.02 OUT 252.00 (HiSpeed counter reset) LD 253.13 BCMP DM0010 DM0100 011 (block compare , to direct drive output in word 011) ..... TY

Share this post


Link to post
Share on other sites
Create a power-failure task (int01) which is called when the power is turned off. In this task you should copy the actual value to the preset value and next time you power on, the counter value is restored.

Share this post


Link to post
Share on other sites
Are you sure that your input 0.02 is not on? What is connected to this input? I cannot seem to find the info in my library. Looks like that IP could be the issue though?

Share this post


Link to post
Share on other sites
I'm sorry, the CPM1A seems not to have an power failure interrupt. The easiest solution to me seems: copy the actual value to the preset value every cycle.

Share this post


Link to post
Share on other sites
I try to put delay timer to delay the instruction to copy the SR248 to DM0010, and try to copy back the value DM0010 to SR248, but it cant, because the SR248 cant be "written" by move command. here is the STL LD 253.13 OUT TR0 AND TIM001 MOV 248 DM0010 ....(delay copy SR248 to DM0010 by tim1) LD TR0 TIM 001 #0050 TIM 002 #0010 AND TIM002 @MOV DM0010 248 (copy DM10 to SR248 before T1 "on") <<=== not work ! aside, I also open the wiring of input 00.02 hardware, even I remove from the program (no hardware reset), but still no work for me. I m still keep trying now. Ty

Share this post


Link to post
Share on other sites
Surprising, is there anything else writing to Bit 252.00, a block move or anything? I will have a look in my documentation again. Have you tried with no code in the PLC, just moving the counter value to a word every scan? This should eliminate a code issue if it is still resetting. Just a though, under settings, HSC, what sort of reset mode have you configured?

Share this post


Link to post
Share on other sites
continually write the value to the DM area... then on power up i believe that a BSET might work. OR PRV / INI can;t remember... If the power is cut is their inertia in the machine that might cause missed counts... Also keep in mind that copy the counter value is via a mov inst... is scan based and might not reflect the exact count... Secondly using a PRV continuously to read the counter can also cause scanning probelm issues if you are using a CTBL compare etc...

Share this post


Link to post
Share on other sites
After I read again the manual for CPM1A, I found that the hi speed counter is reset to "0" when power is turned "ON" and when operation begin. (CQM1/CPM1/CPM1A/SRM1 PROGRAMMING MANUAL page 80). I decide to perform manual home position additional program as for easier way, safe, and avoid "inertia issue" when power cut off. Looks this will solve my problem. Thanks for all your help guys,

Share this post


Link to post
Share on other sites
I guess we should of been able to find that, I found the following from the CPM1A programming manual 'The counter will be automatically reset when program execution is started or stopped. I think the home position was probably the way to go, will make it more reliable, without any extra code to keep track.

Share this post


Link to post
Share on other sites
hi take a look at this part of my programm!!__913___957___974___957___965___956___959_.cxp

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