Sign in to follow this  
Followers 0
wsy_nte

1756-HSC

24 posts in this topic

Hi All, I have using 1756-HSC with 1500 PPR encoder. I want to calculate the motor RPM. How to do this calculation and setup on 1756-HSC module?Any idea or suggestion? Thank you. James

Share this post


Link to post
Share on other sites
Do you need it for measurement too or just RPM? Been a while since I used a 1756-HSC but I think I am remembering correctly. I normally use 1756-M02AEs. If you just need it for RPM set the counter mode to Frequency. Leave the scaler at zero. This should give you revolutions per second. If you also need length let me know, I've got some micrologix code I can convert to Controllogix that should work.

Share this post


Link to post
Share on other sites
Thank you TW. I need for both RPM and Length. I used 1756-HSC with same encoder that I used for 1769-HSC. James

Share this post


Link to post
Share on other sites
Try this code. I converted it from one of our Micrologixs. It should work but didn't have time to test it. PreviousPosition and FrequencySample are DINTs and Frequency is a REAL. SampleRate is set a 1000ms which will give you revolutions per second. XIO SampleRate.DN TON SampleRate ? ? XIC SampleRate.DN SUB Local:1:I.Ctr0CurrentCount PreviousPosition FrequencySample CPT Frequency FrequencySample/SampleRate.PRE*1000/2048 MOV Local:1:I.Ctr0CurrentCount PreviousPosition Sorry, still can't get those pretty images to post clearly Edited by TWControls

Share this post


Link to post
Share on other sites
Thank you. I tried the code and it works, but sometimes I got negative value on frequency (comes from FrequencySample). James

Share this post


Link to post
Share on other sites
Does your encoder ever reverse or are you hitting the rollover point?

Share this post


Link to post
Share on other sites
Change your compute to ABS(Frequency FrequencySample/SampleRate.PRE*1000/2048) This will take care of the negative sign Have you thought any about how you are going to deal with the rollover on you measurement? When you hit the rollover the Frequency is probably getting out of wack for that second but that can probably be solved with how you are dealing with your length rollover

Share this post


Link to post
Share on other sites
Measuring wheel dia is 210 mm, Liner speed (mm/sec) = frequency * 210 * 3.14159. Length is get from accumulated liner speed multiply by last scan time. Any idea?

Share this post


Link to post
Share on other sites
Can you explain you last post. I'm not quite understanding it or your question. Looks like the right calculation for you line speed in mm/sec

Share this post


Link to post
Share on other sites
I mean that the length calculation base on acummulated Line_Spead * Last Scan time (Length = Length + Line_Spead * Last_Scan). I did samething with mass flow calculation. Or may you have any idea how to get correct length calculation.

Share this post


Link to post
Share on other sites
I don't think I am still following you on this one. Our frequency is calculated off of our lenth. We already have it (Local:1:I.Ctr0CurrentCount). So the length ran would be Local:1:I.Ctr0CurrentCount/2048*210*3.14159. Am I following you correctly?

Share this post


Link to post
Share on other sites
For 1769-HSC, I agree that because we set not in frequency mode and why the count pulse will increment as encoder turn and will remain if encoder stop to turn. For 1756-HSC, as freq mode, presentcount will change to zero if encoder not turn. Any idea?

Share this post


Link to post
Share on other sites
I'm sorry. I forgot to state that the sample code I sent you was for the encoder in Encoder X1 Mode

Share this post


Link to post
Share on other sites
Hi.. I still have a problem with incorrect of rpm calculation from 1756-HSC. The rollover value and scaler is 0 and operation mode is 4. How to get the correct reading from 1756-hsc? Thank you for any suggestion or idea. James

Share this post


Link to post
Share on other sites
Are you saying that you are having a problem with the RPM when it rolls over ( goes from 2,147,483,647 to -2,147,483,648) If this is so how are you dealing with the rollover in you position? This may lead to the best way to deal with the RPM rollover If not, refresh me on how we ended up configuring the 1756-HSC. Its been a while.

