Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > How to measure speed in RPM using PSoC 5

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



How to measure speed in RPM using PSoC 5
Moderator:
ANCY

Post Reply
Follow this topic



How to measure speed in RPM using PSoC 5

Sandee posted on 05 Apr 2013 2:23 PM PST
Member
7 Forum Posts

 Hello, I am working in the speed control of DC Motors. I have used MOC 7811 for sensing the speed which gives one pulse per revolution. These pulses are counted using counter(continuous count).  I want to convert this in to RPM.How can I do this?




Re: How to measure speed in RPM using PSoC 5

danaaknight posted on 05 Apr 2013 02:57 PM PST
Top Contributor
1773 Forum Posts

Frequency counter. So typical is place a counter, set it as up counter.

Place a timer, or clock, will use as gate,  1 Hz, and supply that to

counter enable. Set up interrupt on timer gate going negative. In ISR

read counter, reset it to 0.

 

The count that you read during ISR is pulses/sec, eg. RPM. Resolution

1 Hz or 1 RPM.

 

You can set the gate to 10 Hz, and multiply the count read in ISR by

10. This gives you faster  frequency measurement. But resolution now

10 Hz, or 10 RPM.

 

Regards, Dana.

 



Re: How to measure speed in RPM using PSoC 5

danaaknight posted on 05 Apr 2013 03:01 PM PST
Top Contributor
1773 Forum Posts

Forgot, counter width must be > max RPM you are going to read,

So if max is 10,000 rpm, then counter is 16 bits.

 

Regards, Dana.



Re: How to measure speed in RPM using PSoC 5

Colla posted on 05 Apr 2013 03:53 PM PST
Member
2 Forum Posts

1s response seems quite large. Shorter gate period makes your system respond faster but lowers resolution.



Re: How to measure speed in RPM using PSoC 5

hli posted on 08 Apr 2013 11:50 PM PST
Top Contributor
675 Forum Posts

If you want to get the fastest response time, use period measurement (use the pulses from your motor as gate signal, and count the number of clocks from an internal clock). That way you get new measurement for each motor revolution (but accuracy decreases with higher RPMs).



Re: How to measure speed in RPM using PSoC 5

danaaknight posted on 08 Apr 2013 04:38 AM PST
Top Contributor
1773 Forum Posts

The use of period vs frequency counter approach has a number

of characterisitics that need to be examined. For example period

counters used as a F counter at higher frequencies generally burn

more power as an approach because of the resolution clock F

needed. Also be aware of enable timing limitations on a PSOC

counter.

Attached some considerations for both.

 

Regards, Dana.

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20