Encoder sourceA sourceB inputs?

Hey guys we have a Bosch Seat Motor that we’re trying to code up. The wiring diagram that we followed is:

As you can see from the wiring, 2 small wires go into the talon and the other two go into a single dio input. What are we supposed to point to for sourceA and sourceB. Thanks for the help!

(Coding in java)

you only need to use the source A and B pins if you want to use the encoder, what is your question exactly? Are you wanting to know how to code for the motor and the encoder, or are you asking how to wire the encoder in?

so the wiring is done, we want to use the encoder and motor just wondering how to code the encoder

I can see in the diagram that there is an am-3812 component in the middle, which is helping transform the feedback from the motor for the DIO input (according to the website).

I also find in the motor’s specification sheet how the Detail B that shows the outputs of the motor’s pins referenced by the diagram.

Ah, I am useless when it comes to JAVA, someone more qualified will have to answer that one.

I think you want to read this thread:

Since it is a Hall sensor, I think you will use it as a Counter and not as an Encoder.

this thread will help as well, it gives example code for converting the hall sensor data to a typical encoder input, which is then very easy to manipulate for whatever linear or rotational calculation you need.

The code given by the person in the thread didn’t work for us. Our counter was permanently increasing regardless of whether or not the motor is running, (every read showed it was increasing by ~50000 every new line).

So the question still stands, how do we implement the encoder so we can have usable data to see rotation.

Please post the entirety of your code project. Preferably on GitHub. It will make it much easier to continue to debug your issue.

We only have 2 lines related to this. We have this to set up the counter:

Counter encoder = new Counter(new DigitalInput(2));

and inside the periodic function we have:

System.out.printf(“Encoder value %d\n”, encoder.get());

This value increases by ~50000 every time it prints and doesn’t seem to change regardless of motor movement.

It is a counter, so you will need to send your algorithm which direction you are driving the motor. Pseudo code:

if motorspeed > 0
if motorspeed<0

Additionally, the 50,000 thing sounds like a wiring issue.

What should an expected value for counter be?

Well, it should start at 0 and count +1 for each rotation. The super fun thing with these is that the sensor is on the motor output not the shaft output. The reduction on the motor is ~179:1 (dont’ quote me, look it up), therefore one output shaft rotation would be 179 ticks.

we just checked the wiring and everything looked fine on that end. We still have our problem of these insane iteration count numbers despite the motor not even turning, any idea on troubleshooting? We implemented it as a counter do you think the dio polarity could be the issue (just throwing out ideas)?

Not sure. We haven’t received our copy of this yet.

We have the same problem as @Lucidare. Has anyone been able to fix this issue?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.