Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Kfischer on January 15, 2022, 07:57:19 PM

Title: Manual pulse encoder & mach3
Post by: Kfischer on January 15, 2022, 07:57:19 PM
Hey all,

I am struggling to get my manual pulse encoders to work with mach3.

I have a DB25 1R5AM board, mach3 on win7, encoders are 100ppm and have the following pins:

A
B
/A
/B
V0
Vcc

From what I can read I just hook the A and B to inputs on the board. But it doesn't seem to do anything! (Change pins in the MPG tab to reflect the pins on board ofc).

The manual encoders did not come with any instruction or manuals.

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 15, 2022, 10:16:23 PM
I should add

I am trying to set up my Z and X axis to be able to do manual work on a lathe.

I have two of the above wheels and want to be able to switch to MPG under jog and then be able to move the tool around.

The DB25 1R5AM is connected to mach 3 with one parallel port (I have a 2nd card and a C10 board). Am I missing a part? Reading sounds like people use a C22? I was hoping to strictly use the P Port.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 16, 2022, 01:56:59 PM
Hi,
that MPG looks like it has a +A/-A output and a +B/-B output.

measure with a multimeter the output of just one, say +A. I suspect it will only go to 2.5V while the -A will go to -2.5V, and then swap over.
This is differential output and I suspect has insufficient voltage to be 'seen' by your BoB.

You may need to build an amplifier that converts the differential to single ended 5V, assuming your BoB is 5V...you don't say.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 16, 2022, 10:31:57 PM
Just the +A and +B outputs can be used in a single ended system like a parallel port interface as long as ground noise is not too great. -A and -B would be unused.

The typical 5 volt differential encoder has two complementary outputs per phase. When +A output is on (5V)  -A is off (0V) and when +A output is off (0V)  -A is on (5V).  If you attach the positive lead of a meter to +A and the negative lead to -A the meter will read either plus 5V or minus 5V depending on the state of the output. The difference between the two states is 10 volts compared to the 5 volt swing of a single ended output. Not only does a differential signal give you twice the noise margin but but also cancels common mode noise.
Logic outputs don't actually go all the way to ground or the power rail so the voltages in the example above would be slightly less, say 0.5V and 4.5V.
 
https://www.digikey.com/en/articles/understanding-encoder-output-signals-to-aid-optimum-device-selection#:~:text=An%20encoder%20that%20contains%20a,exact%20opposite%2C%20or%20complementary%20signal.


Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 17, 2022, 01:06:01 PM
Thanks for the replies.

Here is what the voltage does with meter on A and -A

https://youtube.com/shorts/1pV5mxpi51c?feature=share
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 17, 2022, 01:26:07 PM
In the video the encoder  is being turned too fast for the meter to settle so I'm not sure what I'm seeing. When you measure from +A to -A I would expect to see some negative values but didn't.
Try measuring from each output to ground (0V). If you turn slowly enough you should see values near 0V and 5V. All 4 outputs +A, -A, +B and -B should look the same.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 17, 2022, 05:02:36 PM
Okay, here is a longer video and I turned slow (sorry haha, newbie here).

https://youtu.be/TmQur5z5cpE

Also, with the C10 break out board, I did some reading and do I need to install the UC plug-in? If so, windows 7 ultimate doesn't seem to support. Net 2.0 framework (not supported by Vista error) and mach 3 gives me a defective plug in if i install it regardless?
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 17, 2022, 06:05:39 PM
The outputs of a quadrature encoder should be on 50% of the time and off 50%. This is not what I see in your video, they are at 0V most of the time with a brief excursion to about 2.5V. The most I saw from +A was 1.25V but that might just be your meter not reading quickly enough. You should be able to find positions where the output stays at the higher voltage.

We really need more info on your encoder, does it have a model number?

Your encoder may need pull ups. If you don't have resistor in the range of 1 to 10K on hand you can use your C10 board for a test. Configure it as shown in this diagram to provide pullups. Which encoder output goes to which input isn't really important as long as they see a pull up from an input. No 25 pin port connection is needed, just power and the encoder.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 11:43:00 AM
Thanks,

I will test out the wiring you gave me and set it for pull ups. I'll test V at the board as well on the encoder and get back to you.

These encoders are just Amazon special ones lol. Photo of the product number on the encoder.

ZSS600-001-100B-5L
NO:YCJ 2021.04.02

Thansk for the help, much appreciated.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 12:40:42 PM
Hi,
I bought this:

https://www.ebay.com/itm/201195367332 (https://www.ebay.com/itm/201195367332)

It might be old but great quality.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 01:03:28 PM
Thanks Craig.

I could send these back through Amazon and get a refund easy enough.

I'm getting pretty tired of trying to make this lathe work. It was sold in working condition - but nothing worked. I couldn't get anything to talk and have slowly been replacing pieces and getting them running. Only saving grace was the price of the lathe lol.

I could also order from cnc4pc where I got the c10 board as they guarantee that things work. Only reason I didn't do that to begin was I was hoping the encoders on the lathe world work with the c10 but they didn't.

Chasing my tail endlessly here haha!
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 18, 2022, 01:37:42 PM
I have found general information about your encoder series but nothing that says what options yours has. If it does have open collectors it should work correctly with pullups.
If the encoder does test OK connect +A and +B to the inputs of your choice and configure the software to match.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 05:17:50 PM
Okay,

