Load torque when rotating a component in PyChrono

58 views
Skip to first unread message

Luca Nanu

unread,
Dec 30, 2024, 12:32:56 PM12/30/24
to ProjectChrono
Hi all,

I'm trying to simulate a DC motor with PyChrono, able to put in rotation a component imported from SolidWorks with PyChrono plugin.

I have already implemented a motor rotation with ChLinkMotorRotationTorque() as in the following piece of code, between a motor body and an arm body (a parallelepiped block): 

link_motor = chrono.ChLinkMotorRotationTorque()
link_motor.Initialize(armMotorBody, motorBody, revolute_frame_motor)
link_motor.SetSpindleConstraint(chrono.ChLinkMotorRotationTorque.SpindleConstraint_CYLINDRICAL)
link_motor.SetName("Motor")
exported_items.append(link_motor)

# # Add the revolute joint and motor to the system
# my_system.Add(revolute_joint)
my_system.Add(link_motor)

# # Apply the calculated torque to the motor
link_motor.SetTorqueFunction(chrono.ChFunction_Const(0.1))

The problem is that this code is not considering the load torque of the component: indeed, in PyChrono, if I impose a constant torque, the component will accelerate indefinitely. However in reality the component has a load torque counteracting the imposed torque, at a certain point no acceleration will be present anymore, and the component will move with constant angular speed.

Is there a known way to introduce the load torque for a component in PyChrono?

Thank you in advance
Luca Nanu

Bret Witt, Jr

unread,
Dec 31, 2024, 1:01:09 AM12/31/24
to ProjectChrono
Hi Luca,

I'm not an expert but my approach would be to modify the torque function to include a negative torque component w.r.t motor RPM (measured mechanically in Chrono) That way, as motor RPM goes up, torque applied goes down, approximating the behavior you want 

The ideal (more precise) way would probably be to mathematically define the model of the DC motor (& circuit) you are trying to simulate, and relate it to the torque function. It would probably be like the suggestion above but with the empirical constants describing the motor (i.e k_t, k_emf) coupled with Chrono dynamics

I believe (cautiously, as I’m not much of an expert) that back EMF drives a lot of the behavior you’re looking for so this way could be best

Bret
Reply all
Reply to author
Forward
0 new messages