If you have an older ps3 with a power switch on the back, then do step 1, otherwise do step 2.
1. Turn power off via back switch and go to step 3.
2. Unplug the ps3 for 10 seconds, then plug it back in.
3. (Optional) Turn on the ps3 via the front power button. After booted up, then hit the ps3 button on the controller and see if it syncs up. (Skip step 4)
4. Turn on the ps3 via the controller and see if it syncs up.