sandialabs / rattlesnake-vibration-controller

Vibration Controller targetting Multiple-Input-Multiple-Output (MIMO) and Combined Environments Control
GNU General Public License v3.0
17 stars 2 forks source link

B&K LAN-XI Type 3160-A-4/2 Issues #6

Closed drew-andy closed 4 months ago

drew-andy commented 4 months ago

I am using the 3.0 Version and While using a LAN-XI data acquisition unit: Physical channel 1 is connected to a transducer that is attached to a shaker. In Feedback channel 1 is teed off and fed into Physical channel 2, and Feedback channel 1 also connected to an amplifier that is connected to the shaker. WIN_20240613_12_21_11_Pro WIN_20240613_12_21_26_Pro WIN_20240613_12_21_50_Pro WIN_20240613_12_22_06_Pro

I set up the Rattlesnake Channel table as follows:

LAN-XI Channel Table

Using the MIMO Random Vibration controller, after attempting to Initialize Data Acquisition, I receive the following error:

Output Error 03

Do you have any recommendations or examples on Channel table setup and environment definitions for HBKLAN-XI units?

drew-andy commented 4 months ago

My overall goal is to control a shaker with the Rattlesnake Software and to be able to see the force readings from the transducer as done in BK Connect software. Thank you in advance!

dprohe commented 4 months ago

Hello and thank you for the error report. It seems like the issue you are having is connecting to the hardware rather than anything Rattlesnake-specific. I would check a few things that you've probably already checked, but just to make sure:

Unfortunately network issues are really hard to debug because every institution has different firewall settings and network rules which may block or allow important information that the device needs to communicate.

I noticed a couple other things on your channel table that you'll probably need to fix once you get connected. Your value for coupling should be 22.4 Hz not 22.4. Also, I've had weird issues when using 1 V range where the scaling of the data coming out of the card was off by a factor of 10. While 1 V is a valid range on LAN-XI, I found setting it to 10 V gave me correct data. I have a hunch that it might be due to LAN-XI's dual range cards where they simultaneously measure with two different gain settings on their daq to get you better dynamic range. I'm not sure if their API handles that correctly. None of these would contribute to your current issue though, it seems like it's not able to talk to the data acquisition at all yet.

drew-andy commented 4 months ago

Hello, I appreciate your response.

Turns out, in order to get the LAN-XI to communicate with Rattlesnake I had to put the LAN-XI unit in a recording mode. After I did this I was able to controll my shaker in Rattlesnake's System Identification tab. I also had to add the 'Hz' like you mentioned.

-Now I'm sure this question may sound crazy but what would I put in Load Specifications (npz files)?

-Is loading control_laws.py OK for the environment definition?

-How could I get test predictions and a Test profile?

I'm sorry in advance if these questions sound dumb. I feel like your software is great, I just need some clarification on what is required from the user to get a basic test to run.

dprohe commented 4 months ago

For the MIMO random vibration, the specification loaded from the .npz (or .mat) file must define a Cross Power Spectral Density (CPSD) matrix. It basically tells the controller how much force or acceleration you want at each frequency line in your test. In your case, since your force sensor will be your control sensor (I assume), it will be in lb^2/Hz or N^2/Hz (I just noticed that your unit on your force sensor in your channel table is set to G, which doesn't really make sensor for a force, is it actually an acceleration?). Since you only have one channel, it won't really be a CPSD matrix since there won't be any cross-terms between channels if that makes sense, but you still need it to be a 3D matrix, so it will just be a n_freq x 1 x 1 matrix in the case of one channel.

You can construct a CPSD matrix from time histories of a representative response using a function like Matlab's cpsd or SciPy's csd. Alternatively, there are "standard specifications" like the one from this issue that you can simply read from tables. There is code in that issue that generates a specification for rattlesnake from the specification the poster showed

When you load in the specification, it should show up in the Environment Definition tab like this:

image

Though note that my example has multiple channels and warning and abort levels built into the specification. With only one channel and no limits, you should only see the blue curves.

The User's Manual, though a bit out of date for the newest version of the software, shows how a simple specification file should be constructed in section 9.1.

For the control law, you should start by loading in control_laws.py and selecting pseudoinverse_control. This is the simplest case that you should start with.

The test predictions appear after you have your environment completely defined (including specification), and you complete the system identification, which allows the controller to determine the relationship between the shaker drive voltage and the responses on the control gauges. Once the controller has the specification defined and the system identified, only then will it attempt to make a test prediction.

The test profile is only a sequence of events that happens during a test. If you want to run the test manually by pressing the start and stop buttons, you can just leave the Test Profile tab empty.

drew-andy commented 4 months ago

Hello and thank you for your guidance.

That clarified all of my questions. Rattlesnake is definitely a software that is more involved, meaning it requires more background knowledge on the field of structural dynamics to really understand how powerful a tool it actually is. I am enjoying the information I've learned and look forward to setting up tests and collecting some measurements.

dprohe commented 4 months ago

Glad to hear you're enjoying yourself. I think with it's ability to simulate tests virtually, Rattlesnake is a great tool for learning how to run these types of tests without the risk of breaking something if you mess up. If you are interested in learning more about how Rattlesnake works or MIMO testing in general, I've linked some papers from my colleagues here that might be useful. I'll go ahead and close this issue, and if any other questions come up, feel free to ask.