A method of removing at least one of nitrogen or phosphorus from wastewater, comprising: - collecting data from a plurality of sensors which are in communication with a central controller, wherein each sensor measures at least one parameter in a selector, i.e. zone, of a wastewater treatment system; - receiving the data from the plurality of sensors in the central controller, - wherein the central controller comprises a plurality of control loops, - wherein each control loop is adapted to control a denitrification process, a chemical phosphorus removal process, or an enhanced biological phosphorus removal process in a selector and i) at least two of the control loops receive data from at least two common sensors coupled to different selectors of the wastewater treatment system and/or ii) at least one control loop receives data from at least one other control loop, - wherein the central controller is adapted to utilize the data received from the plurality of sensors to determine a level of a chemical compound required to adjust the level of nitrogen or phosphorus present in the wastewater to a preselected target level, - wherein the chemical compound is selected from the group consisting of methanol, acetate, propionate, carbohydrates, glycerol, hydrocarbons, alcohols and combinations thereof, or wherein the chemical compound is selected from the group consisting of calcium and calcium salts, aluminum and aluminum salts, iron and iron salts, magnesium and magnesium salts, rare earth metals and rare earth metal salts, metal oxides, and combinations thereof; and - sending a control signal from the central controller to at least one chemical delivery system to dispense an amount of the chemical compound into the wastewater effective to achieve the preselected target level of nitrogen or phosphorus in the wastewater. - collecting data from a plurality of sensors which are in communication with a central controller, wherein each sensor measures at least one parameter in a selector, i.e. zone, of a wastewater treatment system; - receiving the data from the plurality of sensors in the central controller, - wherein the central controller comprises a plurality of control loops, - wherein each control loop is adapted to control a denitrification process, a chemical phosphorus removal process, or an enhanced biological phosphorus removal process in a selector and i) at least two of the control loops receive data from at least two common sensors coupled to different selectors of the wastewater treatment system and/or ii) at least one control loop receives data from at least one other control loop, - wherein the central controller is adapted to utilize the data received from the plurality of sensors to determine a level of a chemical compound required to adjust the level of nitrogen or phosphorus present in the wastewater to a preselected target level, - wherein the chemical compound is selected from the group consisting of methanol, acetate, propionate, carbohydrates, glycerol, hydrocarbons, alcohols and combinations thereof, or wherein the chemical compound is selected from the group consisting of calcium and calcium salts, aluminum and aluminum salts, iron and iron salts, magnesium and magnesium salts, rare earth metals and rare earth metal salts, metal oxides, and combinations thereof; and - wherein the central controller comprises a plurality of control loops, - wherein each control loop is adapted to control a denitrification process, a chemical phosphorus removal process, or an enhanced biological phosphorus removal process in a selector and i) at least two of the control loops receive data from at least two common sensors coupled to different selectors of the wastewater treatment system and/or ii) at least one control loop receives data from at least one other control loop, i) at least two of the control loops receive data from at least two common sensors coupled to different selectors of the wastewater treatment system and/or ii) at least one control loop receives data from at least one other control loop, - wherein the central controller is adapted to utilize the data received from the plurality of sensors to determine a level of a chemical compound required to adjust the level of nitrogen or phosphorus present in the wastewater to a preselected target level, - wherein the chemical compound is selected from the group consisting of methanol, acetate, propionate, carbohydrates, glycerol, hydrocarbons, alcohols and combinations thereof, or wherein the chemical compound is selected from the group consisting of calcium and calcium salts, aluminum and aluminum salts, iron and iron salts, magnesium and magnesium salts, rare earth metals and rare earth metal salts, metal oxides, and combinations thereof; and - sending a control signal from the central controller to at least one chemical delivery system to dispense an amount of the chemical compound into the wastewater effective to achieve the preselected target level of nitrogen or phosphorus in the wastewater.