Basic Motor Example In An Assembly

87 views
Skip to first unread message

T-Lind

unread,
Feb 20, 2024, 9:58:21 PM2/20/24
to ProjectChrono
Hi there,

Hopefully this isn't too much trouble, I'm just getting into Project Chrono.

I'm using PyChrono and am testing out this program here (the STEP file is small so I committed it to GitHub). It's just a simple test, but I'm trying to get the shaft to rotate along the same cylindrical axis of the motor.

I tried a bunch of different configurations, but nothing seems to work. Any help would be appreciated!
 

Dario Mangoni

unread,
Feb 21, 2024, 3:26:24 PM2/21/24
to ProjectChrono
Hi T-Lind,
the "nothing seems to work" means that the rotating axis is not matching your expectations?
Can you show a picture? Maybe one with CoG drawing enabled, one with Link frames enabled?

Why don't you try with something simpler first? Without many rotations in between?
We also have plenty of demos that surely cover also this simple example.

Dario

T-Lind

unread,
Feb 21, 2024, 6:45:41 PM2/21/24
to ProjectChrono
"the "nothing seems to work" means that the rotating axis is not matching your expectations?" - Correct

My assembly goes from looking like this:
Screenshot 2024-02-21 173829.png
to this distorted figure:
Screenshot 2024-02-21 173917.png
I'm not entirely sure how to display link frames or the CoG, even after looking around for it. And I did look at quite a few of the Pychrono demos (particularly the ones involving motors), but they all seem to use an outdated version and many do not work. In this program I made, a ball is thrown at a cylinder, knocking it over.
Screenshot 2024-02-21 174115.png
Are there any up-to-date resources you'd recommend looking at (using PyChrono, preferably)? I want to avoid wasting your time here.

Thank you for your help!

T-Lind

unread,
Feb 21, 2024, 7:30:39 PM2/21/24
to ProjectChrono
I've also set up this simpler example here:
Screenshot 2024-02-21 182758.png
If you can help me figure this out, I'd be more than happy to write documentation related to this example for Project Chrono.

Dario Mangoni

unread,
Feb 22, 2024, 10:25:54 AM2/22/24
to ProjectChrono
I don't know what you are trying to do: in your latest example 'shaft' and 'base' have two links pointing in two different directions. Did you want to link to ground instead?
Moreover, the motor already provides the revolute joint embedded. So you are duplicating the joint.

And also, you enabled collision straight away: in this case it's not really needed and I would disable it for now.

I strongly recommend you to start from demos and then add on top of them.
BTW, by pressing the 'i' button of the keyboard during simulation you can get a panel in which you can enable some settings.

Here is the documentation about links and motors (depending on your PyChrono version there might be some differences):

Here some useful demos:

T-Lind

unread,
Feb 22, 2024, 10:52:20 AM2/22/24
to ProjectChrono
Thank you very much. Those examples should be more than enough to help me get started.
Reply all
Reply to author
Forward
0 new messages