{"id":32,"date":"2008-10-09T09:00:43","date_gmt":"2008-10-09T14:00:43","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2008\/10\/09\/challenge-metronome-and-cart-equations-of-motion\/"},"modified":"2008-10-09T09:00:43","modified_gmt":"2008-10-09T14:00:43","slug":"challenge-metronome-and-cart-equations-of-motion","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2008\/10\/09\/challenge-metronome-and-cart-equations-of-motion\/","title":{"rendered":"Challenge: Metronome and Cart Equations of Motion"},"content":{"rendered":"<p><span>I haven\u2019t\r\nseen much activity on the <\/span><a\r\nhref=\"https:\/\/blogs.mathworks.com\/seth\/2008\/09\/30\/challenge-metronome-synchronization\/\"><span\r\n>Metronome Synchronization Challenge<\/span><\/a><span\r\n>, so I want to provide a peak at the basis\r\nfor my solution.\u00a0 I took the approach of modeling a pendulum, and then linking\r\nits dynamics to the dynamics of a cart.\u00a0 The challenge is choosing the right\r\ncoordinate systems to assign to each of these bodies, even though they move\r\ntogether.<\/span><\/p>\r\n\r\n<p><strong><span>The Pendulum<\/span><\/strong><\/p>\r\n\r\n<p><span>If the\r\npendulum was all by itself, we could describe its motion by modeling the angle,\r\n<\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image001.png\"><\/span><span\r\n>, as it deflects from vertical.\u00a0 The\r\nonly force on the pendulum bob is gravity.\u00a0 Because the pendulum is constrained\r\nto rotation about the pivot point, we only need the component of gravity in pendulum\r\nframe of reference.<\/span><\/p>\r\n\r\n<p><span><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/pendulumForcesDueToGravity.png\"\r\nalt=\"Pendulum forces due to gravity\">\u00a0<\/span><\/p>\r\n\r\n<p><span>If we\r\nincorporate the motion of the cart, we find the linking of the acceleration of\r\nthe cart to the acceleration of the pendulum bob.\u00a0 If the cart is accelerating,\r\nthe reference frame of the pendulum accelerates, and this means that the\r\npendulum will experience an opposite force\/acceleration.<\/span><\/p>\r\n\r\n<span><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/cartForcesOnPendulum.png\"\r\nalt=\"Accelerations of a cart on the pendulum\"><\/span><\/p>\r\n\r\n<p><span>Combining\r\nthese two ideas in the <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image001.png\"><\/span><span\r\n>\u00a0frame centered on the pendulum pivot,\r\nwe can write the pendulum equation of motion.<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=186 height=39 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image006.png\"><\/span><\/p>\r\n\r\n<p><strong><span>Momentum\r\nin the system<\/span><\/strong><\/p>\r\n\r\n<p><span>To\r\nunderstand the acceleration of the cart, I want to look at the change in the <\/span><span style='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";position:relative;\r\ntop:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image007.png\"><\/span><span\r\n>\u00a0component of the momentum.\u00a0 Here are\r\nsome definitions:<\/span><\/p>\r\n\r\n<p><span>Length of\r\nthe pendulum:\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0<\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image008.png\"><\/span><span\r\n><br>\r\nMass of the pendulum bob:\u00a0 <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=14 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image009.png\"><\/span><span\r\n><br>\r\nMass of the cart:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";position:relative;\r\ntop:5.5pt'><img width=14 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image010.png\"><\/span><\/p>\r\n\r\n<p><span>The momentum\r\nof the pendulum bob in the <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image007.png\"><\/span><span\r\n>\u00a0direction<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=126 height=23 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image011.png\"><\/span><\/p>\r\n\r\n<p><span>The momentum\r\nof the cart is<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=77 height=22 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image012.png\"><\/span><\/p>\r\n\r\n<p><span>The friction\r\nof the cart on the surface is the only resistance I want to model in the system,\r\nand we can describe this force as proportional to the velocity, <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=18 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image013.png\"><\/span><span\r\n>. This represents of the change of\r\nmomentum.<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=112 height=46 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image014.png\"><\/span><\/p>\r\n\r\n<p><span>Combine\r\nthese terms to describe the momentum in the <\/span><span style='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";position:relative;\r\ntop:5.5pt'><img width=9 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image007.png\"><\/span><span\r\n>\u00a0direction.<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=203 height=46 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image015.png\"><\/span><\/p>\r\n\r\n<p><span>Up to this\r\npoint, I have looked at the problem of a single pendulum on a cart.\u00a0 Adding\r\nanother pendulum is just another momentum term, and to keep track of the\r\npendulums we will introduce <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=15 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image016.png\"><\/span><span\r\n>\u00a0and\u00a0 <\/span><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\";\r\nposition:relative;top:5.5pt'><img width=16 height=22\r\nsrc=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image017.png\"><\/span><span\r\n>.<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=315 height=46 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image018.png\"><\/span><\/p>\r\n\r\n<p><span>Taking the\r\nderivative of this equation gives us the acceleration of the cart:<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=476 height=32 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image019.png\"><\/span><\/p>\r\n\r\n<p><strong><span>System\r\nEquations<\/span><\/strong><\/p>\r\n\r\n<p><span>This\r\nequation for the cart, along with the dynamics of the pendulum provides the\r\nequations of motion for the system.\u00a0 Rewriting these as the highest order\r\nderivatives gives us something we can create in Simulink.<\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=479 height=39 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image020.png\"><\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=205 height=39 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image021.png\"><\/span><\/p>\r\n\r\n<p><span\r\nstyle='font-size:11.0pt;line-height:115%;font-family:\"Calibri\",\"sans-serif\"'><img\r\nwidth=206 height=39 src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/image022.png\"><\/span><\/p>\r\n\r\n<p><strong><span>Are you\r\nup to the challenge?<\/span><\/strong><\/p>\r\n\r\n<p><span>Can you\r\nmodify the model I provided in my <\/span><a\r\nhref=\"https:\/\/blogs.mathworks.com\/seth\/2008\/09\/30\/challenge-metronome-synchronization\/\"><span\r\n>last post<\/span><\/a><span\r\n> to implement these equations?\u00a0 <\/span><a\r\ntitle=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do (link no longer works)\"><span\r\n>Post your solution<\/span><\/a><span\r\n> by October 15<sup>th<\/sup> to the <\/span><a\r\ntitle=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do (link no longer works)\"><span\r\n>File Exchange<\/span><\/a><span\r\n> with the keyword <em>metronome<\/em>.<\/span><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>I haven\u2019t\r\nseen much activity on the Metronome Synchronization Challenge, so I want to provide a peak at the basis\r\nfor my solution.\u00a0 I took the approach of modeling a pendulum, and then linking\r\nits... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2008\/10\/09\/challenge-metronome-and-cart-equations-of-motion\/\">read more >><\/a><\/p>","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[50,30,29],"tags":[54,53],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/32"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}