Skip to content

Conversation

@jleonqu
Copy link
Contributor

@jleonqu jleonqu commented Oct 13, 2021

This is a pull request with some PTO-Sim blocks updated.

@kmruehl kmruehl added Feature new feature request PTO-Sim PTO-Sim (ptoSimClass.m) labels Oct 13, 2021
@kmruehl kmruehl requested review from dav-og and jtgrasb October 20, 2021 14:26
@jtgrasb
Copy link
Contributor

jtgrasb commented Nov 7, 2021

The PTO-sim updates look pretty good so far! I am not very familiar with the details of PTO systems so I have a few questions:
First, is the gas-charged hydraulic accumulator made to replace the normal accumulator or is it a different type of accumulator?
What does the electric machine correspond to in terms of a real-life PTO system?
Will all of the PTO-Sim blocks be updated to match the formatting of these blocks, such as the rest of the hydraulic components?
Thanks! -Jeff

Copy link
Contributor

@dav-og dav-og left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work Jorge! - the new additions look good - although I haven't tested them in an example case. I did check the PR with another model that features a heavily modified incompressible fluid piston block, accumulators, motor, valves, etc and everything is working fine 👍

if you have a working example using the new blocks that could be a nice test to include - lets discuss with the others, re: https://github.com/WEC-Sim/WEC-Sim/projects/58#card-64155595

@jleonqu
Copy link
Contributor Author

jleonqu commented Dec 10, 2021

Thanks David and Jeff for your comments. I have included more hydraulic blocks and there is an application example in examples/RM3NewPTOSim.

Jeff, the electric machine block can be used to simulated an electric generator. It could be used to simulate an electric motor with some minor modifications. There some options for hydraulic accumulators such as a spring load accumulator or a gas charged accumulator, in this case I have decided to start with the gas charged accumulator.

@dav-og
Copy link
Contributor

dav-og commented Jan 19, 2022

Looks good Jorge - seems to be working fine 👍
Lets check with @kmruehl and the others about whether it makes sense to keep your example in WEC-Sim/examples or to put it in the WEC-Sim Applications repo

@jtgrasb
Copy link
Contributor

jtgrasb commented Jan 19, 2022

I am getting a few errors when trying to run the example case. First, the PTOSimBlock variable is spelled incorrectly in the wecSimInputFile. Once I fixed this, I was still getting the following errors, which I couldn't figure out how to fix.

errors

I also noticed that some of the variables are not in camel case, such as some variables in PTOSimClassUpdated.m (Ex: BulkModulus should be changed to bulkModulus to be consistent with WEC-Sim convention).

@kmruehl kmruehl changed the title Updated blocks: Gas Hydraulic Accumulator, compressible fluid piston,… DRAFT: Updated blocks: Gas Hydraulic Accumulator, compressible fluid piston,… Feb 24, 2022
initialized in the ``wecSimInputFile.m`` script. There are three properties that must be initialized for all the PTO-Sim blocks,
those are the name, the block number, and the type::

PTOSimBlock(i) = cableClass('PTOsimName');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleonqu I believe cableClass should be ptoSimClass, but can you confirm and update as required.

@@ -0,0 +1,11 @@
# PTO-Sim Compressible Hydraulic PTO

**Author:** Ratanak So

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleonqu Minor comment, but I would expect you should be listed as an additional Author of this example or repository.


**Author:** Ratanak So

**Version:** WEC-Sim v2.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleonqu You will need to update the WEC-Sim version number that this updated example will be compatible with.


%Hydraulic Cylinder
%PTOSimBlcock(1) = PTOSimClassUpdated('HydraulicPiston');
PTOSimBlock(1) = PTOSimClassUpdated('PTOSim1');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleonqu can you double check if other changes need to be made to the code now that PTOSimClassUpdated was removed from this PR.

TorqueHM = PTOSimBlock5_out.signals.values(:,2);
Current = PTOSimBlock6_out.i.Data;
Voltage = PTOSimBlock6_out.Voltage.Data;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleonqu Just for clarification, but the numeric values after PTOSimBlock_#_ will not be automatically updated and in this example these PTOSimBlocks are the corresponding blocks for the power conversion process. If so you may want to clarify as comments that if changes are made to this powerPlotCode.m the user will need to update these manually.

@nathanmtom
Copy link

@jleonqu In the RM3NewPTOSim' example folder, the wecSimInputFile.mis looking for a function called PTOSimClassUpdated.m which seems to have been deleted during one of your last commits. I have tried to update to use 'ptoSimClass', but the function was incorrectly capitalized in the function. After completing this, there still seems to be an issues such that if you tryPTOSimBlock(1) = ptoSimClass('PTO1')WEC-Sim will error and only proceed once you removePTO1to bePTOSimBlock(1) = ptoSimClass('PTO1')`.

Some other minor notes:

  • There appears to be a untitled.slx which I would expect you should remove to clean up this PR.
  • There appears to be a PTOSim_LibOld.slx` which I would also expect you should remove to clean up this PR.
  • There also appear to be conflicting versions of some WEC-Sim files, not sure if you need to pull the latest versions from Master and Dev into your branch.
  • Your MATLAB .slx files are saved in version 2021b. This is my issue, but right now I'm only at 2021a so if you can save the slx files as a 2020b version then we can ensure all users can open the .slx file.

@jleonqu If you are able to review and make some of these requested changes, I should be able to continue my review.

@jleonqu jleonqu mentioned this pull request Mar 9, 2022
@jleonqu
Copy link
Contributor Author

jleonqu commented Mar 9, 2022

Closing this PR. The updates are now in PR #821

@jleonqu jleonqu closed this Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature new feature request PTO-Sim PTO-Sim (ptoSimClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants