webots自學筆記(九)彈簧與阻尼添加

來源:互聯網
上載者:User

標籤:where   file   ini   note   cal   span   下載   enc   ada   

        原創文章,來自部落格園,_阿龍clliu” http://www.cnblogs.com/clliu/,轉載請註明原文章出處。         

        先說明一下,暑假提前到研究生老闆打工了,任務挺重的,所以隨筆基本沒什麼時間寫了。有需要可以聯絡我。

        昨天一個網友問我webots如何加一個彈簧,說是要做柔性機器人。說道理在ADAMS裡面加彈簧就加一個spring就好了(在用webots之前我用的ADAMS),可是webots裡面好像沒有spring這個節點,查了參考資料發現webots裡面還是有的,只是webots將彈簧阻尼整合到servo裡去了。

 

        我們先看看官方參考文獻怎麼說的:

   Springs and Dampers

      The springConstant field specifies the value of the spring constant (or spring stiffness), usually denoted as K. The springConstant must be positive or zero. If the springConstant is zero (the default), no spring torque/force will be applied to the servo. If the springConstant is greater than zero, then a spring force will be computed and applied to the servo in addition to the other forces (i.e., motor force, damping force). The spring force is calculated according to Hooke‘s law: F = -Kx, where K is the springConstant and x is the current servo position as represented by the position field. Therefore, the spring force is computed so as to be proportional to the current servo position, and to move the servo back to its initial position. When designing a robot model that uses springs, it is important to remember that the spring‘s resting position for each servo will correspond to the initial position of the servo.

      The dampingConstant field specifies the value of the servo damping constant. The value of dampingConstant must be positive or zero. If dampingConstant is zero (the default), no damping torque/force will be added to the servo. If dampingConstant is greater than zero, a damping torque/force will be applied to the servo in addition to the other forces (i.e., motor force, spring force). This damping torque/force is proportional to the effective servo velocity: F = -Bv, where B is the damping constant, and v = dx/dt is the effective servo velocity computed by the physics simulator.

     

         簡單的說,就是servo節點可以輸出電機力、彈簧、阻尼,而我們一般來說要單獨的一個彈簧力或者阻尼力。這個時候需要把電機力去掉,這個不能使用ODE裡面常用的方法,將servo的type屬性設定成none。因為彈簧力和阻尼的方向向量是依賴servo的方向向量的,所以我們可以將電機力設為0,及maxfirce屬性設定為0。

 

         下面寫一個例子,一個重物在彈簧下振蕩的示範,這個例子應該是比較經典的。

 

       模型畫的比較粗糙,大家見諒,中間還空了一部分,但這個振蕩的效果是實現了。

       這個設定起來也不是很複雜,需要設定充當彈簧的那個電機設定type為線性(linear),伺服軸要做對,GIF中的黑色線。設定maxfirce = 0,springConstant > 0 就可以,這個springConstant 就是彈簧的勁度係數k。

 

      下面給出源檔案,沒看明白具體看檔案裡的設定吧。

      源檔案下載

 

webots自學筆記(九)彈簧與阻尼添加

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.