Bang bang is a very simple, and aggressive velocity control that at it’s simplest form has 2 powers.
the code is simple. If speed is to low, set motors to high and if it is too fast set motors to low.
Have you tried using smaller wait times between encoder checks. For bang bang to work, it is best (in my experience) to have a wait time of 10-30ms between checks.