Determine weight increase

M

Thread Starter

Mikw Wylie

I am using a Siemens S7-300 and I need some logic to determine that the weight is increasing on the scales. This is to determine that powder is actually being dispensed and then to generate an alarm if the weight is not rising.
 
C

curt wuollet

How bout something like:
Initialize Last Weight = 0, tolerance to somenum.
start
Get weight
if weight <= last weight, tick a one shot to a counter.
if counter = tolerance set alarm
last weight = weight
if not done goto start
reset counter, weight, last weight

You might want to add an increment to weight, etc.

Regards
cww
 
S
You should probably do some smoothing on the analog input in case the scale is jiggling. Then once every second, or some reasonable interval that you determine empirically, look at the smoothed value and see if it's increased some minimum value since the last sample. If it hasn't, add one to the bad check count. If it has, deduct one from the count if > 0. If the bad check count gets to three (or a number you determine not to give false positives), annunciate the alarm.
 
Top