Powering Lego Motors w/ SparkFun Auto pHat

I recently started a project where I wanted to drive a Lego vehicle with a raspberry pi. I bought a pi and the SparkFun Auto pHat to use. I figured out how to run a Lego Power Functions motor using the USB power input on the hat. However, this makes the motor act very strangely, when I use the myMotor package that SparkFun recommends, the motor refuses to run at any other speed other than 250-260. I thought this might be due to the voltage requirements not being met, the Lego power function motors use 9V while I was only giving it 5V. I tried using a Lego Power Functions battery pack and a retrofitted Power Functions extension cord soldered to the MTR and GND external power pins. Unfortunately, this doesn’t seem to have done anything. I used a multimeter to find which of the outside wires (since they deliver the power) were positive and negative. I attached the positive to the MTR pin and the negative to the GND pin, but it doesn’t seem to be delivering power. When I use the example 1 code for running a standard motor on the software page for the auto pHat, the increase in speed doesn’t make the motor start at all, it only outputs a correspondingly loud humming noise. I have tried plugging in the primary power (5V) into alternatively both the pi directly and the pHat. When plugged into the pHat, it works but with the earlier problem as if it is ignoring the secondary power for the motors. When plugged into the pi, the motor doesn’t work at all. My guess is that I didn’t get something right with the Lego Power Functions battery, but I am not sure what to try. Has anyone tried using Lego motors with the auto pHat and could point me in the right direction, or is my setup close but I messed something up/missed a step? At this point I don’t know how to go forward with this, any advice or tips would be appreciated.

The SparkFun product I am using: https://learn.sparkfun.com/tutorials/sp … figuration

Note that wihtout a heatsink 9v is the MAX for the pHat; my guess is that the motors are only getting enough juice to run at/near the full-duty cycle…

Try using a smaller motor and/or a higher-power motor driver