You were right on the pull ups and mach3 reads clicks and will move the motor. Awesome leap forward.

Testing voltage at the board and looks like if I turn clockwise, A will give 2.5v fairly consistently and counter clockwise is .5v (prob negative or what ever but my meter doesn't show a negative or positive sign.)

Now, the issue is, clockwise and counter clockwise move the motor  negative units on the X axis (so tool moves to the part regardless if I turn CW or CCW).

I'm guessing I don't have a setting set properly in mach3?

Just have mpg1 turned on with pins assigned for A and B.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 18, 2022, 06:34:57 PM
I see two things wrong in your description of the encoder operation, the output only goes to 2.5V and the readings are different when you change direction.

Here is a video testing the same part number encoder.  https://www.youtube.com/watch?v=NvHlbB1eWSs
Look for two things as you watch. When the model number is shown the 2nd line is a different format than yours. video=NO D20180915 your photo=NO:YCJ 2021.04.02. Does the difference mean it's counterfeit or did they change the numbering scheme? Possibly it means it has different options.
About a minute in when the dial is being turned you can see when it stops the mechanical detent holds it exactly on an index mark.

 The 2.5V reading instead of the 5V I expect could be you're turning too fast. If you stop on the detent and slowly advance one click at a time you should see either 0V or 5V.
The output pattern of a quadrature encoder is
A    B
0V  0V
5V  0V
5V  5V
0V  5V
etc.
Note the state of either output changes every 2 clicks.

The C10 boards inputs are CMOS. They expect an ON signal to be above 3.3V and an OFF signal to be below 1.6. The actual threshold where it decides whether an input is On or OFF is somewhere in between. If the IC on your board has a threshold a bit below 2.5V, and your measurement is correct the input would work - barely.

To summarize, either the output voltage of your encoder is too low or it's not a quadrature encoder.
Craig's suggestion to buy from a known good vendor may be the best solution.

John
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 07:24:45 PM
I'll look into sending these back and buying better quality.

Lots of delay In these ones as well. Sometimes it will take 30 seconds for it to even move the motor?

This stuff is pretty frustrating haha.

I've tried searching for a place in Canada that sells MPGs but no luck finding one. Guess I'll have to wait for shipping from the US.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 07:26:53 PM
Would these be suitable?

https://www.ebay.com/itm/273540259850?hash=item3fb045200a:g:P18AAOSwUm5b3JF9

The one Craig listed is 12V not 5V, which means I'd also need to buy a power source on top of the MPGs
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 07:51:12 PM
Hi,

Quote
The one Craig listed is 12V not 5V, which means I'd also need to buy a power source on top of the MPGs

Very true, but its Japanese quality, and that's quality with a capital Q. Sensei have a range of different models, 12V, certainly....after all I have one, 24V I recall seeing and I think
a +5V/-5V one as well.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 18, 2022, 07:56:12 PM
The item in your link looks OK but is pretty expensive.
I searched ebay.ca for "100ppr Manual Pulse Generator" and found many items. This one claims to ship from the US.
https://www.ebay.ca/itm/301581285751?hash=item4637a53977:g:cfEAAOSwPhdVG-QU
It's the four terminal type but you don't need -A or -B.
Lack of details in the listings always makes it hard to know what you are getting. It would be good to have one with mechanical detents so it stays put when you're not turning it.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 08:02:49 PM
Hi,
yeah, looks good....but does it smell of Chop Suey??? Whats the bet it's Chinese.

This is another Japanese brand...not cheap and second hand, and yet STILL preferable to Chinese rubbish:

https://www.ebay.com/itm/131432378954?hash=item1e99faf24a:g:YqEAAOSwBLlU41Sn (https://www.ebay.com/itm/131432378954?hash=item1e99faf24a:g:YqEAAOSwBLlU41Sn)

5V input, A ans B outputs.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 08:09:39 PM
Lol thanks Craig.

That one would be 130 dollars US just to ship to me - no go on that haha.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 18, 2022, 08:27:52 PM
The MPG is a nonessential option so you can take a chance on the cheap route, especially if this is for hobby use. If it dies you can get along with the regular jog until you find a better one.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 08:40:01 PM
Hi,
I use a service that is run by the New Zealand Postal service. They maintain a warehouse in Portland, Oregon. As a participating customer I have any US items shipped to
Oregon, usually $15-$20USD, and then the service kicks in, they tell me how its going to cost to get to New Zealand and also the New Zealand Good and Services Tax (15%),
I pay them and it turns up on my doorstep about 10 days later. Too easy!

For example the MPG I bought was $26USD, plus 14$USD shipping to Oregon or $60NZD. I paid NZ Post $39NZD for shipping to New Zealand and the tax. Not cheap, but not really expensive either,
and certainly very convenient.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 08:44:10 PM
Hi,

Quote
The MPG is a nonessential option so you can take a chance on the cheap route, especially if this is for hobby use. If it dies you can get along with the regular jog until you find a better one.

I use my machine multiple times a day, and not having a reliable pendant is a PITA, not a show stopper but bloody inconvenient....and that's why I went to the effort to
make my own.....its as reliable as I design it to be......with the only real unkown being the MPG itself, and for that purpose Japanese quality just can't be beat.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 18, 2022, 11:25:15 PM
Alright, will return these mpgs tomorrow and ordered some of the Sensei brand Craig suggested (23 dollars each). Will be here in a week.

Thanks again everyone,

I'll do all the same tests when the new ones arrive and in the mean time I'll go purchase a 12V power supply for the new ones coming.

I'll update with voltages and outcomes soon!

- Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 18, 2022, 11:58:52 PM
Hi,
my new mill has Delta servos and has 24VDC signaling. I wired 24V to the pendant, and have a LM8712 regulator to drop the 24VDC down to
12VDC for the MPG. The MPG outputs both source and sink current, but not much, they have an output impedance of around 10kOhm.
I run the outputs into the bases of two NPN transistors so that the collectors could sink 24V and signal my BoB. To pull the BoB low requires
5mA, an the AB outputs of the MPG cannot do that directly.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 12:04:22 AM
I dont really know what that means Craig hahaha 🤔
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 19, 2022, 12:07:05 AM
Hi,
what it means is the outputs of the MPG are fairly weak and you may require some buffering between the outputs and your BoB
inputs. In my case I just used a single NPN transistor, 2 cents each variety....

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 12:15:37 AM
Okay, well I use a C10 breakout board.

I dont know If this board will need NPN transistors? (I don't even know what that is either).
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 19, 2022, 12:49:39 AM
Hi,
the C10 shows a 4.7kOhm pull-up/pull-down resistor, so the input impedance will be around 4.2kOhm.
You'll just have to try the AB outputs of the MPG, they may be enough to trigger the BoB, but then again maybe not.
My recollection when designing/building my pendant was that to output impedance of the AB outputs was 10kOhm.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 12:59:04 AM
Thanks Craig.

As for transistors, something like this work?

https://www.amazon.ca/200Pcs-Transistors-Values-Power-Assortment/dp/B07X62PBMH/ref=asc_df_B07X62PBMH/?tag=googlemobshop-20&linkCode=df0&hvadid=459552105769&hvpos=&hvnetw=g&hvrand=8589472011198456784&hvpone=&hvptwo=&hvqmt=&hvdev=m&hvdvcmdl=&hvlocint=&hvlocphy=20113&hvtargid=pla-1363671464521&psc=1

Also, as for wiring one in.

I would go the AB outputs to the Collector terminal on transistor, the emitter pin would go to Bob and the base pin needs another input.

Would I just run a separate 12V current to the base pin (given the mpgs are 12V?) Or would I just run a 5V current to it cause the BoB is 5V?

Or would I need a different voltage all together?
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 19, 2022, 01:16:23 AM
Hi,
I think you will need a 12V supply, but it need only be very low current.

If you need to amplify/buffer the AB MPG outputs something very simple like attached pic.
The transistors need only be small signal types, say BC547's or similar...I have hundreds of them lying around, and as
most of my parts are now surface mount I very rarely use these through-hole types any more.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 01:21:16 AM
Okay, I can follow that.

What are the R1 and R2? Resistors?

T1 and T2 are the transistors?

Also, why is the A and B emitter pins grounded together...?
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 19, 2022, 01:46:18 AM
Hi,
R1 nd R2 just provide some base resistance, say 1kOhm would be fine. T1 and T2 are indeed NPN transistors.
When the base of T1 is energised then T1 will saturate and pull the collector down to 0V , or very close to,
say 0.2V.

Thus the two transistors are just current controlled switches. The current in the base circuit is likely to be 100uA, while
the collector-emitter current will be several mA, ie the transistors provide amplification of a low current, either A or B outputs
and can switch several mAs.

Craig

Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 10:37:30 AM
Okay,

So my next question then is where does the input signal go for the BoB to know how much to move the motors?

The diagram shows active low outputs, which outputs a signal to the NPNs and then it cycles around to a ground terminal?

My brains not connecting the how to of getting the mpg to signal the board to move the motors 😬

Currently my MPGs are connected to 2/3 pins set as inputs.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 11:15:03 AM
I guess by your diagram you are grounding out your outputs and when the output grounds out your board sends the signal to the motors to move 1 step?

I guess if I used inputs I would have 5V going to both Collectors of the NPN and the emitter would be wired to my input pins on the board.

So when A or B applies a small amount to the base, the transistor opens up and amplifies (or allows) 5V to flow to the board input pin, signaling the motors to move?

Then I'd need A signal to move CW and B signal to move CCW motion of the motor?

Is one way better to wire then the other?
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 19, 2022, 02:17:53 PM
Hi,
Quote
I guess by your diagram you are grounding out your outputs and when the output grounds out your board sends the signal to the motors to move 1 step?
Yes, that is correct and its called 'active low', and what it means is the circuit 'sinks current' when the signal is active. If you were to use this you would have the resistor in the
C10 set as a pull-up. Thus in its natural state it would be at 5V. When the transistor conducts, ie signal active, it will be pulled low, to 0V or close to.

Quote
Then I'd need A signal to move CW and B signal to move CCW motion of the motor?

In Machs Input tab you can select or alternately deselect 'active low'. You will alter that setting until and possibly swap the AB wires until Machs logical direction matches
the MPGs physical direction.

You are trying to overthink it. You may NOT even require the extra transistors yet,  just a resistor and diode to limit the 12V swing of AB to 5V. It will all become clear once you've got the MPGs.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 19, 2022, 02:28:39 PM
Thanks Craig.

I'll wait out on purchasing anything else other then the 12V power supply.

Once I test and post some numbers here I'll look into getting what ever else needed to make them run reliably and accurately.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 24, 2022, 10:14:42 PM
In Machs Input tab you can select or alternately deselect 'active low'. You will alter that setting until and possibly swap the AB wires until Machs logical direction matches
the MPGs physical direction.

You are trying to overthink it. You may NOT even require the extra transistors yet,  just a resistor and diode to limit the 12V swing of AB to 5V. It will all become clear once you've got the MPGs.

Craig

Craig,

Setting up mach3 to work with these MPGs through the diagram you posted, in the input tab what do I set to active low?

OEM triggers?

 Input 1/2/3?

Jog ++/jog--?

I have the mpg tab set for pins 2 and 3, everything is wired in as per the diagram.

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 02:30:57 AM
Craig,

Testing the wheels. Looks like when turned CW the A pin gives 3.9-4.1V and B pin is 0.5V.

Then vise versa. If I turn quick it will jump up to 7-8V briefly.

Will I need to worry about that? Or can I direct wire to the BoB with the 4V and 0.5V changes?

Thanks,
Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 02:40:22 AM
Hi,
have you supplied the encoder with 12V?

If so the outputs A & B will also be 12V or close to. Its probably a good idea to use a 4.7V Zener diode on each output to ensure that no damaging
voltage (that is over 5V) gets into your BoB. Having said that the outputs are both fairly high impedance and are not likely to damage the BoB,
so the Zeners are precautionary.

Then hook the MPG outputs (Zener limited) to the BoB and then to Mach. You may need to reverse one or even both outputs (by changing active high/active low)
to ensure that Mach correctly determines which way you are spinning the MPG.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 04:11:24 PM
Craig,

Testing the wheels. Looks like when turned CW the A pin gives 3.9-4.1V and B pin is 0.5V.

Then vise versa. If I turn quick it will jump up to 7-8V briefly.

Will I need to worry about that? Or can I direct wire to the BoB with the 4V and 0.5V changes?

Thanks,
Kyle

Okay, well here is a video of the MPG. Again not sure if I did it properly but the zenners sound like an easy enough thing to do.

Let me know what you think?

https://youtu.be/852qesaJWrg

Also, I think they are pulsing properly from reading other forums?

right
both
left
none
right
both
left
none

and the other way:

left
both
right
none
left
both
right
none

By watching the volts it seems correct on the single pin?

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 04:39:05 PM
Hi,
what the hell, in your video you showed the outputs varying, in probably the correct pattern but to about 50mV.....what gives?. The input to the BoB
needs to be 4.5-5V???

Don'y worry about the switching pattern....that will look after itself. Just hook one input, say A, to the BoB and measure the voltages as it turns on and off, and report.
Be careful to note whether you are seeing 'volts' or 'milliVolts'.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 05:01:16 PM
Hard to be sure what the wiring is from the video but the negative meter lead is connected to a terminal I think is only common to the +12-24V for inputs and the analog circuit.
 I don't see a wire to the PC COM terminal.

https://www.machsupport.com/forum/index.php?topic=43939.70
Several posts down ZASto provided the schematic for what is probably the same BOB board. It hard to be sure whether the 5V and 24V commons are the same.
Even if they are the same there would have to be a connection to the 12V common of the supply for the encoder.

Would the 10V from the BOB be enough to power the encoder, if it has 5V outputs it may well regulate its DC input to 5 V internally.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 05:40:27 PM
Hard to be sure what the wiring is from the video but the negative meter lead is connected to a terminal I think is only common to the +12-24V for inputs and the analog circuit.
 I don't see a wire to the PC COM terminal.

https://www.machsupport.com/forum/index.php?topic=43939.70
Several posts down ZASto provided the schematic for what is probably the same BOB board. It hard to be sure whether the 5V and 24V commons are the same.
Even if they are the same there would have to be a connection to the 12V common of the supply for the encoder.

Would the 10V from the BOB be enough to power the encoder, if it has 5V outputs it may well regulate its DC input to 5 V internally.

Thanks for the reply MN300,

The MPGs have an external power supply that comes from the wall which is 12V. That supply runs to both of them.

(Above video I just have the A terminal run through the meter to the main ground wire and was reading the output).

I have a C10 board with pins 2 and 3 as A and B with the COM set to ground. The C10 is only a 5V power supply in it. Hence needing the external 12V.

**** question then - does the BOB need to supply the MPG for proper reading in Mach3? ****

I left 1 terminal going through the bread board to the BoB and then put the meter in line on the other to test in this video.

Here is an updated video in Volts (lol)

https://youtu.be/-4xDqu0xisA

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 05:49:55 PM
Hi,
your making progress....but why is there 36V showing from time to time.

Do you have the 0V from your 12V external supply connected to the 0V COM of your BoB?. They will need to be connected.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 05:58:45 PM
Hi,
your making progress....but why is there 36V showing from time to time.

Do you have the 0V from your 12V external supply connected to the 0V COM of your BoB?. They will need to be connected.

Craig

No, the 12V and 0V are just wired to the external power source.

This image is what is hooked up. BOB isn't powered currently. Was just testing MPG A and B signal to see what I need to put between MPG and the BOB (resistors, zenners, etc) to make this work proper.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 06:03:33 PM
Hi,
Yes, the 0V of the external supply will have to be referenced to the COM of the BoB.

I suspect the that output impedance of the MPG is such that the inputs of the BoB will swamp the 12V A/B outputs down to 5v of the BoB,
Its not very elegant but it should work. Using Zeners and resistors is preferable.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 06:13:15 PM
That's minus 36V on the meter!
In one video you have a parallel port board and a C10 in the other. Neither really needs to be involved in the encoder test unless we establish a need for a pullup.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 06:22:25 PM
That's minus 36V on the meter!
In one video you have a parallel port board and a C10 in the other. Neither really needs to be involved in the encoder test unless we establish a need for a pullup.

The DB25 1R5AM board you see in the video is connected to the motors. The DB25 is strictly output pins and I couldn't get the MPG to run through it. The C10 which I had here recognized them and allowed mach3 to recognize them as well. So I've been  running just MPGs through the C10.

My computers PCI cards don't work properly. Signals to motors is all F****ed up and they don't get consistent pulsing. I am waiting on a Ethernet Smooth stepper to arrive to run the boards and use shielded cable to the computer.

Newest video coming soon, just uploading haha.

- Kyle
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 06:27:58 PM
Here is the minimum required for the encoder test.

Power supply negative to Encoder negative and to negative meter lead

Power supply positive to Encoder positive

Meter positive lead to Encoder output being tested.

Try that, more no less.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 06:29:14 PM
I meant to say no more, no less.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 06:37:02 PM
Hi,
Yes, the 0V of the external supply will have to be referenced to the COM of the BoB.

I suspect the that output impedance of the MPG is such that the inputs of the BoB will swamp the 12V A/B outputs down to 5v of the BoB,
Its not very elegant but it should work. Using Zeners and resistors is preferable.

Craig

Okay, we are attached to the common pin directly to the 0V on MPG.

https://youtu.be/hmAn-jH3RqQ
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 06:42:33 PM
Hi,
having had personal experience with these particular model MPGs, the outputs are 12V/0v. They are both sourcing AND sinking,
ie totem pole outputs, with an output impedance of about 10kOhm.

By all means test the outputs.....but it's not until you hook it up to the BoB that you will know if the outputs have enough current authority to
swing the BoB inputs. Also you won't really know until you try whether you have to limit the outputs to 4.7V or whether the input impedance of
the BoB inputs will 'drag' the incoming 12V down....to....what I wonder?

Craig
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 06:53:14 PM
Hi,
perfect, you should see the output change every second click...and thats exactly what you see.

In absence of the BoB the output would be 12V, but with the BoB its dragged down to just a little over the BoB supply voltage.
This is not ideal, but it works. You are relying on the output impedance of the A/B outputs AND the input diode clamps of the BoB
to ensure the voltage translation.

When I measured the output impedance of the MPG I did so very quickly.....so I can't be 100% about it being 10kOhm, although I
suspect it would be close. Likewise we cannot be sure of the input diode clamps.....I would guess we are seeing the ESD protection diode of
the buffer IC operating, and most engineers would say that relying on ESD diodes is a bad idea......even if it does work!

Craig.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 06:54:32 PM
Hi,
having had personal experience with these particular model MPGs, the outputs are 12V/0v. They are both sourcing AND sinking,
ie totem pole outputs, with an output impedance of about 10kOhm.

By all means test the outputs.....but it's not until you hook it up to the BoB that you will know if the outputs have enough current authority to
swing the BoB inputs. Also you won't really know until you try whether you have to limit the outputs to 4.7V or whether the input impedance of
the BoB inputs will 'drag' the incoming 12V down....to....what I wonder?

Craig

I tested them through the board to motors and it registers on mach3 and moves the motor. Though I can't say if the motor moves correctly due to the high interference in my PCI/parallel ports to know.

As for what the meter says https://youtu.be/hmAn-jH3RqQ

It looks pretty bang on for 5.2V and 0.3V.

The C10 board manual is attached.

I am not sure what the diagrams are, Having never taken an electrical course in my life I'm stuck with YouTube and forums to try and teach myself haha.

Thanks!

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 07:00:23 PM
Hi,
perfect, you should see the output change every second click...and thats exactly what you see.

In absence of the BoB the output would be 12V, but with the BoB its dragged down to just a little over the BoB supply voltage.
This is not ideal, but it works. You are relying on the output impedance of the A/B outputs AND the input diode clamps of the BoB
to ensure the voltage translation.

When I measured the output impedance of the MPG I did so very quickly.....so I can't be 100% about it being 10kOhm, although I
suspect it would be close. Likewise we cannot be sure of the input diode clamps.....I would guess we are seeing the ESD protection diode of
the buffer IC operating, and most engineers would say that relying on ESD diodes is a bad idea......even if it does work!

Craig.

In which case... I should run the A and B through zenners to be sure that the BOB just gets 5V?

There is a few diagrams in the manual with NPN and resistors but they don't specify what it's connected to 🤷‍♂️.

So they don't really mean much to me cause my brain doesn't really connect what's being wired.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 07:13:03 PM
Setting up the C10 inputs for pullup and using transistors to buffer the encoder is the surest and safest way to go. If the encoder series output resistance is anywhere near the value Graig suggests no other series resistor would be needed to connect to the base of the transistor.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 07:35:22 PM
Hi,
I just pulled my pendant to bits and measured the short circuit current of the output, 1.5mA and an open circuit voltage
of 6.7V

The Thevinin impedance is:
output impedance= 7.7V/1.5mA
=4.66 kOhm

So not 10kOhm, about 1/2 that, 4.7kOhm.....still should not trouble the ESD diodes but if you put a 4.7V Zener across the the BoB inputs...that would be
nice.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 07:39:16 PM
Setting up the C10 inputs for pullup and using transistors to buffer the encoder is the surest and safest way to go. If the encoder series output resistance is anywhere near the value Graig suggests no other series resistor would be needed to connect to the base of the transistor.

Sounds like a plan. Let's roll with it.

What do I need to buy for transistors to buffer The A and B and how do I wire that in?

Would I use an NPN like the attached photo?

And would I use it like the attached drawing?

Or, would I just need to put a Zenner diode on the A and B to regulate the encoder outputs to a 4.7V? (In which case I need a diagram lol)

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 07:41:55 PM
Hi,
I just pulled my pendant to bits and measured the short circuit current of the output, 1.5mA and an open circuit voltage
of 6.7V

The Thevinin impedance is:
output impedance= 7.7V/1.5mA
=4.66 kOhm

So not 10kOhm, about 1/2 that, 4.7kOhm.....still should not trouble the ESD diodes but if you put a 4.7V Zener across the the BoB inputs...that would be
nice.

Craig

Thanks for doing that Craig.

As for the Zener, i will need a wiring diagram dumbed down so I can read it hahahah. Google gives me lots but I don't have a hot clue what gets attached where. Lots show resistors used to?
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 07:47:28 PM
Graig,
If the output of the encoder has a totem pole with 4.7K in series it won't pull the C10 input down to a reliable level.
If the output has an open collector pulling down 4.7K it will work with the zener. To test that you could add an additional pullup and see if the output is still near zero.

John
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 08:02:56 PM
Hi,
not a lot to it, just place a Zener across each input, it will limit the max voltage input to 4.7V, ie within the BoBs sweet spot.
Don't need a circuit board just the the Zener tail into the input screw terminal with the other lead going to COM. Note the band (polarity) of the Zener.

Quote
Lots show resistors used to?

Don't really need another resistor because of the output impedance of the AB outputs....don't you just love Thevenin's Theorem!

Craig
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 08:11:25 PM
Hi MN300,

Quote
If the output of the encoder has a totem pole with 4.7K in series it won't pull the C10 input down to a reliable level.

You might be right......but if OP tries it my guess is it will work as is. If it does not work reliably, especially when spinning the MPG at speed
then a buffer transistor would be indicated. My pendant needs to signal 24V, active low, consequently I fed the A/B inputs direct into the base of a small signal NPN transistor
and the collector pulled the 24V from the BoB low....and its perfectly reliable.

My guess is that OP would rather not use a transistor if it can be avoided......it represents a complication that non-electronic people shy away from.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 08:13:58 PM
Thevenin's Theorem also applies to current source and a resistor to ground. A 1V source and with a 1 ohm resistor in series looks the same as a 1 amp current source through 1 ohm.
A magazine puzzler asked how to tell them apart if the power source was hidden and all you could see was the resistor. - Answer, the one with the current source would get warm with no load.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 08:15:56 PM
I agree, the physically simpler solution is better if possible.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 08:16:13 PM
Hi,
not a lot to it, just place a Zener across each input, it will limit the max voltage input to 4.7V, ie within the BoBs sweet spot.
Don't need a circuit board just the the Zener tail into the input screw terminal with the other lead going to COM. Note the band (polarity) of the Zener.

Don't really need another resistor because of the output impedance of the AB outputs....don't you just love Thevenin's Theorem!

Craig

Sweet. No clue who that man is but clearly he was smarter then me 😂😂.

As per diagram:

Why are the Zeners on the 0V to the common?

I thought they would be on the A and B?

Or, is what I am looking at that the Zener draws some of the power from A and B dumping it into the ground?

So if A puts 5.2V from encoder to Bob the Zener will take 0.5V away from that to the ground allowing 4.7V to continue to the board..?

And for the drawing, do I just sodler the junctions (little green circles)?
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 08:20:48 PM
You might be right......but if OP tries it my guess is it will work as is. If it does not work reliably, especially when spinning the MPG at speed
then a buffer transistor would be indicated. My pendant needs to signal 24V, active low, consequently I fed the A/B inputs direct into the base of a small signal NPN transistor
and the collector pulled the 24V from the BoB low....and its perfectly reliable.

My guess is that OP would rather not use a transistor if it can be avoided......it represents a complication that non-electronic people shy away from.

Craig

I like simple. Simple to make, simple.to repair lol.

Now, I'm all for what will work reliable and best. I learn fairly quick and am not afraid to do what's needed as long as I can get some direction haha!

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 25, 2022, 08:27:47 PM
After you make the circuit with the zener measure the high and low logic levels again. The highs will be the zener voltage (4.7V). The lows should be under 1.6V to meet the minimum spec. The actual threshold may well be higher but you can't count on that - design for worst case.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 08:30:41 PM
Hi,

Quote
Or, is what I am looking at that the Zener draws some of the power from A and B dumping it into the ground?

Yes that is correct, it sort of 'diverts' the extra voltage from getting into the BoB....we don't want to put any stress on the ESD diodes in the ICs.

Quote
And for the drawing, do I just sodler the junctions (little green circles)?

You can if you wish, I would just poke the wire in with the wire from the A output in the same screw terminal. The negative (COM) side hopefully you have a COM screw
terminal within reach and you can poke it into there.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 09:00:20 PM
Hi,

Quote
Or, is what I am looking at that the Zener draws some of the power from A and B dumping it into the ground?

Yes that is correct, it sort of 'diverts' the extra voltage from getting into the BoB....we don't want to put any stress on the ESD diodes in the ICs.

Quote
And for the drawing, do I just sodler the junctions (little green circles)?

You can if you wish, I would just poke the wire in with the wire from the A output in the same screw terminal. The negative (COM) side hopefully you have a COM screw
terminal within reach and you can poke it into there.

Craig

Well that sounds easy.

So I could take the Zener and basically insert it like a jumper from. Port 2 to common and then port 3 to common and just make sure its correctly orientated?

Amazing drawing attached.
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 09:06:18 PM
Hi,
yes, its that simple.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 09:12:13 PM
Hi,
yes, its that simple.

Craig

Awesome.

Thanks for all the help and enduring my lack of knowledge!

I will post back here once I get the smooth stepper and everything wired in.

MN300  - thank you for your help as well!

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 09:58:11 PM
Hi,
yes, its that simple.

Craig

One last question.

Looking at zeners, what MW do I want?

400? 500?

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 25, 2022, 10:09:53 PM
Hi,
500mW would be plenty, but really anything you can get.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 25, 2022, 10:10:44 PM
Hi,
500mW would be plenty, but really anything you can get.

Craig

I can get 500MW ones.

Thanks 😎😎
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 28, 2022, 11:14:25 PM
Hi,
yes, its that simple.

Craig

And I am back Craig! Haha

So, tested MPGs before hooking etc. All that's good from the above.

BUT, I had to get a smooth stepper as I couldn't get my PCI/parallel ports to settle. Way to much noise and motors stalled and surged etc. ********* show basically.

Smooth stepper fixed that, things run extremely well now.

Except, I have my C10 board plugged into the 2nd port of the ESS (from warp9) and I can't seem to get them to connect. I've tried following the set up articles and I dunno if it's cause I have Mach3 and not 4 but I don't have a lot of the screens shown in the set up.

So, basically I just took the printer port to the ESS and left the MPG port set up the same. But it doesn't talk for some reason.

The plugin screen that shows the encoders for the ESS and suppose to show a number as you dial, it doesn't read anything if I turn either dial (x and Z axis)

Any ideas? Let me know if you need photos of anything or video.

-Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 28, 2022, 11:25:44 PM
Hi,
Machs parallel port is actually much more than just a port, its a software driven motion controller. You can only have one motion controller, either an ESS OR a parallel port,
you can't have both.

The ESS has three ports, set up and numbered to match the old-school parallel port which it replaces. If you have motor motion, jogging etc through the ESS then
all three ports should work. Note the in the ESS plugin you can select, at least for ports two and three, to have pins 2-9 (of each port) as inputs OR outputs. How have you set
them up?

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 28, 2022, 11:29:26 PM
The ESS has three ports, set up and numbered to match the old-school parallel port which it replaces. If you have motor motion, jogging etc through the ESS then
all three ports should work. Note the in the ESS plugin you can select, at least for ports two and three, to have pins 2-9 (of each port) as inputs OR outputs. How have you set
them up?

Craig

Yes, just have the ethernet to computer. Both boards are connected to the ESS as shown in photo.

As for setting up the ports... I don't know? I followed the set up on warp9, never said anything about setting up ports on the ess itself?

Clearly I am missing something. I don't think anything is "wrong" with the ESS or the BoBs haha.

How do I go about setting up a second port on the ESS to register the C10 (as inputs I would assume)?

- Kyle
Title: Re: Manual pulse encoder & mach3
Post by: joeaverage on January 28, 2022, 11:30:59 PM
Hi,
I use my ESS with Mach4 so the details may differ but the setting you need to make is in the ESS plugin.

Craig
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 28, 2022, 11:33:06 PM
Hi,
I use my ESS with Mach4 so the details may differ but the setting you need to make is in the ESS plugin.

Craig

I will get some photos of the plugin screens tomorrow and hopefully something in there is set up wrong.

Thanks for the replies,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 12:30:15 AM
Hi Kyle,
I have looked at the photos, here is what I see,
The Zener diodes appear to be backwards, the end with the band should be connected to the input.

Jumper settings:
COM = GND
Pins 2-9 = Inputs
Pins 2-9 = PullUps
These are what I expected

Pins 10..15 = PullDown
Is this what you want? What are you connecting to these?

Check the voltage on the encoder inputs, They should switch from 4.7V to less than 1.6V. Lower than 1V would be even better.

John
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 11:33:36 AM
Hi Kyle,
I have looked at the photos, here is what I see,
The Zener diodes appear to be backwards, the end with the band should be connected to the input.

Jumper settings:
COM = GND
Pins 2-9 = Inputs
Pins 2-9 = PullUps
These are what I expected

Pins 10..15 = PullDown
Is this what you want? What are you connecting to these?

Check the voltage on the encoder inputs, They should switch from 4.7V to less than 1.6V. Lower than 1V would be even better.

John

Good eye John, you were right haha! I had signal sinking to the grounds. Swapped those zeners and now I have MPGs working.

BUT

this is an issue... lol

https://youtube.com/shorts/u5Wmyd8-Gsg?feature=share

Both set up in the same fashion, any reason the X just goes back and forth?

(I calibrated both axis with ghe mach calibration).

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 11:47:57 AM
Kyle,
It looks like one of the signals from the encoder is not making its way in to the MACH logic. It could be hardware or it could be software setup. Use your meter to check the input levels.
 You could have the problem with the input not going low enough. If so, a workaround would be to try a different input until the problem is properly fixed.

John
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 11:52:41 AM
Kyle,
It looks like one of the signals from the encoder is not making its way in to the MACH logic. It could be hardware or it could be software setup. Use your meter to check the input levels.
 You could have the problem with the input not going low enough. If so, a workaround would be to try a different input until the problem is properly fixed.

John

I did a quick test, I switched the Z axis to MPG1 and X axis to MPG2.

MpG 2 moved X axis fine, MPG1 did the same on the Z axis.

So definitely something with the X axis mpg.

I only have 1 wire referencing the MPG2 going to a common port. My suspicion is that I need another wire going from MPG1 to common as well?

As seen in the photo below.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 11:59:31 AM
When you switched the MPGs, was that in software or hardware?

The commons of the MPGs are tied together by the white power supply wire, one connection to the BoB is enough.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 12:02:44 PM
When you switched the MPGs, was that in software or hardware?

The commons of the MPGs are tied together by the white power supply wire, one connection to the BoB is enough.

That was in the software in the MPG tab out screen.

I will pull off the mpg housing and see if one of the wire solders let lose?

I'll move the X axis ports over to other ports and see if that fixes too.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 12:19:31 PM
When you switched the MPGs, was that in software or hardware?

The commons of the MPGs are tied together by the white power supply wire, one connection to the BoB is enough.

All wiring looks to be sound and moving pins on the BoB gives the same result. So not the bob pins and not the wiring.

Hope it's not a bad MPG 😵
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 12:23:33 PM
Measuring the output voltages will tell you if a MPG is bad or marginal. Please report back on the high and low voltages of each output. You could even check the working one for reference.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 12:29:48 PM
Measuring the output voltages will tell you if a MPG is bad or marginal. Please report back on the high and low voltages of each output. You could even check the working one for reference.

Both give roughly the same V outputs.

Drops to 0.3V - 0.22V and up to 2.9-4.5V on the high.

Both wired the same other then the working one has the common wire direct to it.

Thanks,

Kyle
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 12:37:50 PM
Have you tried moving the MPG outputs to different inputs? You could exchange the two MPGs. If the problem remains the same, that is X moving incorrectly, then the problem is in the BoB or the setup.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 12:54:11 PM
Have you tried moving the MPG outputs to different inputs? You could exchange the two MPGs. If the problem remains the same, that is X moving incorrectly, then the problem is in the BoB or the setup.

Okay swapped the inputs of MPG1 and 2

Left mpg2 disconnected and now mpg1 does the same back forth movement.

So not the MPG as the one that was working does the same thing. So it's either in the program or in the bob. Or in my wiring.

I'm betting on my wiring... human error is always the likely chance. But if you have ideas on where to look in the program send them on over haha! I will check my cable connectors on the mpg housing right now.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 01:05:08 PM
Testing so far has shown the drives are OK and both MPGs work.
Measuring voltages at the BoB will show if the wiring is OK and the signals are reaching the inputs.
It could be a bad BoB input. Can you can the setup to use other inputs?
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 01:12:36 PM
Oops, meant to say can you change the setup.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 01:14:00 PM
Testing so far has shown the drives are OK and both MPGs work.
Measuring voltages at the BoB will show if the wiring is OK and the signals are reaching the inputs.
It could be a bad BoB input. Can you can the setup to use other inputs?

I tried that before I tested the MPG. I switched the not working one from 2/3 input to 6/7 input and got the same problem.
Title: Re: Manual pulse encoder & mach3
Post by: MN300 on January 29, 2022, 01:34:15 PM
Is this true?
Both motors have been turned in both directions.
Both MPGs have turned a motor in both directions.

If Graig's information about the MPGs is correct the high output voltage should be the zener voltage.   2.9V doesn't seem right.
If the pullup resistors are working correctly an input with nothing connected should measure 5V. Check the ones you are using.
Title: Re: Manual pulse encoder & mach3
Post by: Kfischer on January 29, 2022, 01:39:28 PM
Got it working haha!

Lets just say my soldering abilities are not as good as my horse riding abilities. Hahaha.

I took the aviation connector apart and just direct wired the mpgs, everything is working smoothly now 👌.

Again, thanks for the fantastic help both of you.

Guess while I'm here, I can't seem to find the settings to set the increment selection for jog (0.1, 0.01, 0.001) to a dial switch???

Everything I read online just reverts to pokeys.

Where in mach3 do I set up the inputs to be able to go from 0.1 to 0.01 to 0.001 on a rotary switch next to my MPGs?

Cheers

Kyle