Share this post


Link to post
Share on other sites
The first step is I want to calculate motor rpm. I used the tachometer and the reading is 1500 rpm but calculation on clx (Frequency) is unstable and I:PresentCount(0) is showing arround 16777103. The 1756-hsc setup is frequency mode (operation mode = 4), scalar = 0 and rollover = 0. Sampling time is 1 second. The clx logix is XIO SampleRate.DN TON SampleRate ? ? XIC SampleRate.DN SUB Local:2:I.PresentValue[0] PR1_PreviousPosition PR1_FrequencySample CPT PR1_Frequency PR1_FrequencySample*1000*60/(SampleRate.PRE*1500) MOV Local:2:I.PresentValue[0] PR1_PreviousPosition How to get the correct rpm calculation? Thank you. James

Share this post


Link to post
Share on other sites
That example was for position mode. You are in frequency mode Is Local:1:I.StoredValue[0] roughly equal to 90000 when it is running?

Share this post


Link to post
Share on other sites
The number of storedvalue is fluctuated and not linear to rpm changing. How to configure for frequency mode? something wrong with my configuration? I need help to fix this problem. Thank you. James

Share this post


Link to post
Share on other sites
One thing that hasn't been stated. What version of RsLogix 5000 are you using. Version 15 makes it easier to configure but it is still easy with earlier versions I will assume you have a version less than 15 Your Local:1:C.OperationalMode[0] should be 4 Your Local:1:C.Scaler[0] should be 0 or 100. I believe either will give you pulses/sec Your frequency should show at Local:1:I.StoredValue[0] Everything else unless I missed something should be zero. This is pretty straight forward so I am beginning to wonder if you have a wiring problem. What are you using to generate your pulses. How have you wired your 1756-HSC. And please give me details. These can be a little tricky depending on your voltage, if it is NPN or PNP output from your pulse generator, etc. Edited by TWControls

Share this post


Link to post
Share on other sites
Attaced is our hsc wiring, the quadrature encoder with 5 vdc supply. I want to reverse the connection between A0 and B0, may be help. Any idea? Thank you. James hsc_wiring.doc

Share this post


Link to post
Share on other sites
Ok, we either have a problem with your wiring or your configuration or both depending on how you look at it. What I am telling you below is going completely off of memory since I haven’t used the 1756-HSC in a while. Read chapter 3 and 4 of AB publication 1756-UM007AEN-P carefully You have you 1756-HSC setup for frequency mode. In frequency mode the 1756-HSC only uses input A to sample the frequency. You can’t get any type of distance measurement. If this is what you want, remove the wires from B0(5V) and B0(RET). Then place one jumper wire between Z0(12-24) and Z0(RET). Place another jumper between B0(12-24) and B0(RET). These jumpers may need to be connected to Z0(5V) and B0(5V). I am going off of the example on page 4-8 of the publication I stated earlier. I believe earlier you stated that you had to measure distance too. If this is so frequency mode will not work. At this point we need to clarify one thing. Encoders and Pulse Generators are terms that are sometimes swapped. The main difference between an encoder and a pulse generator is the B signal. On an encoder the B signal pulses just as the A signal but are offset 90 degrees. If this is what you have you must use encoder mode. In a pulse generator the B signal tells direction. +V is the positive direction and 0V is the negative direction. If this is what you have you need to use counter mode. I believe the way you are wired will work in either encoder mode or counter mode. The one thing I am not sure of is how the 1756-HSC works without the Z marker. I know a 1756-M02AE will not work without the Z marker. I say a Z marker but it may be called a C signal, Gate, Reset or something else. Maybe you could post the wiring diagram of your pulse generator to clarify. This marker only pulses once per revolution to determine commutation. To you have some type of Z marker?

Share this post


Link to post
Share on other sites
Thank you TW for soggestion, I have wrong connection for freq mode and disconnect channel B and now it works. James

Share this post


Link to post
Share on other sites
Just remember you will not be able to measure length with your frequency setup

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0