Why does the servo not rotate more than +/-180 in sketchyphy
-
I tried configuring servo before, but never got to work properly over 180 degrees. Although, you can use a motor joint and control it with script to achieve something that works even better than sp servo joint.
-
Motor joint has velocity control but how to incorporate position control in a motor joint in sketchyphysics is not known. I think we need to modify it in the scripts some where or the newton physics dll to allow for more that 180 deg rotation. Anyone.. any more ideas?
-
Yeah, that would be great, but we don't have C++ source code to do that. We only have the Ruby source code, but it doesn't contain the code that tells how a servo should work. Most if not all the physics engine related code is within the C++ source which we don't have access to.
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.
-
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement