PLC control hitting energy and forging process