sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Why does the servo not rotate more than +/-180 in sketchyphy

    Scheduled Pinned Locked Moved SketchyPhysics
    14 Posts 2 Posters 9.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Anton_S
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • Y Offline
        youthreewire
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • Y Offline
          youthreewire
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • Y Offline
            youthreewire
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • A Offline
              Anton_S
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • Y Offline
                youthreewire
                last edited by

                Impressive...Thanks

                1 Reply Last reply Reply Quote 0
                • Y Offline
                  youthreewire
                  last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Anton_S
                    last edited by

                    There are two ways of doing it:

                    1. Change slider min/max parameters. Set slider controller to:
                      slider("range_control", 0, -5, 5)
                    2. Take the current slider ratio, subtract 0.5 from it, and multiply it by 10:
                      (slider("range_control") - 0.5) * 10
                    1 Reply Last reply Reply Quote 0
                    • Y Offline
                      youthreewire
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        Anton_S
                        last edited by

                        Here is a SP3.2 compatible example:


                        motor-servo.skp

                        1 Reply Last reply Reply Quote 0
                        • Y Offline
                          youthreewire
                          last edited by

                          Thanks I will give it a try and let you know about my progress.

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement