Stringent emissions and fuel economy regulations motivate the investigation of advanced combustion strategies such as premixed charge compression ignition. However, controlling premixed charge compression ignition is challenging as there is no direct trigger for the combustion event. In addition, fuel-flexible applications must account for the impact of variable fuel properties on the premixed combustion proces. This paper identifies the control challenges in fuel-flexible premixed charge compression ignition and presents a control strategy for mitigating the differences in combustion phasing, the increases in nitrogen oxide emissions, and the decreases in power output typically encountered when operating with biodiesel in premixed operating conditions. When biodiesel is used in premixed operating conditions with the engine operating with the stock calibration for diesel fuel, the timing of the start of combustion and the peak heat release can shift by over 2° crank angle and 4° crank angle respectively, the nitrogen oxide emissions can increase by over 100%, and the torque output can drop by over 30% with respect to the engine performance with diesel. The control techniques presented in this paper use a biodiesel estimation method in conjunction with a physics-based accommodation strategy based on accounting for the differences between the fuel energy densities and the oxygen contents of diesel and biodiesel. This control method dictates fueling quantities on an energy basis instead of the traditional mass basis and maintains a nearly constant in-cylinder oxygen fraction for both diesel and biodiesel. At the premixed operating points considered in this study, this strategy is demonstrated to eliminate increases in the biodiesel nitrogen oxide emissions, decreases in the torque, and shifts in the combustion timing. The results demonstrate, first, that combustion timing control and nitrogen oxide emissions control can also be achieved through control of the in-cylinder oxygen fraction alone and, second, that energy-based fueling provides consistent in-cylinder oxygen fractions for diesel and biodiesel while also matching the torque outputs for the two fuels when considered at the same premixed operating point (the same speed, intake manifold temperature, charge flow, effective compression ratio, and combustion timing).