Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi community
Is it possible to drive constraint with parameter ?
In my example with slider :
I want to drive actual slider position (value in red circle) with parameter
it is possible ?
thanks
Solved! Go to Solution.
Typically, you would check the "enable regeneration value" box to turn the joint into a "driver" and make the dimension available for use in relations.
Another things, in reality, the mechanism is more complex, but is it possible to simplify it with slider in this example
in MDO, i make a servomotor with position. is it possible to control the servomotor position value with a paramter ?
in fact, i calculate my parameter value with Mathcad and i use parameter value in Creo from Mathcad.
Obsiouvly i can make a text file with slider value in Mathcad, and i import this file with servomotor table.
But is not a flexible solution...
I use this solution when i want to make a trajectory with slider ( i use sucessive lot of position for this)
What i would like :
i calculate value with Mathcad
i imput this value in a Creo parameter, and control the slider position with this parameter (Mathcad update it when i want a another value)
this is a point to point behavior, i use it to find and analisys singularity point point which Mathcad find
anyone have an idea ?
Yes, it is possible. I would suggest creating a motion skeleton and putting the parameter in the skeleton model which is used to drive the assembly of solid bodies.
Motion skeleton used to design mechanisms example.
it's difficult to apply the motion skeleton.
Because in reality my mecanism is a parallel robot.
on parallel robot is difficult tho find a direct kinematic model (because often it is not directly calculable, then Creo will not be able to solve the model, i use Mathcad to solve it)
in this case, it is easier to do the calculation with mathcad.
is for this, i want just control parameter value with Creo
in parameter for slider, i find this
it will suffice that there is a parameter for the position, after with simply relation, mathcad can drive a slider
is it possible that there are hidden parameters that control the rest of the slider definition?
Another way is:
Make some points and drive the coordinate points with Mathcad parameter
after i contrainst 3D body on this points
this way is good for point to point analysis.
In this case a calculate all points with reverse kinematic model (is simply for parallel robot)
the movement of the slider is not controlled, its position is a consequence of the Mathcad calculation
But if i use this, I can no longer make a trajectory with servomotor
If i want to use servomotor, for move slider, its necessary to use direct kinematic model
and now the movement of the slider is controlled with servomotor table. The servomotor table is consequence of the Mathcad calculation
and finally it's possible to play trajectory
the 2 previous way work, but is necessary to reassemble the 3D model... when the model is complicated it is painful
this is how I came to the conclusion that the easiest way is to control the position parameter of the slider. With an "if" loop it will be easy to choose between point-to-point operation and trajectory operation In any case, Mathcad takes care of the calculation
another option is to write same value in slider parameter
But is don't work
I'm not sure you can control the stroke length of a slider constraint with a parameter. I did a quick test and can't find a way to access the dimension...
One option that might work could be to use a slot constraint instead. Slot constraints are driven by a point on a line. You sketch a line and then connect your moving body by attaching a point on the body to the line. Other curve features work as well but I normally use a sketch. The length of the line drives the limits of translation and you could drive the length of your sketch with a parameter. Maybe give this a try?
When using a slot constraint for a linear motion, it's helpful to just specify the point on line connection in one set and then make a second general set to control the orientation of your moving body with parallel constraints.
Typically, you would check the "enable regeneration value" box to turn the joint into a "driver" and make the dimension available for use in relations.
after check the box, i don't have a new parameter for slider 😥
After many test i have 2 solutions:
first way :
i make a slider contrainst
i make point on the axis slider. This point come from a mathcad calculus parameter
after, i make a rigid contraint between this point and mobile part of a slider.
But Creo don't want this two contraint simultaneously
Then it's easy to make a "if" loop in relation window, with a choice parameter.
example:
Parameter_choice = 0
PTC_CONSTRAINT_SET for slider contrainst turn off
PTC_CONSTRAINT_SET for rigid contrainst turn on
Now the 3D assembly are driving by the rigid mathcad point
or
Parameter_choice = 1
PTC_CONSTRAINT_SET for slider contrainst turn on
PTC_CONSTRAINT_SET for rigid contrainst turn off
Now the 3D assembly are driving by freehand or by servomotor
(servomotor has driving by mathcad file, with a lot off point for make a trajectory)
Another things, just is necessary to turn off servomotor in modeltree (i don't have pro/program for automate it)
second way
the pausob's solution
check "enable regeneration value" in slider definition
and click the the slider part in 3D window, now you see the value
after it, is simply to drive the value in relation windows with mathcad parameter following the usual method
Finally, i choice the first way !
the second way make probleme because is necessary to re-open the contrainst definition window to update 3D model
for first solution , i don't have this problem, the 3D model is directly right !
for switchind betwenn trajectory mode and point to point mode, i just have modify this choice parameter ! it's great and simple finally!
thanks for your aid
glad you found a working solution. 👍
I am curious about your comment about problem with updating the model where the slide position is driven by a dimension (which value you set equal to the mathcad parameter by relations), and you need to re-open the constraint definition? That definitely sounds like a bug.
this happens as if the regeneration of this value was done only when the constraints window is open. like when there are several constraints and the validation is done only if all these constraints are compatible. It's a guess, I don't have an explanation for it
Yeah, that's not how it should work. Maybe you have multiple constraint sets on this component? Anyway, the mechanism functionality is often baffling and buggy so not completely surprising.
With the "enable regeneration" value type of slider joint I was proposing, you should be able to "freely-move" the slider, but upon regeneration, it will return to the prescribed position. Seems simpler, but I suppose you already have a working solution which enables you to turn on or off the ability to "set" the slider position. Bolting on that functionality to my proposal would probably end up with a similarly "complicated" relations.