A method of controlling aerosol production in an aerosol-generating system , the system comprising: an aerosol-generating element; a housing having an air inlet and an air outlet , a flow channel being defined through the housing from the air inlet to the air outlet , the flow channel providing a flow of air past the aerosol-generating element when a user puffs on the system; and a flow sensor configured to detect an air flow in the flow channel indicative of the user taking a puff, the method comprising the following chronological steps: increasing a power supplied to the aerosol-generating element from a power P0 to at least a power P1 when the flow sensor detects that a flow rate of the air flow is greater than a first threshold ; decreasing the power supplied to the aerosol-generating element to a power P2, wherein the power P2 is less than the power P1 , when the flow sensor detects that the flow rate of the air flow is less than a second threshold , the second threshold being, or being indicative of, a flow rate which is a predetermined first proportion of a first maximum flow rate (301 max1 ) sensed by the flow sensor; and increasing the power supplied to the aerosol-generating element if the flow sensor detects that the flow rate of the air flow is greater than a third threshold , the third threshold being greater than the second threshold , before detecting that the flow rate of the air flow is less than an end of puff threshold , the end of puff threshold being less than the second threshold . an aerosol-generating element; a housing having an air inlet and an air outlet , a flow channel being defined through the housing from the air inlet to the air outlet , the flow channel providing a flow of air past the aerosol-generating element when a user puffs on the system; and a flow sensor configured to detect an air flow in the flow channel indicative of the user taking a puff, the method comprising the following chronological steps: increasing a power supplied to the aerosol-generating element from a power P0 to at least a power P1 when the flow sensor detects that a flow rate of the air flow is greater than a first threshold ; decreasing the power supplied to the aerosol-generating element to a power P2, wherein the power P2 is less than the power P1 , when the flow sensor detects that the flow rate of the air flow is less than a second threshold , the second threshold being, or being indicative of, a flow rate which is a predetermined first proportion of a first maximum flow rate (301 max1 ) sensed by the flow sensor; and increasing the power supplied to the aerosol-generating element if the flow sensor detects that the flow rate of the air flow is greater than a third threshold , the third threshold being greater than the second threshold , before detecting that the flow rate of the air flow is less than an end of puff threshold , the end of puff threshold being less than the second threshold . increasing a power supplied to the aerosol-generating element from a power P0 to at least a power P1 when the flow sensor detects that a flow rate of the air flow is greater than a first threshold ; decreasing the power supplied to the aerosol-generating element to a power P2, wherein the power P2 is less than the power P1 , when the flow sensor detects that the flow rate of the air flow is less than a second threshold , the second threshold being, or being indicative of, a flow rate which is a predetermined first proportion of a first maximum flow rate (301 max1 ) sensed by the flow sensor; and increasing the power supplied to the aerosol-generating element if the flow sensor detects that the flow rate of the air flow is greater than a third threshold , the third threshold being greater than the second threshold , before detecting that the flow rate of the air flow is less than an end of puff threshold , the end of puff threshold being less than the second threshold . <EOS>