# INDUSTRIAL ENCODER

This code seems to work ok on my mods to the carriage feed on my miniature engine crankshaft grinder.
It is to drive a measurement display but the ratio application might be of some help.
Ended up replacing thew 16tpi feed shaft with 20tpi.

``````void dsPlay_16tpi() {
lcd.clear();
lcd.print("Counter = ");             // Display the value of the Counter
lcd.print(counter);
disVal = ((counter / 4.8) / 10000);  // encoder is 1200 pulses per rev, total(counter)calculated by..... feed is 16tpi (62.5 thou" per rev),
lcd.setCursor(0, 1);                 // ratio of feed screw to encoder via belt drive is 1:2.5 so for ever rev of feed screw,
lcd.print("Travel  ");               // encoder pulses 3000...example(3000/4.8 = 625) (625/10000 = 0.0625 or 62.5 thou)
lcd.print(disVal, 4);                // Distance Value to 4 decimal places shows measure to 0.5 thou"
delay(200);
temp = counter;
}

void dsPlay_20tpi() {
//FOR 20 tpi lead screw driven direct or at 1: 1 belt drive
lcd.clear();
lcd.print("Counter = ");             // Display the value of the Counter
lcd.print(counter);
disVal = (counter / 24000);          // If using the encoder direct drive or via 60:60 belt drive and 20 tpi feed screw
lcd.setCursor(0, 1);                 // 20 tpi = 50 thou per turn....1200 count represent 50 thou travel
lcd.print("Travel  ");               // calculation now becomes 1200/24 = 50 thou per turn ....
lcd.print(disVal, 4);                // Distance Value to 4 decimal places shows measure to 0.5 thou"
delay(200);
temp = counter;
}
``````

dave-in-nj:
If anyone wants an example of why noobs find this forum to be antagonistic this is a perfet example
Instead of discussing the technology which the OP says works
Without understanding tte Application we question the parts being used.

Agree completely.

krupski:
Agree completely.

If you have a complaint about the way I dealt with this Thread then please say so directly.

If you don't have a complaint about me then please explicitly exclude me from your remark.

I am always willing to try to improve my own shortcomings (they are many) but I will not be included in a sweeping complaint that may or may not be intended to cover my remarks.

...R

Robin2:
If you have a complaint about the way I dealt with this Thread then please say so directly.

If you don't have a complaint about me then please explicitly exclude me from your remark.

I am always willing to try to improve my own shortcomings (they are many) but I will not be included in a sweeping complaint that may or may not be intended to cover my remarks.

...R

On another thread discussing how we answer questions, the request was made to point out any threads where it is perceived that we as a group are not addressing the request from the OP in a relatively professional manner.
The request is simple math, nothing more.
If the OP cannot use integer math to make 5080 to into 5000, by using steps of 200 (or microsteps) then the math speaks for itself.
the OP is quite satisfied with the encoder being used, and even if he was not, the simple fact that it exists does not make it wrong, and in many cases, the poster is not authorized to alter the operation of a machine in a facility.
If the machine is operational, then the parts can be assumed to be either professionally engineered and properly selected for the process, or operation of the machine is acceptable with those parts.
I question if the OP gave enough information for the request. I am not sure if the 5,0000 steps is motor steps, steps per device rotation, or steps per process operation (multiple rotations)

but it boils down to the perception of the OP.
based on reading all the responses, would you, as a noob, feel that the question was getting an acceptable answer, or, would you as a noob, feel that the snobs were finding fault with that parts you bring to the table ?
it all boils down to perception.
at the end of the thread, did we pull enough information out of the OP to be able to formulate an educated answer ?
at the end of the thread, did we offer an answer that helps the OP towards a resolution of their problem ?

dave-in-nj:
but it boils down to the perception of the OP.
based on reading all the responses, would you, as a noob, feel that the question was getting an acceptable answer,

I don't see the purpose of this, and you seem to have avoided expressing your own opinion.

As far as I am concerned other people (but not the OP) have complained about the responses in this Thread. The first Reply was mine. I think it, and my Reply #3 was perfectly appropriate, but it is for someone else to express a different view.

If my comments were / are appropriate then I don't like being included in a sweeping and non-specific complaint.

...R

