01-23-2012 03:42 PM
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).
01-23-2012 03:50 PM
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
01-23-2012 03:58 PM
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
01-24-2012 03:57 PM
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.
02-07-2012 11:43 AM
Doh!
Thanks! Works now!
Y'all rock!
02-07-2012 11:55 AM
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!
02-07-2012 11:58 AM
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?
02-07-2012 12:14 PM
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?
02-07-2012 12:54 PM
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
02-07-2012 12:55 PM
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