Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

SPECTRE

Member

08-09-2012 08:42 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Part of my final project would be to create a high level design of a PV system. This would involve a model of a solar cell, a maximum power point tracking (MPPT) algorithm, and a DC-DC converter. For the MPPT part, I have created a VI that is based on the incremental conductance algorithm. I have attached a flowchart of the algorithm for reference. Now for the algorithm I used multiple case structures to implement the branching in the flowchart. The algorithm should decide whether to increment or decrement the duty cycle (*d*) that will be fed to the DC-DC converter.

The initial value of the duty cycle (marked as "initial d") is fed to a shift register. This value passes through multiple case structures, and is incremented or decremented, and is supposed to go to the other shift register at the end. The problem is that whenever the VI runs and goes through the algorithm, I noticed that the updated duty cycle does not pass through a wire where its supposed to go to the other shift register (marked with a circle in attached pic of block diagram).

Can anyone help me with this?

Thanks in advance.

Download All

Virus scan in progress. Please wait to download attachments.

amezam

Active Participant

08-10-2012 09:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello Spectre,

I ran your VI in highlighted execution with the step through button and a value did pass through that wire. I don’t know what are the initial values you’re using, but maybe you can try running it exactly like that and check if it is really nothing passing through that wire and if so, why.

Best Regards,

08-22-2012 04:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi! Sorry for the late reply. A value did pass through that wire. But another problem came up. I used the MPPT VI as a subVI, and it cannot seem to output "d". I'm not sure but my VI cannot seem to pass values out of the for loop. I have attached the updated VI. I placed "d" outside the for loop.

Thanks,

johnsold

Knight of NI

08-22-2012 08:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Are you trying to get intermediate values of d, that is, the value of d on each iteration of the loop? SubVIs do not return any data until they stop running. The only value of d you get is the one that is on the shift register when the loop stops.

To run this as a subVI you probably do not want the stop button. You need to define a condition on the data (such as the change in d is less than 0.01) and stop when that condition is met. If you want to do something in the calling program for every value of d, then you need to set the loop up to run only one iteration each time the subVI is called.

Also it is generally not a good idea to use equality comparisons on floating points numbers because of the way data is represented in the computer. A better way is to test to see if the values are within some tolerance or ragne of each other. Look at the In Range and Coerce function.

Lynn

08-31-2012 10:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

johnsold

Knight of NI

09-01-2012 09:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

No. You do not want an event structure in a subVI because subVIs normally run with their front panels closed and the event structure would wait forever for front panel input.

You should probably do one of two things. Since I have not seen your complete program it is difficult to tell which might be better. One way is to remove the loop completely from the subVI. Just do one calculation and end the VI, which returns the value of d. The other way is to make a loop which only iterates one time before ending. Use a while loop with True wired to the stop terminal. This also returns each value of d. The choice comes down to whether you need feedback from previous calculations and whether you want to keep that feedback inside the subVI or handle it in the outer loop.

Lynn

09-02-2012 01:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

The VI needs the previous values of d, since it adds or subtracts 0.5 from d for every iteration. If I just wire True to the stop terminal, the VI does not keep the previous values of d. This VI is supposed to receive two sets of array data, which is then fed to this VI's while loop. This VI is just a part of a larger program, which I'm attaching. You'll see that I haven't started modeling the buck converter VI though, so it's just there to receive values of d.

I'll try to rework this VI so that it won't use a while loop.

Thanks for the answers

johnsold

Knight of NI

09-02-2012 09:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You need to change to an unitialized shift register. That will "remember" the data between successive calls. You can use the First Call? primitive to initialize the shift register inside the loop.

You also need to feed your V_new and I_new data in one value at a time because the loop only runs one iteration each time the subVI is called.

I modified your VI to get you started. You may also need to make changes in the buck converter VI if the data is not available as an array. I used arbitrary functions just to generate some data so that I could see that the VIs work. I do not know if they perform the calculations correctly.

You may need to put in some test for divide by zero. If V_new is zero or two successive values of V_new are identical you divide by zero. This does not crash LV but may affect your results.

Lynn

Download All

Virus scan in progress. Please wait to download attachments.

justlearning

Member

10-16-2018 02:54 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Greetings ! , May I have the Boast Converter VI.

@SPECTRE wrote:

Part of my final project would be to create a high level design of a PV system. This would involve a model of a solar cell, a maximum power point tracking (MPPT) algorithm, and a DC-DC converter. For the MPPT part, I have created a VI that is based on the incremental conductance algorithm. I have attached a flowchart of the algorithm for reference. Now for the algorithm I used multiple case structures to implement the branching in the flowchart. The algorithm should decide whether to increment or decrement the duty cycle (

d) that will be fed to the DC-DC converter.

The initial value of the duty cycle (marked as "initial d") is fed to a shift register. This value passes through multiple case structures, and is incremented or decremented, and is supposed to go to the other shift register at the end. The problem is that whenever the VI runs and goes through the algorithm, I noticed that the updated duty cycle does not pass through a wire where its supposed to go to the other shift register (marked with a circle in attached pic of block diagram).

Can anyone help me with this?

Thanks in advance.

@SPECTRE wrote:

Part of my final project would be to create a high level design of a PV system. This would involve a model of a solar cell, a maximum power point tracking (MPPT) algorithm, and a DC-DC converter. For the MPPT part, I have created a VI that is based on the incremental conductance algorithm. I have attached a flowchart of the algorithm for reference. Now for the algorithm I used multiple case structures to implement the branching in the flowchart. The algorithm should decide whether to increment or decrement the duty cycle (

d) that will be fed to the DC-DC converter.

The initial value of the duty cycle (marked as "initial d") is fed to a shift register. This value passes through multiple case structures, and is incremented or decremented, and is supposed to go to the other shift register at the end. The problem is that whenever the VI runs and goes through the algorithm, I noticed that the updated duty cycle does not pass through a wire where its supposed to go to the other shift register (marked with a circle in attached pic of block diagram).

Can anyone help me with this?

Thanks in advance.