trash compactor won't stay shut and ram gets stuck down

Our Whirlpool trash compactor, model SHC80002, won’t stay shut. Also, when we turn it on the ram works intermittently. Sometimes it starts to work but stops before the ram comes all the way up. And other times it works but only if we hold the knob on start until the cycle finishes. Thank you in advance for your repair suggestions.