RoTaTech
Member
This problem came up about a year ago, and no-one at Omron support could figure it out, so I thought I'd throw it to the wolves.
No urgency in reply, of course, just looking for thoughts...
yesterday I had a oddity - Omron CPM1A register went funny
This is a machine where an AC drive moves a piece of sheet metal along a conveyor under three different cutters - spaced out linearly. The conveyor movement is read by an encoder.
I had a couple rungs give me an hours headache:
LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
...
(do something to request cutter) ...SET 20005 ;latch cutter request
...
(cutter routine)
LD 20005 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter
worked beautifully, as it should.
Then I got the brilliant idea that I should add a timer before the cutter fires, to give the conveyor time to stop:
the code sample becomes:
LD 20005 TIM13 #5 ;1/2 sec delay for stopping
LD TIM13 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter
this identical segment was added to 2 different punches, worked perfectly, as it should.
BUT, adding this timer to this particular segment (I removed it and problem would go away) caused the DM51 countdown to decrement by 2 instead of 1 !
I though I must be getting a double action from the cutter or something, so I added this:
LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
CNT5 DM50
LD 1401 (to the counter reset input)
SO..., these 2 counters have the same input condition, right?
Now with the timer 13 still active, DM51 would dec by 2 and CNT5 would dec by 1!!
I solved it by just scrapping the SUB and doing a MOV CNT5 DM51, instead, but why do you reckon this happened???
No urgency in reply, of course, just looking for thoughts...
yesterday I had a oddity - Omron CPM1A register went funny
This is a machine where an AC drive moves a piece of sheet metal along a conveyor under three different cutters - spaced out linearly. The conveyor movement is read by an encoder.
I had a couple rungs give me an hours headache:
LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
...
(do something to request cutter) ...SET 20005 ;latch cutter request
...
(cutter routine)
LD 20005 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter
worked beautifully, as it should.
Then I got the brilliant idea that I should add a timer before the cutter fires, to give the conveyor time to stop:
the code sample becomes:
LD 20005 TIM13 #5 ;1/2 sec delay for stopping
LD TIM13 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter
this identical segment was added to 2 different punches, worked perfectly, as it should.
BUT, adding this timer to this particular segment (I removed it and problem would go away) caused the DM51 countdown to decrement by 2 instead of 1 !
I though I must be getting a double action from the cutter or something, so I added this:
LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
CNT5 DM50
LD 1401 (to the counter reset input)
SO..., these 2 counters have the same input condition, right?
Now with the timer 13 still active, DM51 would dec by 2 and CNT5 would dec by 1!!
I solved it by just scrapping the SUB and doing a MOV CNT5 DM51, instead, but why do you reckon this happened???