sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

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

    scheduled pinned locked moved SketchyPhysics
    14 Posts 2 Posters 9.5k Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • 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.

      one-reply-to-this-post last-reply-time 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.

        one-reply-to-this-post last-reply-time 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.

          one-reply-to-this-post last-reply-time 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.

            one-reply-to-this-post last-reply-time reply quote 0
            • Y Offline
              youthreewire
              last edited by

              Impressive...Thanks

              one-reply-to-this-post last-reply-time 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?

                one-reply-to-this-post last-reply-time 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
                  one-reply-to-this-post last-reply-time 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.

                    one-reply-to-this-post last-reply-time reply quote 0
                    • A Offline
                      Anton_S
                      last edited by

                      Here is a SP3.2 compatible example:


                      motor-servo.skp

                      one-reply-to-this-post last-reply-time reply quote 0
                      • Y Offline
                        youthreewire
                        last edited by

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

                        one-reply-to-this-post last-reply-time 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