Deriving a control model for a balancing robot and PID control

I am not sure where this post should be but it is closest to mechanics I guess. I am looking for help on how to derive the transfer function for a balancing robot so that I can find a PID controller properly.

I attached my derivation which involved the body and wheels. However, the result I got was simply an inverted pendulum transfer function independent of the wheels. I am not sure if this is correct or not, any help would be highly appreciated.

Thank you.

Balancing Robot Control Model.pdf (292 KB)