Complete implementation for calibrating and setting power caps