No monkeys yet :). By torque I meant the stepper will be working very slow,
-even with the high microstepping I have chosen the torque is very good.
I will try to be more clear.
When my hand moves the encoder shaft
the ball screw (16 mm /turn by specs) moves 25.4 mm.
The system does what I need. But with a mechanical array.
The encoder provides 5000ppr to my driver.
With only these 5000 ppr, I need the 1:1.6 belt array to achieve 25.4 mm at the ball screw.
I need 5080 ppr to achieve 25.4 mm at the ball screw.
So I had a crazy idea:
Could Arduino help to get rid of 4 pulleys and two belts?
I think something simpler and cheaper than this:
motrona GmbH: Frequency Divider / Impulse Multiplier for top hat rail
Thanks.

Did you miss post #6?

Robin2:
If you have a complaint about the way I dealt with this Thread then please say so directly.

If you don't have a complaint about me then please explicitly exclude me from your remark.

I am always willing to try to improve my own shortcomings (they are many) but I will not be included in a sweeping complaint that may or may not be intended to cover my remarks.

...R

Did anyone mention you? Am I now being yelled at for agreeing with someone?
Arduino forum: Damned if you do, damned if you don't.

krupski:
Did anyone mention you?

My compliant is that when names are not mentioned nobody can know whether s/he is included or excluded and human nature being what it is people are inclined to assume the worst.

...R

Robin2:
My compliant is that when names are not mentioned nobody can know whether s/he is included or excluded and human nature being what it is people are inclined to assume the worst.

...R

Quite honestly, I didn't look at the sequence of the posts and didn't get any sense that the poster I agreed with had targeted anyone in particular.
Looking back on it, I see that it could have been directed at you, but I didn't notice it at the time. I simply agreed with the concept that "some posters here are sarcastic and unhelpful".
If I had to compile a list of the "offenders", I would not place your name in it.
OK?

krupski:
If I had to compile a list of the "offenders", I would not place your name in it.
OK?

That's good to know but it's not really the point I was trying to make - what about all the other "good" contributors whose names you have not mentioned? By the way these are general comments and I especially don't want this to seem like an attack on you personally.

