|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: PID need someone to look it over.
that part may be wrong because i do not know what that input does exactly but i was hoping that it would give me an exact time value instead of the vi calculating its own runtime
|
|
#2
|
|||
|
|||
|
Re: PID need someone to look it over.
If you want a few pointers on more readable diagrams -- so that you can read your code more easily and others can too, I'll throw some out there.
When you have a choice between a case structure and the ternary assignment, also called the Select node, use the Select. When you have a positive and negative constant that you are just selecting between, consider using one constant and multiply by either one or negative one. When you need to change the constant, you are far less likely to wind up with a partial update. Whenever possible, combine the Booleans into a number and switch on that to minimize duplication of constants and code. My monitor is 1920x1200 and I still need to scroll quite a bit to see your diagram. White space is cool, but if you need to scroll, limit the scrolling to one dimension. Even better, use subVIs to avoid scrolling altogether. I can't follow the logic enough to be able to answer your question about the PID. Greg McKaskle |
|
#3
|
|||
|
|||
|
Re: PID need someone to look it over.
I think my problem is not knowing what i can use to simplify things more (also i find it easier to use stacked cases than use arrays). And what are ternary assignments?
|
|
#4
|
|||
|
|||
|
Re: PID need someone to look it over.
Ternary assignment in C/C++ looks like
y= a<0.3 ? 0 : a; which is equivalent to if(a < 0.3) y= 0; else y= a; In LV it looks like the attached image. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|