![]() |
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
Quote:
The only thing I'd change in what Mark posted is to set the FPGA samples to "1" instead of "5" for a one-per-rev sensor. |
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
Hi everyone,
I just wanted to say thank you for all of the help that you all have been giving our programmer. He is working solo on this and is learning much of it without local support. We are slowly making progress and appreciate all of your efforts. |
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
1 Attachment(s)
Quote:
OK, 1 tick per revolution is REALLY LOW, so expect it to yield less than optimal results, though not unmanageable. I searched the thread, but couldn't find any mention of the motor you are using, nor the wheel type. So, I'm going to make an assumption here that it will be a CIM driven direct drive shooter. Let's assume you are getting a maximum of 5000 RPM. That means 83.3 RPS. If you gather a count sample 10 times a second, you will only see a maximum of 8.33 counts. So, 8, or 9. Miss just one count and your error is +- 625 RPM. Therefore, you can only adjust your RPM in 625 RPM steps as well. That is not very much control. So, that tells us using the period approach should be quite a bit better. With only 1 cycle per revolution, you don't need to worry about inaccuracies in the pulse positioning caused in manufacturing. So, looking at the example Mark gave in post #2, the "Begin.vi" sets up the timer to average 5 counts. With the "Period" example I gave previously, it reads the samples every 20+ ms. If you use his "Begin.vi" and my Period.vi in your periodic tasks, you would only need to set the average to 2 counts. (Ether pointed out in a PM, there is no need to average with a single count encoder, so leave it at the default of 1.) Now when you feed a value into the control, it needs to be in the form of the period desired. For example: 3000 RPM = (3000/60) = 50 RPS, therefore the period desired is 1/50 or .02 seconds. Below is a picture of the "Period" control. |
Re: Photosensor as encoder for bang bang.
I do have the mini cim attached directly to the wheel. I am using a wheel like this http://www.andymark.com/product-p/am-0970.htm
Now i was able to make a small part of the wheel white so the photosensor has something to recognize. My question is how big should the mark actually be on the wheel for the photosensor to recognize it in a well fashioned time? |
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
I'll do my best. Sorry to have been away all day, it's build season and I was mentoring two teams today. Barely had time for lunch and got home an hour ago.
OK, 1 tick per revolution is REALLY LOW, so expect it to yield less than optimal results, though not unmanageable. I searched the thread, but couldn't find any mention of the motor you are using, nor the wheel type. So, I'm going to make an assumption here that it will be a CIM driven direct drive shooter. Let's assume you are getting a maximum of 5000 RPM. That means 83.3 RPS. If you gather a count sample 10 times a second, you will only see a maximum of 8.33 counts. So, 8, or 9. Miss just one count and your error is +- 625 RPM. Therefore, you can only adjust your RPM in 625 RPM steps as well. That is not very much control. So, that tells us using the period approach should be quite a bit better. With only 1 cycle per revolution, you don't need to worry about inaccuracies in the pulse positioning caused in manufacturing. So, looking at the example Mark gave in post #2, the "Begin.vi" sets up the timer to average 5 counts. With the "Period" example I gave previously, it reads the samples every 20+ ms. If you use his "Begin.vi" and my Period.vi in your periodic tasks, you would only need to set the average to 2 counts. (Ether pointed out in a PM, there is no need to average with a single count encoder, so leave it at the default of 1.) Now when you feed a value into the control, it needs to be in the form of the period desired. For example: 3000 RPM = (3000/60) = 50 RPS, therefore the period desired is 1/50 or .02 seconds. I am having trouble. I am using what you told me but my motor is not getting any value except for 0 |
Re: Photosensor as encoder for bang bang.
1 Attachment(s)
Quote:
|
Re: Photosensor as encoder for bang bang.
Quote:
Quote:
|
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
Quote:
|
Re: Photosensor as encoder for bang bang.
OMG i finally got it. The encoder reset was my problem. Everything works Perfectly. Thank you everyone
|
Re: Photosensor as encoder for bang bang.
Nothing better than watching a student finally 'getting it'. Thanks, Ether, Billbo, and anyone else for their help.
Gotta love CD. |
| All times are GMT -5. The time now is 22:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi