Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Photosensor as encoder for bang bang. (http://www.chiefdelphi.com/forums/showthread.php?t=113029)

MysterE 08-02-2013 09:32

Photosensor as encoder for bang bang.
 
Hello folks,

Helping my programmer do a bit of research. How would we go about pulling the period of time between rotations of a flywheel using a photosensor and tape to use with a bang bang in Labview.

Mark McLeod 08-02-2013 10:32

Re: Photosensor as encoder for bang bang.
 
Here's one way to do a tach with a photosensor:

Bunniy 08-02-2013 18:08

Re: Photosensor as encoder for bang bang.
 
what is and where do i find the 'Dig Scr' thingy between the DIO open and the COUNTER open

Mark McLeod 08-02-2013 18:28

Re: Photosensor as encoder for bang bang.
 
It's in
WPI Robotics Library -> I/O -> DigitalInput

Ether 08-02-2013 19:37

Re: Photosensor as encoder for bang bang.
 
1 Attachment(s)
Quote:

Originally Posted by Mark McLeod (Post 1229855)
Here's one way to do a tach with a photosensor:

Mark,

Is the Counter/ConfigTimer (blue arrow) where the FGPA sampling size is configured?

If so, does the "5" (green arrow) mean FPGA sample average is set to 5?

Does Counter/Get (red arrow) return the same thing as the GetPeriod() method in the Counter class in C++ and Java (i.e. period, in seconds, of the tooth count, based on the last 5 samples) ?

Thanks.

Mark McLeod 08-02-2013 21:40

Re: Photosensor as encoder for bang bang.
 
In a word, Yes.

The 5 there is just an example for # samples to average.
(For the OP's programmers, e.g., Bunniy) For example, if you have multiple pieces of reflective tape around the wheel to increase your resolution, then averaging removes any displacement errors in positioning the individual pieces of tape. You know, if the pieces of tape aren't perfectly spaced, perfectly sized, perfectly oriented. If you just use 1 piece of tape then I'd probably take the LabVIEW default of 1.

That Get wire is the average Period (in seconds) between pulses.

Ether 08-02-2013 21:44

Re: Photosensor as encoder for bang bang.
 
Quote:

Originally Posted by Mark McLeod (Post 1230218)
In a word, Yes.

The 5 there is just an example for # samples to average.
For example, if you have multiple pieces of reflective tape around the wheel to increase your resolution, then averaging removes any displacement errors in positioning the individual pieces of tape. If you just use 1 piece of tape then I'd probably take the LabVIEW default of 1.

That Get wire is the average Period (in seconds) between pulses.

Thank you.

I have a more general LabVIEW question if I may. Before I posted the above question, I tried for about half an hour to find the answer on the internet. Do you (or does anyone reading) know of a site where you could type, say, "Counter Config Timer" into a search box and it would display the LabVIEW help screen for that icon? I had no success with Google.



Bunniy 08-02-2013 21:53

Re: Photosensor as encoder for bang bang.
 
Thank you mark for telling me that it should be set to 1. No wonder my wheel was spinning so fast!

Bunniy 08-02-2013 22:04

Re: Photosensor as encoder for bang bang.
 
im still having trouble. my motor keeps spinning as fast as possible even when i set the rpm to even 200.

Mark McLeod 08-02-2013 22:15

Re: Photosensor as encoder for bang bang.
 
Show a snippet of the code you're using.
I may be a little slow responding, I'm shoveling snow.

P.S.
If you don't know what a number in the example means, ask.
You don't want the 99 for example, because you only have 1 tick per revolution.

Greg McKaskle 08-02-2013 22:21

Re: Photosensor as encoder for bang bang.
 
Ether, I don't know of a site that does that, but the editor will. If you click on search in the palettes, type Counter Config, it will have only one item in the list. Hover and the Context help window will show that item's help. There is also a function called QuickDrop that some folks just love. You hit Ctl-Space and type some of the name and it does the same sort of list and you click and drop the node. It doesn't look like the help updates until you drop the node.

Greg McKaskle

Bunniy 08-02-2013 23:38

Re: Photosensor as encoder for bang bang.
 
1 Attachment(s)
here

Bunniy 08-02-2013 23:47

Re: Photosensor as encoder for bang bang.
 
1 Attachment(s)
and this is the rest of it. The first picture us what is in the periodic task vi

Mark McLeod 08-02-2013 23:53

Re: Photosensor as encoder for bang bang.
 
So you're taking the total revs since the last time you checked the counter.
Dividing by a time constant, filtering the result, and applying a slew rate limiter?
I'm not a fan of the Counter reset applied that way. There's a window to drop counts.

Seems a bit much for flywheel.
Is the slew rate limiter to avoid extended stall time at full power for the flywheel?
P.S. I overlooked that the slew rate is probably bypassed with the False Case.

Is that really 360 counts per revolution?
I thought you only had 1?
I don't think you want that 60 or 360 applied there, but maybe I haven't grasped what you are calculating.

Alan Anderson 09-02-2013 00:03

Re: Photosensor as encoder for bang bang.
 
Quote:

Originally Posted by Bunniy (Post 1230301)
and this is the rest of it.

Are you trying to read buttons and set a global variable in Begin.vi? It only runs once when the program starts up, and usually isn't an appropriate place to do I/O actions.


All times are GMT -5. The time now is 19:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi