If the cracking only occurs with motor assistance, an error in the motor is likely. If the cracking occurs exclusively without motor assistance, the bottom bracket is probably affected. This maybe due to a loose bottom bracket or worn bearings.