Not sure how to go from PID error to PWM duty
You need to make a distinction between the signals, the angle of the chopstick (range -90 to +90 degrees, assuming down = 0 degrees), the duty cycle of the motor (range 0-100% for zero to max speed), and the numbers in your system that represent those signals.

Do your PID mathematics in the signal domain. It doesn't matter whether you have a 11 bit ADC reading 2000 when the pendulum is at 90 to the floor, or an 8 bit ADC reading 200, they both represent 90 to the floor.

The first thing to do therefore is to draw your block diagram, and express gains, signal ranges etc in sensible signal units. Then, the first thing you do when you read an angle, scale and offset it into a signal. The last thing you do when you have a PID controller output signal is to scale and offset it into a number that will control 0-100% duty cycle at your motor.