A new coordinated, traffic-responsive ramp metering algorithm has been designed for Minnesota's freeways based on density measurements, rather than flows. This is motivated in view of recent research indicating that the critical value of density at which capacity is observed is less sensitive and more stable than the value of capacity, thereby resulting in more effective control. Firstly, we develop a methodology to estimate densities with space and time based on data from loop detectors. The methodology is based on solving a flow conservation differential equation (using LWR theory) with intermediate (internal) freeway mainline boundaries, which is faster and more accurate from previous research using only external boundaries. To capture the capacity drop phenomenon into the first order model we utilize a fundamental diagram with two values of capacity and we provide a memory-based methodology to choose the appropriate value in the numerical solution of the problem. Secondly, with respect to ramp metering, the main goals of the algorithm are to delay the onset of the breakdown and to accelerate system recovery when ramp metering is unable due to the violation of maximum allowable ramp waiting time. The effectiveness of the new control strategy is being assessed by comparison with the currently deployed version of the Stratified Zone Algorithm (SZM) through microscopic simulation of a real 12-mile, 17 ramp freeway section. Simulations show a decrease in the delays of mainline and ramp traffic, an improvement 8% in the overall delays and avoidance of the maximum ramp delay violations.