Quantcast
Channel: All LabVIEW posts
Viewing all 204074 articles
Browse latest View live

Re: PID motor control


Re: linear fit

$
0
0

See if this can give you some ideas....

 

altenbach_0-1580682323722.png

Re: PID motor control

$
0
0

Gaussy hasn't visited the forums in nearly 6 years.  I doubt he'll get your message and have a VI to share.

Re: Spreadsheet file is writing an extra new line that I don't want.

$
0
0

Attach your VI.

 

A tiny screenshot of an Excel spreadsheet doesn't tell us what you're doing wrong.

Re: linear fit

$
0
0

 

 

 Sorry for the mistake with the file. 

 

As X you can use the index of the array. 

At the end I want to obtain the slope of each linear fit made on 60 elements. 

 

The first fit has to be done on the elements from #0 to #59

The second fit has to be done on the elements from #1 to #60 

... And so on till reaching the bottom of the array (always considering 60 elements, no more, no less) 

 

Your file only has one column. I assume this is Y. To make a linear fit, you need X and Y. Is X just the array index or does it start over with each subset?

I think that we should obtain something like n-60 elements 

 

 

Re: linear fit

$
0
0

At the end I want to obtain an array with the value of the slope and then with max min function I will isolate that values

Re: how to split a array into two random arrays of equal elements

$
0
0

Hi Gerd,

Thank you so much for the quick response!

It does work really well but I do still have a problem.

Basically, if I do not split the array with all the players at the beginning (before using your code to generate two random teams) into 4 different arrays of

- 2 goalkeepers

- 6 defenders

- 8 midfielders

- 6 strikers

I do not end up with two teams with 1 goalkeeper, 3 defenders, 4 midfielders, 3 strikers each.

It is not a big deal since the solution you provided for me is really straight but I do have still to copy and paste the code 4 times (one time for each role) and then merge the arrays together to have the team with the right number of players per role. I attached the example.

 

Also, sorry for this last question, is there a chance I could use a low-level function instead of the Riffle function?
Thank you so much for helping.

 

 

Re: linear fit

$
0
0

What's the meaning of "isolate"? Just the get the max and min value?


Re: linear fit

$
0
0

Yes, yes I need before all the values of the slope and then only the max and the minimum values of the slope

Re: how to split a array into two random arrays of equal elements

$
0
0

Don't copy code.  Create subVI's!

 

But you can still use riffle.  Riffle them up.

Go through the list one by one.  Add a player to a team and keep track which position they were by incrementing a counter for each position.  (Or start with how many you're allowed and subtract 1.)

Once you get to a player and you've met the limit for that position, add them to the other team.

Once you've met the limit for all the positions, add all the remaining players to the other team.

 

Re: how to split a array into two random arrays of equal elements

$
0
0

Hi Raven,

OMG, you're totally right about the subVI's thing!

I don't know why I didn't think about it before since I was already coding this as a subvI. Thank you!

 

Also, is it the counter method that you are referring to similar to the code I made at first? Because yes, it works, but it doesn't look like a simple way to do it. (i will reattach the first code I made).

 

 

Re: Spreadsheet file is writing an extra new line that I don't want.

$
0
0

Ok I have it in the top reply but I will post the latest one that only has the one new line. Here's the newest csv as well.

make an autonomous action with a button

$
0
0

how can I make the robot move with a button to back one meter and activate engines in the teleop

Re: how to split a array into two random arrays of equal elements

$
0
0

Btw,

Thank you so much, everyone!

I think that the easiest way will be to use the code that Gerd proposed, after previously splitting the players in each category, and merging the 4 random arrays together at the end.

 

I think I also found the "homebrew" solution to the Riffle function that I was looking for.

 

p.s. I don't know why but it won't add the "randomize.PNG" to the message so I did attach it. It is the picture of the solution for a "homebrew Riffle".

 
 
 
 
 

programing switch

$
0
0

how to program a micro switch to stop when a part of the elevator touches it and deactivates the motor that causes the elevator to rise


Re: make an autonomous action with a button

$
0
0

Davidrj28,

 

It seems you're asking this question related to the FIRST Robotics Competition. I recommend you post your questions in that forum in the future: FIRST Robotics Competition Discussion 

 

Regarding your question: it will depend on if you are using the Command and Control Framework or not. For the former, your subsystem should be able to handle that request from a call. If you are not using Command and Control, then you can program a state machine. You can learn more about these here: 

 

Good luck to your team!

All the best,

Re: Installation de labview sur plusieurs PC

Re: cDAQ_9188 COMPATIBILITY TO WINDOW 10

How to synchronize analog waveform with digital signal

$
0
0

Hi,

I recently created a program to create an analog waveform (a square pulse wave with a linear ramp-down). The entire wave lasts for 3 seconds, and I want to align it with another digital output signal. What is the best way to achieve this?

 

Thanks!

Re: Custom waveform analog output

$
0
0

Thanks Kevin, I'll keep that in mind.

Viewing all 204074 articles
Browse latest View live


Latest Images