I have design a bolt (M16 and pitch = 2 mm) and a nut and I want the bolt to screw in the nut. The problem is that I don’t know what are the units of speed and angular speed. I saw that it could be m/s and rad/s but it doesn’t work because when I use the formula : angular speed (RPM) = feed rate (mm/min) / pitch (mm), with a feed rate of 1 (unity unit) I get an angular speed of 3142 rad/s, and it’s impossible…
You will find in attachment a part of the code.
mgear, are you referring to the Transform.Translate command? It’s suppose to be that way.
Victoireb, can you elaborate on your issue a bit more? What is the bolt and nut currently doing? How is it different from what you want it to do? Usually if you can’t calculate the values you’re looking for you wind up playing a game of “hot and cold” while you adjust until the value is what you want. I’d suggest starting with a very low value for turnSpeed so you can see it turning, and then adjust speed until the threads no longer appear to move, like a real bolt that’s threading. With those values in hand, you now have a ratio and you can just scale.
If you want to do the hard calculations, remember that unity’s default spacial unit is understood to be meters. You will probably want to make sure your model is scaled to suit. Also the Transform.Rotate command uses Degrees instead of Radians, so make sure you’re converting to that.