I took an old VESC I had lying around and since I didn't have a battery nearby, I connected it to a 42V power supply.
Everything looked normal but when I connected the VESC to my PC via USB cable, the power supply voltage dropped and the USB hub I connected the VESC to died.
Then I took a battery and connected the VESC to another USB Port on my computer and everything worked normally.
Can someone please explain what happened here?
I'm sure there are many possibilities, but I think the most likely is earths and the power supply.
I'll make some assumptions, the PC is plugged into the AC mains power with an earth pin which is connected to the PC frame/box.
The power supply is also plugged in to the mains, it may, or may not, have an earth to the frame, but the negative supply is not connected to the earth pin, but is floating higher than earth 0volts, this could be a few to many tens of volts, and it's probably going to be AC. This is caused by leakage current around the supposedly isolation of the transformer in the power supply. (The Positive side is 42 volts above this floating voltage). The VESC USB 5volts is regulated, but the whole unit is floating higher by some amount (if connected at this point.).
When the chain of ; [ power supply - VESC - USB hub - PC ] is connected, The USB hub has the PC side negative connected to 0v earth and the VESC side negative connected to a higher voltage. A current flows, USB hubs are not built heavy duty like the VESC. So it acts like a fuse. This does not explain the Power Supply voltage dropping, but in the act of fusing the USB hub may have created some other short that caused this. If the USB had not failed, the floating voltage would have cause an earth current to flow and the extra floating voltage would reduce to near zero. This would cause the typical "earth loop" noise or Hum that happens in sound systems.
On the other hand the battery is and remains floating, there is no leakage path to the AC mains. (It could happen the other way arounf too, the PC has the leakage).
You could check this by measuring the AC voltage between the negative output of the power supply and an earth point. You can check the internal impedance of the leakage source by connecting a resistor to earth and seeing how much the voltage drops.
Of course it could be something else, but that's my guess.
Cheers.
Pete L.
(Near 50 years ago an old timer at work said "When it all goes screwy, check the earths". He was right then, and often since.)