I would like to build a mechanical module that acts like a spring with electronically controllable stiffness (spring rate).
For instance, let's imagine a solid, metallic cube, 0.5 m each side. On the top side of the cube, there is a chair sitting on top of a solid mechanical spring. When you sit on the chair, it would go down proportionally to your weight, and inversely proportional to the spring's rate.
What I want is that this spring's rate be electronically adjustable in real time, for instance a microcontroller system might increase the spring's rate when it detects a larger weight.
I'm using this example to best describe what I want to achieve because I'm not a robotics specialist and I don't know the inside terms.
Is there already an electro-mechanic module as the one I'm describing? (obviously nevermind the cube and the chair, it's the spring I'm interested in).