DC Motor Simulation in Three.js β€” interactive demo + source code

Hi everyone,

I made a 3D DC motor simulation using Three.js. It has:

  • Interactive controls for supply voltage and load torque

  • Real-time display of RPM and current

  • Clickable parts (shaft, windings, commutator, etc.) with info overlays

  • Physics-based motor model (electrical + mechanical)

:link: Live Demo: https://alanjoseph77.github.io/DC_MOTOR_3D/
:open_file_folder: Source Code: https://github.com/alanjoseph77/DC_MOTOR_3D

I’d love to hear feedback on:

  • Performance / optimization tips

  • Visual improvements

  • Physics realism

  • UI / usability enhancements

Thank you!

9 Likes

Looks nice.

I would reduce the length of the shaft on both sides - I’m afraid I’ll poke my eye out.

FYI, you can use β€œlink” to allow readers to simply click on the addresses, rather than requiring them to cut and paste.

2 Likes

I really wanted this model, thank you so much for it!!:ok_hand:

1 Like

It will look awesome if the tooltips don’t block the view of model.

1 Like

Thank you for the feedback , I have updated it.

Thank you…:grinning_face:

Thank you for the feedback , I have updated it.

One more suggestion. You might add at least a partial version of the outer case, so that people understand what the magnets on the motor are reacting with.

And, if you want a simple example of something that creates torque, you could add a little propeller to the end of the shaft with variable pitch blades. Increasing the blade angle would increase torque and making the blades almost flat would decrease torque.

You could easily make several variations, such as an AC motor and if you want to flip that around, you could turn the motor into a generator with wind causing the propeller to rotate.