You CAN put a comma before a 'but' if the sentences before the 'but' and after it can form independent sentences. "You can turn the machine on or off. You must remember that the generator (etc)..."

It's entirely up to you.