A broken top limit and directional switch typically causes the motor to run constantly after the ram reaches its upper travel limit. Because the motor doesn't shut off, you'll typically hear a banging or hammering noise as the motor continues to run with the ram fully lifted.
Pull the trash compactor out of the cabinet and unplug the power cord. Remove the top panel and replace the top limit and directional switch. Reassemble the trash compactor, plug in the power cord and reinstall the trash compactor in the cabinet.