According to the implementation of fuzzy control algorithm in MCU, based on the existing sltank fuzzy control system in Matlab/Simulink, the 2-D lookup table model of fuzzy controller is established. The lookup table model conversion, MIL and code generation are carried out by dSPACE Targetlink automatic code generation tool. Generated code is downloaded to controller, the sdf file generated by the controlled object is downloaded to the Simulator for hardware-in-the-loop simulation test. The results show that the control effect of fuzzy logic algorithm in MCU is consistent with Matlab off-line simulation results, which effectively solves the problem of fuzzy controller implementation in MCU.