To reduce possible machine damage and scrap during a power outage the Power Failure Backup Module controls the energy necessary for motor control when power failure occurs until the machine enters a safe state. Power failure backup can be used for CNC control power backup, brake control against gravity, stop distance reduction and retract functions during a power failure.