Cancel
Showing results for 
Search instead for 
Did you mean: 

If-function AMESim

Creator
Creator

Hello everybody,

 

I was wondering if there is a way to model an if-function into my model. I want to model an if-function which uses one input (1-12) and decides which controlpath to follow based on the given input.

I can't seem to find it in de control and signal library.

 

Kind regards,


Tom

10 REPLIES

Re: If-function AMESim

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Tom,

 

I think there are different ways to do this. It depends on what you mean with "which control path to follow".

 

  • If you can 'drive this control path' with one output value, you may just use an f(x) block where the expression will look like: (x ==0) * value_for_case_1 + (x ==1) * value_for_case_2...

 

  • If you actually need to drive several outputs depending on your input, there are more options:
    • check the dynamic truth table - this component is in the Powertrain library
    • a statechart could also do the job nicely
    • I believe you can also come out with a combination of signal components
    • using global parameters: define your input as one global parameter and express other global parameters function of that input using the same logical expressions as in the first bullet

Re: If-function AMESim

Creator
Creator

Hello Emmanuel,

 

I'm working on a gearbox model where the physical representation of the gearbox depends on which gear I engage. e.i. Gears 1-12. What I would like to create is a super component which has a shaft entry and exit, and a signal entry for which gear I'm in.

 

Inside the supercomponent, I want to model the 12 different physical models, and depending on the gear input, I want to drive one of these models.

 

I think the f(x) block would suit me nicely here?

 

Kind Regards,

 

Tom Haenen

Re: If-function AMESim

Siemens Phenom Siemens Phenom
Siemens Phenom

I see, thanks for details.

 

For a gearbox:

 

- automatic: sounds like your case Smiley Happy if you had a detailed model you would normally use a truth table to drive the different clutches which will automaticallu affect the inertia between input and ouput. For that, check the demo named AT6_RT_step1, the gear signal is converted into 6 outputs (with the truth table) to open/close clutches

 

- manual gearbox: you also have a demo (manual gearbox) ut here the synchronizer are directly piloted individually rather than with a signle 'gear' signal.

 

If you really prefer to define independent 'models' for each gear you could also open/close 'virtual clucthes' with a control signal, if it does the job and you're happy with it ok but, beware as the model won't be representative for gear change it would only be valid in a given gear.

Also if the structure of your 12 gear model was the same, I would rather use global parameters to change the parameters depending on the gear.

 

If the 12 models are actually very different, I show how such a model could look like:

Amesim_gear.PNG

 

 

Re: If-function AMESim

Creator
Creator

Thanks for your thorough response. I think option 3 suits my needs the most. It's true I don't need automatic shifting between gears in the analysis, as I am interested in the situation when one certain gear is activated. 

The model's will have a considerate different buildup physically, but I do plan to use the global parameters.

 

So if I'm correct , in your third and final option, you choose to drive all of the gears, except you unclutch eleven drive trains?

 

I'll go ahead with the 3rd option for now, and will post an update on monday! Thank you very much already.

 

 

Re: If-function AMESim

Siemens Phenom Siemens Phenom
Siemens Phenom
Hi,
Yes that's the idea, put all the gears in parallel and disconnect the ones which are not used.
For the clutches, you will have to set a high transmissible torque (max friction) so they don't slip.

Re: If-function AMESim

Creator
Creator

Hello,

 

As promised a little update:

 

I modelled 12 gears parallel to each other. With the function block I can (de)activate the clutches and the system seems to be working with a constant torque input and even with gear changes.

However, when I import it into my main model, AMESim detects an error in DASSL. The step size h is unacceptably small. Any ideas what causes this behaviour?

 

Attached is an image of the model of the gear box when it worked.

 

Kind regards,


Tom

Re: If-function AMESim

Siemens Phenom Siemens Phenom
Siemens Phenom
Hi Tom,
It seems you have an implicit loop in your system. It's not obvious where by looking at it. When the model is compiled you should have a message telling you more about it and allowing you to highlight it. If possible, try to get rid of it using first order lag. Look on the forum there are some posts about these implicit variables.
Also, I see, all your gears do have the same structure. It would be more efficient if you kept only one gear and change all the parameters using only global parameters.
You would have a global named engaged gear. And all the other parameters will depend on its values. Something like:
Inertia1=(gear==1)*inertia value 1+ (gear==2)*inertia value 2+...
It will make long expressions but your sketch will be simpler and should solve more rapidly.

Re: If-function AMESim

Creator
Creator

Hi Emmanuel,

 

Thanks for your quick and thorough responses! You're helping me along quite well!

 

I had the model running and indeed it was a heavy model to calculate. So I'm instead turning my attention to the Dynamic Truth Table. One question about this part though:

 

- When I run an Eigenvalue analysis to determine resonance frequencies, will the "extra" inertia's disturb the results for this type of analysis? Or does it take into account which gear it will be in?

 

If it does disturb this process; then my next idea will be to create a supercomponent for the gears and to make each gear a submodel. But I would like to be able to switch gears in the parameters or simulation mode.

 

Kind regards,

 

Tom

Re: If-function AMESim

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Tom,

 

For the eigenvalues you are right, all the inertia on the sketch are always taken into account. So it makes it challenging to isolate your engaged gear.

 

The truth table will be helpful if you are modelling the real layout of the gearbox with its different shafts, epicyclics, clutches.

If you keep the model as it was on your previous screenshot, use global parameters. If you had several submodels for each gear under a supercomponent you wouldn't be able to easily switch from one to another in parameter/simulation mode. But, with an 'engaged gear' global parameter, you can change it or even make it a batch parameter easily. Your model would then look like this:

Amesim_GP_GB.jpg

 

Then, to switch gear, just change the value of the top global parameter and all the other parameters will change accordingly. You can also run simulations batching on that same parameter.