Help with A2Plus. Crankshaft, Connecting Rod and Piston Restrictions and Movements

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Help with A2Plus. Crankshaft, Connecting Rod and Piston Restrictions and Movements

Postby dcapeletti » Tue Oct 23, 2018 2:57 pm

Hi, I'm trying to make a crankshaft system, connecting rod and gate or piston. The idea is to apply restrictions in such a way that when the crankshaft rotates upwards, there is an elevation of the gate. This with the restrictions that the model already has works properly.

But the problem is that when the crankshaft rotates, the connecting rod is lifted vertically, which also moves the piston or gate sideways.
In practice, the gate should move vertically but not sideways and the connecting rod should take an angle. Attached is a video recording to show what's going on. https://peertube.video/videos/watch/507 ... f02edb4d04

I hope you can help me on the restriction I must apply to achieve the movement of a crankshaft, connecting rod and gate or piston.

Thanks
Attachments
Vielva.FCStd
(13.8 KiB) Downloaded 7 times
Piston.FCStd
(13.19 KiB) Downloaded 8 times
Compuerta.FCStd
(17.61 KiB) Downloaded 7 times
Cigueñal.FCStd
(12.29 KiB) Downloaded 7 times
Assembly a2plus.FCStd
(14.23 KiB) Downloaded 11 times
kbwbe
Posts: 860
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Help with A2Plus. Crankshaft, Connecting Rod and Piston Restrictions and Movements

Postby kbwbe » Tue Oct 23, 2018 3:43 pm

dcapeletti wrote:
Tue Oct 23, 2018 2:57 pm
Hi, I'm trying to make a crankshaft system, connecting rod and gate or piston. The idea is to apply restrictions in such a way that when the crankshaft rotates upwards, there is an elevation of the gate. This with the restrictions that the model already has works properly.

But the problem is that when the crankshaft rotates, the connecting rod is lifted vertically, which also moves the piston or gate sideways.
In practice, the gate should move vertically but not sideways and the connecting rod should take an angle. Attached is a video recording to show what's going on. https://peertube.video/videos/watch/507 ... f02edb4d04

I hope you can help me on the restriction I must apply to achieve the movement of a crankshaft, connecting rod and gate or piston.

Thanks
Your piston is not guided in X-direction in space. Do a new file and create a cube. Import this cube to your assembly (important). Place the import biside your piston and set the "fixedPosition" property of the cube to "True". Do a planeCoincident constraint between the dummy cube. Now the piston is guided. If you do not want to see the cube, make it invisible. Constraints still work.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.27, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Help with A2Plus. Crankshaft, Connecting Rod and Piston Restrictions and Movements

Postby dcapeletti » Wed Oct 24, 2018 12:00 pm

Hello, thank you very much for your help, now it worked as expected.

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints.

Thanks
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Help with A2Plus. Crankshaft, Connecting Rod and Piston Restrictions and Movements

Postby dcapeletti » Wed Oct 24, 2018 12:18 pm

dcapeletti wrote:
Wed Oct 24, 2018 12:00 pm
Hello, thank you very much for your help, now it worked as expected.

Now what I would like to achieve is an animation. For example when I change the crankshaft angle using the python API with this command:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(-90,0,0), App.Vector(0,0,0)) 
A2Plus automatically resolves the constraints. Maybe there is an A2plus API that allows you to solve the constraints.

Thanks
Solved:

In python console:

Code: Select all

App.ActiveDocument.Cigue__al_001.Placement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) 

from a2p_solversystem import SolverSystem
solver  = SolverSystem()
solver.solveSystem(App.ActiveDocument)
Sample video https://peertube.video/videos/watch/6f0 ... 06eb4f0d81