A Flight Instructor reported a NMAC on downwind after departing when a subsequent departing aircraft deviated from their clearance.
Synopsis
A Flight Instructor reported a NMAC on downwind after departing when a subsequent departing aircraft deviated from their clearance.
Narrative
I was teaching my private student landings where we were doing stop and goes in the ZZZ pattern in Aircraft X. After taking off from ZZZ for a pattern; my student was instructed to extend the upwind leg. After extending upwind for a half mile; we were instructed to make right traffic. Aircraft Y (Cherokee) received takeoff clearance soon after us and was told after taking off that there was traffic turning right crosswind which was us. After not responding for 5 seconds; Aircraft Y asked ATC to repeat his instruction. It was at this point that the Cherokee started veering off course from runway heading. After ATC repeated their traffic advisory; Aircraft Y said they will be looking out for the traffic. 2 seconds later; ATC said:'Aircraft Y you're veering to the right a little bit; I need you back on runway heading.'3 seconds later. 'Back on runway heading; Aircraft Y'At this point; Aircraft X was in the right downwind for Runway XX. I did not see the Cherokee at all because they were climbing from underneath while I was at traffic pattern altitude. ATC then said. 'Aircraft X turn to your left; you're pulling too close to the runway.'At that moment; my student looked left to clear the turn and began to turn left while I looked out front and noticed the Cherokee right off of my nose. I took controls and made a steep right bank to maneuver out of the way of the traffic. I responded with. 'Maneuvering for traffic Aircraft X.'Cherokee was then instructed to contact the departure frequency; and I continued the flight as normal. ATC didn't seem to show any urgency of the imminent danger of the near midair collision.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.