From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI VeriStand Add-Ons Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Simulation Toolkit Feedback

Hi Jian,

There are basically two ways to do it:

  1. Angular model - the CPU model reads in the crank angle, and all event information, and calculates torque on a per cylinder basis and therefore is high fidelity and results in a realistic per cycle speed variation of the engine. Must be run at high speed (3-5 kHz)
  2. Mean value model - the CPU model simply reads in the injector durations, averages them, and one of the spark end-angles, and calculates a mean value of torque. This is less accurate and does not result in per cycle speed variations. Can be run at low speed (1kHz)

Sounds like you are doing #1. It should be OK to run at 3-5kHz depending on what hardware you're using. If you're using a 9082, you can go into BIOS (press delete on a keyboard while it boots), and select that the CPU runs in 1 core mode (rather than 2 core). This significantly increases clock speed of the CPU and might increase performance. You should also make sure "Legacy USB" is disabled, as that causes jitter. Also, check inside MAX ->Ethernet settings tab -> Advanced to make sure the Ethernet port is set to polling mode, as this is less jitter.

Finally, you can eliminate some of your event timing inputs to improve performance. For example, if the FPGA has 8 event measurements with 4 captures each... but you know you will only use 6 measurements and 1 capture... don't add them to the system definition.

Stephen B
0 Kudos
Message 51 of 200
(4,170 Views)

Thanks, Stephen

I have following questions regarding to Angular model:

     1. Does '1 core mode' mean to disable 1 core? If I only enable 1 core, I see that 'Turbo Boost' is automatically selected.

     2. For Ethernet setting tabs, do you mean to change 'Packet Detection' to polling?

     3. Another werid phenomenion is that, once I increase the Target Rate to 5K, the scan engine custom device does not work. By not working, I mean that I have a dial which is mapped to e.x. AO1 and it does not output the voltage.

0 Kudos
Message 52 of 200
(4,170 Views)

Hi JianZ,

  1. Yes. For the CPU inside the 9082, the turbo boost allows for significantly higher clock speeds so 1 core might be faster than 2.
  2. Yes
  3. Can you check the status channels of the scan engine device?
    Is it throwing an error?
    What modules are you using in the 9144 chassis?
    Also, is the scan engine custom device set to run synchronize ni veristand to scan engine'? If you are not using single point data from the local FPGA chassis (the 9082), I would set this to true. If you have an entry under Controller->Hardware->Chassis->FPGA... then you are using single point data from the local chassis so dont set this to true. (it would cause a sync problem)
Stephen B
0 Kudos
Message 53 of 200
(4,170 Views)

Hi Stephen,

I have 1 NI-9403, 1NI 9862(not showing up in system explorer), 1 NI9264 and 2 NI 9401. Currently I am only using the NI 9264 to ouput 0~5V.

When the scan engine stops working at 5KHz, the Scan Mode State changed from 2 to 3 with the other 3 varialbes stay at 0.

Previously, I did not select synchronize ni verisant to scan engine. Based on your description, I selected it and saw 'Master Custom Device' showing up in Controller configuration. Which custom device should I select as master?

Capture.PNG

Thanks.

Jian

0 Kudos
Message 54 of 200
(4,170 Views)

Hi Jian,

Mode 3 means fault mode. Therefore it appears the 9144 is failing to run the rate you've requested. To get more detail about the fault, can you open the distributed systems manager (from start menu), add your target, and then inspect the fault window.

The scan engine device automatically sets itself as master if you check that box, which is correct. Did that improve performance?

What version of NI-RIO, Industrial Comms for EtherCAT, and the custom device are you using?

Thanks,

Stephen B
0 Kudos
Message 55 of 200
(4,170 Views)

Hi Stephen,

The attached image shows what I saw in distributed systems manager. I am using AO14 and AO15. I opened up the probe for the two pins and not sure about where to find the fault window.

Select the syncnization does improve performance:

     1. 2 cores, ethercat: line interrupt.  CPU load dropped from 68 64 -->58 50, others 0. Fail at 5KHz

     2. Single core, polling, 1ms(how will this 1ms affect performance?).  CPU load drop from 76 to 67, async loop duration is 26us. Fail at 5KHz and the HP count increases continuously.

Based on the CPU load and async loop duration, I kind feel that 2 cores have better performance.

NI-RIO -->14.0.1, Industrical Comm -->14.0, Scan engine-->4.1.4

Distributed System Manager.PNG

0 Kudos
Message 56 of 200
(4,170 Views)

Hi JianZ,

The scan engine custom device's "Async loop duration" channel should be zero if you have synchronize ni veristand to scan engine' true. Are you sure that was done when you did your single core test?

Polling 1ms is fine. It just dictates how often the target checks for new ethernet data.

Can you click on the target (top level item) in the distributed systems manager and see if there are any fault codes present when it fails?

Also, can you graph the system channel "hp loop duration" and the engine simulation toolkit status channel "loop duration"

Thanks!

Stephen B
0 Kudos
Message 57 of 200
(4,170 Views)

Hi Stephen,

1.You are right about the async loop duration. It only happens without sync.

2. Error Code: -66460, Level: Major, Description:  'LabVIEW: The I/O scan time exceeded the NI Scan Engine period you specified on the Scan Engine page of the target properties dialog box. ========================= LabVIEW: The I/O scan time exceeded the NI Scan Engine period you specified on the Scan Engine page of the target properties dialog box.'

3. When fault(mode 3) happens, following is the graph for the two variables.

5khz, single core, polli with sync_5khz.PNG

Jian

0 Kudos
Message 58 of 200
(4,170 Views)

OK it looks like the engine simulation toolkit custom device is taking 20uS, and the PCL is taking up to 70uS. So those are well below the 200uS you need to do 5kHz loop rates. Therefore, I suggest increasing the EtherCAT cyclic bandwidth from 40% (the default) up to 60% or higher to see if that helps. It is a property on the ECAT master page.

Stephen B
0 Kudos
Message 59 of 200
(4,170 Views)

Hi Stephen,

I tried 60% and 70%, and it works at the beginning and fails after like 2 seconds. At the same time, the HP count keeps increasing. In the description of EtherCAT cyclic bandwidth, it seems that increasing this number will decrease the time left for other tasks(model). Does the HP loop duration mean the time spent on all other tasks? specifically, the model needs to run fast.

Thanks.

Jian

0 Kudos
Message 60 of 200
(4,170 Views)