Jump to content
THIS IS THE TEST SITE OF EUROBRICKS! ×
THIS IS THE TEST SITE OF EUROBRICKS!

Recommended Posts

Posted

Hey, I am trying to code my motor to rotate 45 degrees one way, stop, then rotate 90 degrees the other way and 90 degrees the other way and loop so I get a rocking back and forwards motion, thought this would be easy to do, but I am find so many problems!

Firstly its not simple to get the engine to go back to 0 position, so at the moment I am doing this manually before I start the sequence. Then I seem to have problems with the positioning never being precise over time it ends up not going back to the center and can be over 90 degrees out after a few minutes! Also within my code (which is probably wrong) it seems to juts decide to jump past come commands without any reason.

Attached the method that I ended up with that still didnt work (Sorry I accidentally downloaded the latest version of Powered Up app!!!)

Currently I am looking at building the motion mechanically with techic lego bits rather than motor motion, any tips on a good build would also be appreciated.

Thanks

Liam

 

IMG_7622.jpg

Posted (edited)

The method used in, for example, windshield wipers, is you have a shorter spinning arm connected to a larger arm that only moves back and forth.  For the angle to be 90 degrees, the ratio of the two arms is around sqrt(2) times longer.  Though if they aren't aligned exactly parallel at the center, it changes the ratio.

dQYIIGc.png

Blue dotted line showing that the center of the circle is aligned to the endpoints of the arc, thus the linkage arm moves exactly 2R side to side for both.  If you keep the longer arm pivot point and move the shorter one up and down, it'll increase the angle moved by the long arm.

Edited by Stereo
Posted
5 hours ago, Stereo said:

The method used in, for example, windshield wipers, is you have a shorter spinning arm connected to a larger arm that only moves back and forth.  For the angle to be 90 degrees, the ratio of the two arms is around sqrt(2) times longer.  Though if they aren't aligned exactly parallel at the center, it changes the ratio.

dQYIIGc.png

Blue dotted line showing that the center of the circle is aligned to the endpoints of the arc, thus the linkage arm moves exactly 2R side to side for both.  If you keep the longer arm pivot point and move the shorter one up and down, it'll increase the angle moved by the long arm.

Thank you v ery much for your reply, it looks very intresting but unfortunatley I have no idea how I would actually implement this!

Posted

hbL1TBC.jpeg

Here's one way you could do it - the red 3L beam goes to the motor, the grey 3x3 turns 90 degrees back and forth as it spins. Middle shows one extremity, bottom shows the other.  Depends what space you're fitting things into.  The yellow 5L and grey 3x5 can be made longer if that works better.

Posted

 

15 hours ago, Liam Owen said:

Firstly its not simple to get the engine to go back to 0 position, so at the moment I am doing this manually before I start the sequence. Then I seem to have problems with the positioning never being precise over time it ends up not going back to the center and can be over 90 degrees out after a few minutes! Also within my code (which is probably wrong) it seems to juts decide to jump past come commands without any reason.

Going mechanical is the Lego way :classic:

Anyway, it seems you are codding like this: move 90º, move -90º, move 90º…..

Doing it this way means that errors accumulate, and you might get what you got, 90 degrees out of sync.

Instead, I suggest something like: go to 45º angle, go to -45º angle, go to 45º angle… this way, errors do not accumulate... and you wont even need to go to 0 to initialize.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...