Why does the servo not rotate more than +/-180 in sketchyphy
-
Also I dont see any proportional controller for the motor in the sketchy physics ruby files. I think Newton server takes care of this and I am guessing if we need the servo to move more than 180 we need to change this in the newton dynamics engine.
-
@anton_s said:
Yet, it is possible to tell the motor to adjust itself to a desired angle. I will upload an example tomorrow. That said, we can also create a custom servo joint in new SP release that bases of a motor joint trough some ruby scripting.
This if possible would be great.I will wait for this from you.
-
I think if we can read angle from a motor and put a proportional controller then we can integrate velocity or use the angle and impose control.
-
@youthreewire said:
I think if we can read angle from a motor and put a proportional controller then we can integrate velocity or use the angle and impose control.
You're correct! Here is an example:
motor-servo.skp
Use W,S virtual keys to control desired angle. The motor will then rotate the arrow to the desired angle. -
Impressive...Thanks
-
Hello,
I have been trying to control the motor you scripted through a slider but I want to do an extend range control.The slider value varies only between 0.0 and 1.0 .I want to do a control like -5.0 to 5.0 with the slider.How shall I change the limits of the slider?
-
There are two ways of doing it:
- Change slider min/max parameters. Set slider controller to:
slider("range_control", 0, -5, 5)
- Take the current slider ratio, subtract 0.5 from it, and multiply it by 10:
(slider("range_control") - 0.5) * 10
- Change slider min/max parameters. Set slider controller to:
-
Earlier I wrote an API to control the servos from C code.That was working well with sketchup 7 with sketchyphysics 3.2. The example you gave uses the latest version of sketchup and runs in sketchup 8 for me but my C API does not work with sketchy physics 3.5.9. So can you give me the same example with google sketchup 7 running sketchyphysics 3.2 .Please.
-
-
Thanks I will give it a try and let you know about my progress.
Advertisement