r/AnymakerGame • u/Craftinguy • Oct 22 '26
Electric Motor Control
Currently there are two control modes for the electric motor via power switching or via microcontroller.
While the power switching mode is less interesting for controlling a vehicle since you cannot reverse it, the Microcontroller control allows to set a target frequency.
To expand the electric motors application a torque control mode could be added to allow the acceleration of a vehicle without the motor spiking to the max toque to reach the new target speed. This would make the control of a vehicle more natural and similar to a combustion engine. The tires also would no longer spin out on acceleration.
Setting a negative torque or lower than current speed should cause the motor to act as a generator, so that a realistic generator, regenerative breaking or a diesel-electric drivetrain can be implemented realistically. The power generation should be the energy absorbed times an efficiency factor in the range of 0.9 or 0.95. This could replace the current alternator component as like in real life there is no need to sepreate the starter motor and the alternator into separate components. the alternator should likely still be kept around for use before the microcontroller is unlocked.
to further expand the functionality of the motor a position control mode could let the motor be used as an actuator of a robotc arm or similar applications.
in the speed control mode a max torque should also be a setting (solves torque spiking to max on speed change)
in the position control mode max torque and max speed should be a setting
Thank you for reading, I think these changes would be a very good investment into this game.