NI VeriStand Add-Ons Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Simulation Custom Device Feedback

Merc,

The 100% CPU usage problem is because the # of packets your FPGA is sending/receiving doesn't match the XML's definition of the # of packets. So your XML may say send 5 receive 3... but your FPGA is actually doing a different number. This has nothing to do with engine simulation, so I would consult this page for some more information: NI VeriStand FPGA-Based I/O Interface Tools as well as the help for NI VeriStand. Just glancing at your code (your first picture) I can see your comments about the packet #s don't match what your code is doing. Also, your for loop appears to be reading 11 packets... but I don't think you're using 11 packets. So there are a lot of issues here.

Please note, you don't have to use the NI VeriStand FPGA framework to just do engine simulation.... its only useful if you need IO other than just engine simulation. So if this continues to cause you problems, you could focus on this part (and not engine sim) or focus on just engine sim and (not other IO).

As far as the IC events... your bottom picture shows you reading Con0 DIO Port0 (DIO lines 0 to 7) for the IC events. Are you 100% certain you have those pins of your FPGA device connected to your ECU's IC outputs? Try monitoring them with an oscilloscope to be sure you're getting the digital events. Also, this shouldn't really matter... but try monitoring more than just start angle. The most recently uploaded version of the AES library (2.3) has an updated palette item that you can drop to monitor all events (instead of you having to code this all up yourself).

Stephen B
0 Kudos
Message 41 of 247
(2,105 Views)

Bryan:

Looks like you have an extra space (" ") on the end of "NTeeth.Cam2.Degrees Low Pulse ", so the component wasn't being recognized.  If you delete the space and recompile that should fix it.

Also, Stephen just posted an updated version (3.2) of the custom device.  You should definitely upgrade to this version, as it allows you to properly handle N Teeth M Missing generations with the cycle angle (before this didn't work correctly).  You should also update the AES library to 2.3 (not required, but the documentation for the VIs has been updated, since a lot of it was outdated and incorrect).

Regards,

Devin

0 Kudos
Message 42 of 247
(2,105 Views)

Robert:

In addition to Stephen's comments, you should also verify that the IC outputs of your ECU are compatible with the digital inputs you are using.  The built-in digital lines of the R Series card support TTL compatible signals.  If your ECU is outputting something outside of this range, you may need to do some external signal conditioning, or read it with a different type of input (ex. a digital C-Series module in an NI-9151 R-Series expansion chassis).

Ross:

We added the ability to import/export angles on the fully-custom page in version 3.2 of the custom device.  It expects a tab-delimited file with: rising angle <tab> falling angle.  Ex:

0        15

30      54.50

180     270

0 Kudos
Message 43 of 247
(2,105 Views)

Stehpen and Devin,

Your thoughts were correct, I fixed the number of packets in the xml and the bitfile and that solved the issues.  I may try adding all the calculations to see what is going on in the IC outputs.  I will double check my signal levels, the 7833R that I am using should be capiable of 5V inputs and that is what I'm running but I will explore it further.  Thank you for the quick response, very appreciated.

0 Kudos
Message 44 of 247
(2,105 Views)

Doh!

Thanks! Works now!

Y'all rock!

0 Kudos
Message 45 of 247
(2,105 Views)

Ok, got another "puzzler" for you guys - In quotes cause the last one was so hard .

Still trying to use N Teeth M Missing vi to generate cams, so I pipe Cycle Angle instead of Crank angle. However, Cam goes haywire after around 500 deg and alternately rails high and low until the cycle resets. I have been able to reproduce the effect in software and have attached the testbench VI.

I have also included a ScreenShot of the signals. You can see the Cam signal (top/white) freak out after 500.

Help! and Thanks in advance!

CamCrank_freakout.png

Download All
0 Kudos
Message 46 of 247
(2,105 Views)

Hey brian,

They is a serious problem I'm very interested in. Thanks for attaching a VI to reproduce this, however... it is broken. can you fix it up?

Stephen B
0 Kudos
Message 47 of 247
(2,105 Views)

Of course, it is fine on my machine . The only thing crazy with this code would be the linking to the HIL library. It is looking for things in LabVIEW 2010 user.lib directory.

Maybe this snippet will help?

CamCrank_freakout_snippet.png

0 Kudos
Message 48 of 247
(2,105 Views)

I think I've found it...

Inside N Teeth M Missing is a feedback node whose max range is 512... Something to do with the coersion. Thats when the whole thing flips out!

Will keep you updated!

-Bryan

0 Kudos
Message 49 of 247
(2,105 Views)

You appear to have edited the AES global variable:

"C:\Program Files (x86)\National Instruments\LabVIEW 2010\user.lib\_NI VeriStand FPGA Support\NI VeriStand RIO Library\Custom Device Components\Engine Simulation\Engine Simulation Globals.vi"

To include a new variable named "Cam2 Tooth Width"

So mine is broken is yours is not. I recommend reverting this change and only using what is installed with the AES library. If you need additional globals or locals, make them yourself without editing the AES VIs

Stephen B
0 Kudos
Message 50 of 247
(2,105 Views)