Quote:
Originally Posted by ajlapp
This simulation technique is awesome! We were doing very simple simulations to test logic and various code samples but I never fully thought through how to add some virtual models to our testing scheme.
I've already sorted out a few pesky bugs with our PID scheme. 
|
Woo hoo. Someone is finding it useful
Quote:
A few questions...
What is supposed to be on page 6 of the presentation slides? Its empty.
|
There was going to be a live code demo there. The presentation was going to be over the time limit so I never actually got to it during the presentation.
The demo was the big nasty LabVIEW implementation of the state machine on page 5. With the way LabVIEW does its case structures, it's hard to convey the message on a single page of Powerpoint and multiple pages would've put everyone to sleep during the presentation, so I was planning on going through it live. The point of it was that the state machine was ridiculously complicated and it's easy to see how you could have a lot of bugs in the code, and the simulation technique would allow you to find the vast majority of them.
Quote:
|
On page 21 you discuss adding some limits to the model. Did you add these live during the presentation? I don't see this limiting in the sample code.
|
No, I didn't add them during the presentation. They can be just a little bit tricky and require a few iterations to get them right, and I didn't want to look like a bumbling fool in front of an audience. I probably should have added an example to the code samples.
In order to add limits, you can use a "In Range and Coerce" block to limit the distance traveled to a range. Use the Coerced? boolean from the previous sentence to force the output of the 1st order filters to zero so the integrators stop integrating. That's basic concept behind it.
Quote:
|
Page 29 shows some sensor noise modelling. It appears to always add 0 noise. What is a good noise value for different sensors? I'd like to use "D" in my scheme, so realistic noise would be great.
|
You are correct, the example is always adding zero. That was me turning off the noise model.
To be honest, I don't know any good noise estimates off the top of my head. What I would do is make some special LabVIEW code that samples your sensor every 1 msec and and takes a running maximum and minimum. You can use the maximum and minimum to set the noise parameter.
If you need a quick ball-park estimate, you can probably use 0.5% to 1% of the signal range. Therefore, if you're using a 300 deg/s gyro you can use about 1.5 to 3 deg/s for the noise amplitude. That should get you started until you can get better numbers.
If you're using encoders and D control, I'd highly recommend using the simple encoder model. When the encoder increments the counter it can cause some trouble with D control. You may find that you'll need to add a filter.