I made a raspberry pi car. The pi is powered by two 18650 (Breewell New Multipurpose Flat Top 18650 Battery 2000 mAh 3.7 Volt Lithium Genuine Rechargeable Battery -Pack of 2 https://www.amazon.in/dp/B07JLKTPK3/ref=cm_sw_r_sms_apap_JAvTSOoPksPLB) and a power bank circuit(NextGeek 3. 7V to 5V 1A 2A Boost Module DIY Power Bank Circuit Board Built in 18650 Lithium Battery Protection https://www.amazon.in/dp/B07G9N3FYN/ref=cm_sw_r_cp_apa_i_DXZqCbG4AAPMC). The motors are connected to an L298 motor driver. Whenever the power bank circuit shows about 50% power, the motors suddenly slow down and the torque reduces immensely. What am I experiencing here? Would adding a transistor between the RPI GPIO and the motor bridge inputs help?
In general it's a bad idea to power motors from a boost module. That module is probably struggling with motor startup currents as it is, and fails to operate once its input voltage gets low enough.
A better architecture would be to get an 7.4V battery (2 cells in series) for the motors, and step down that voltage to 5V for the RPi which has much more predictable current consumption.