In this work, we apply fuzzy logic method to address the traffic density control problem in a macroscopic level freeway environment with ramp metering. The second-order traffic flow model is firstly formulated. Then traffic density is selected as the control variable in place of traffic occupancy. Based on the traffic flow model and in conjunction with nonlinear feedback theory, a fuzzy logic based traffic density controller is designed. The ramp metering rate is determined by the fuzzy control according to density tracking error and error variation. Triangle curves are used for the membership functions of the fuzzy variables. The rule base including 56 fuzzy rules is also established. Finally, the fuzzy logic based feedback controller is simulated in Matlab software. Simulation results show that this method has good dynamic and steady-state performance, and can achieve an almost perfect tracking performance.