There have been many occasions when people have made comments such as " an example of why noobs find this forum to be antagonistic this is a perfet example" (from Reply #8) which apply the tar-brush to everyone who contributes (especially the regulars). Your version "some posters here are sarcastic and unhelpful" is better, but it can still create doubt about everyone in the mind of a reader who has very limited experience of the Forum.

In summary, I am saying that if anyone finds a Reply offensive they should point that out as a direct response to the offensive Reply and not make sweeping generalisations.

...R

…and from my perspective, it’s easy on a ‘bad day’ to become tired of beginners that simply don’t try, or have some entitled attitude.

One day we’ll help down to lines of code, others we’ll link to google.

Burn out is a very real condition, and humour can be a release, as can sarcasm, or banging on the table. It works both ways.

If one can’t ‘be bothered’ to pick up a pencil, why would someone else tell them how to write a book?

lastchancename:
..and from my perspective, it’s easy on a ‘bad day’ to become tired of beginners that simply don’t try, or have some entitled attitude.

One day we’ll help down to lines of code, others we’ll link to google.

Burn out is a very real condition, and humour can be a release, as can sarcasm, or banging on the table. It works both ways.

If one can’t ‘be bothered’ to pick up a pencil, why would someone else tell them how to write a book?

Excellent post. Me, personally, I do not like posts where the poster is obviously looking for a free handout and has not even tried anything on their own. In these cases, I don't even waste my time with a sarcastic reply... I just move on.

If I have a "bad day", I try to refrain from posting at all. In a bad mood, I can write things that I later regret. So I don't.

Others have obviously tried to make their project work and have done a lot on their own. When I know the answer to their question, I've spent lots of time making detailed posts, made diagrams, written sample code, etc... in order to help the best that I can. I see no need for sarcasm or other "worthless" posts. If I can help, I try. If not, I keep quiet.

But sometimes, in the midst of trying to help, the same "offenders" butt in and post either sarcastic, pointless or just plain wrong content that helps no one.

It's difficult enough to think through explanations, analogies or code designed to genuinely help without being harassed by the same few every time. That, I won't stand for.

Surely most everyone here (especially admins and moderators) have seen this kind of thing over and over again. Why they allow it to go on defies my understanding. A handful of troublemakers, allowed to muddy up most every thread, is certainly no good for this forum's reputation.

I'm sure a lot of us have been on other similar boards and have read what is said about this forum. Admit it or not, won't change the truth.

Robin2:
That's good to know but it's not really the point I was trying to make - what about all the other "good" contributors whose names you have not mentioned?

"Good contributers" would not be, and are not on my "naughty list".

Or, if you meant "why don't I mention the good as well as the bad", I don't see the point in praising what "good contributers" should be doing anyway.

Saying "good boy, you answered his question properly" seems to me, IMHO, rather insulting.

krupski:
Or, if you meant "why don't I mention the good as well as the bad", I don't see the point in praising what "good contributers" should be doing anyway.

It seems I am failing miserably to get my point across. To my mind it seems very simple,

A comment such as " an example of why noobs find this forum to be antagonistic this is a perfet example" gives no guidance for an inexperienced user of the Forum as to which helpers are good or bad. It's like saying "there are murderers in that apartment block". If someone told you that it would be wise to be suspicious of everyone in the apartment block.

Of course I don't expect you (or anyone else) to post a list of good guys

All I want is that when someone has a criticism it should be specific.

...R

HI, I am currently working on a project with an industrial incremental encoder directly connected to the driver (as step /dir source ) to hand drive a stepper motor. The motor speed is insignificant as it just copies the movement of the encoder shaft by hand. My goal is torque. Everything works great.
The encoder has 5000 pulses per turn .
Now, for my design I need exactly 5080 pulses per turn. How can I use an Arduino board to accomplish these additional 80 pulses?

The 5000 pulses per turn is inherent to the design of that particular encoder. It's a part of its hardware.

I don't think there are commercially available encoders that have 5080 pulses per turn. What's the reason for needing exactly 5080 pulses per turn?

Southpark:
The 5000 pulses per turn is inherent to the design of that particular encoder. It's a part of its hardware.

I don't think there are commercially available encoders that have 5080 pulses per turn. What's the reason for needing exactly 5080 pulses per turn?

I think this is what the OP is trying to do, but so far he's made no comment about it.

"5080" seems to be an oddball number until you see that it's exactly 25.4 (millimeters) * 200 (a common number of steps per rev of a stepper motor).

Divide encoder pulses by 25 and it comes out perfectly... one rev per rev.

...failing miserably to get my point across...

Is a common occurrence on this forum, but for some reason, we stick with it!

krupski:
I think this is what the OP is trying to do, but so far he's made no comment about it.

I think you're actually right in what you're suspecting there krupski.

I'm thinking that if the OP can simply have a program code that just keeps track of the number of steps, then he/she probably doesn't require any encoder. The code should just keep track of multiples of 5080, and then just hope that the stepping is reliable - no lost steps.

I guess they could have a shaft that comes out of both ends of the stepper. Two-shaft, and then mount an encoder of some sort that monitors angle, like an absolute encoder. So whenever a step occurs, the absolute encoder could help keep an eye of whether or not there was indeed a change in angle --- or a step occurred.

The other thing is ----- I thought that those ball screw mechanisms are made with specific dimensions that allow a travelling device to travel a particular distance for each full turn ........ and I also thought that they purposely made the dimensions to be compatible with the number of steps of stepper motors.... such as 200 steps per revolution, or even 400 steps per revolution etc.

at the end of the thread, did we offer an answer that helps the OP towards a resolution of their problem ?

This is a critical factor...
I for one often try to ‘fill in the blanks’ from my own experiences, but this doesn’t mean my strategy is correct, or the OP will understand if they don’t have some depth of similar experience.
I guess a knowledgeable answer can seem arrogant in the wrong context,or if poorly expressed.

At the moment, I don't think that 5080 steps is going to be particularly important. This is if the OP is thinking of a ball-screw mechanism is to make a travelling device move hypothetically 1 inch for each rotation of an encoder.

What is probably important (maybe, if I'm on the right track here) is that the ball-screw mechanism is manufactured to make the travelling mechanism move a precise distance eg. 1 mm for every full turn. And then it is just up to whatever is connected (a 200 step stepper, or 400 step stepper etc) to provide the fine steps in between.

So, at the moment, the OP probably needs to describe what he/she is actually trying to achieve. Such as ..... get a ball-screw-controlled travelling mechanism to move distances of 1 inch very accurately/precisely?