Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » SidAgarwal
  • » Profile

Posts

Posts

Hello, is it possible to install OMoptim on Ubuntu 18.04? I installed OpenModelica as described here. I cloned OMoptim from the github repository, but have faced errors while installing it acc. to the method listed on the repo. Is there a way of running OMoptim on Ubuntu?

Thanks.

Hi,

I have been trying to run a linear full state feedback controller on a flight model. I have had success in building the flight model, but I can't find any decent linear system tools in the modelica standard library. I downloaded the modelica linear systems2 package (https://build.openmodelica.org/Document … ems2.html) , but no models can be flattened. Is there something I am missing in using this package?

Thanks.

Jun-18-18 07:41:34
A flight model I created doesn't recover the trim conditions after a minor perturbation.

I created a flight model, usingthe standard 6DOF and aerodynamic equation blocks. However, the model is very sensitive to initial values of thrust, deltae (elevator), V, and alpha. If they are off even by 10^-4, the model doesn't give the expected output. Even then it requires the irksco solver and a tolerance 1e-3 to return correct answers.

Beyond that, if I attempt to perturb deltae by one degree, the model simply simply loses its path and never recovers as it is supposed to.

I have gone through every line of the code with a fine tooth comb but I am not sure where I am messing up. The files are attached. The TestFM file is the one that needs to be executed (for approx. 100 secs at 0,001 s step size), and the TrimCessna file will generate the initial values (thrust, alphazero,V, de).


Flight-Model.zip

Nov-22-17 14:26:48
I am trying to write data to an arduino via the MDD serial library. I am facing a problem w/ data...

So I am using the MDD library to read and write data from an arduino via the serial port. As a toy example, I am serial writing a sine wave from OpenModelica to the arduino and sending it back to OpenModelica. However, at points, the value read comes to be 0, leading to distorted plots. I have provided the simple firmware I am using for this test, and in the images, the model and the output. As you will see in the code, I have provided a delay of 5 ms. If I lower the delay, the plot distortions get denser. Ideally, I am looking for a way to do away w/ the delays.

Also, when the input is taken from a function generator connected to the arduino, no distortion is seen. This leads me to believe that the problem is w/ the serial writing from OM.

Code:

int Output;

void setup()
{
Serial.begin(115200);
//pinMode(A5, INPUT);
}

void loop()
{
 
      Output=Serial.read();
      Serial.write(Output);
      delay(5);

   
     
//    Serial.write(((int)Output>>8)&0xFF);
//  delay(5);
}

So I tried using it, but I have been unable to get clean data from the arduino. Often as I try to read data from the serial port, large portions of it are garbled. Would you have a clue as to what might be happening?

I am using an analog function generator connected to the arduino, and using the serial receive and unpack int to read it. The firmware involves a Serial.write(analogRead(A5)) in the loop with a delay and that's it.

Thanks.

I want to send data to the arduino, and receive some output from it as well. Using the aforementioned code as an external function, could that be achieved?

I am trying to, for the sake of this question, achieve a real-time system with OM and arduino.

On using a C interrupt handler, like what's used  in https://stackoverflow.com/questions/151 … n-in-linux, what I understood was that the code being activated during the interrupt would have to be placed in the C function itself. Which, owing to my lack of C experience, I wasn't able to traverse through.

Hey, so I recently started using OM, and I have been tasked with developing a real-time hardware in loop system, using an arduino as the hardware controller. I have an interface library for OM-Arduino, but I find myself unable to generate interrupts from OMEdit. Is there an existing mechanism for generating serial interrupts using OM?

  • Index
  • » Users
  • » SidAgarwal
  • » Profile
You are here: