![]() |
motor encoder java
we are trying to get a magnetic motor encoder (AS5145B from ams) to give values and it only ever gives a value of zero. can someone help us out, we do not know why it isn't reading any pulses/rotations. A sample code would be much appreciated. Thanks
|
Re: motor encoder java
Quote:
|
Re: motor encoder java
Have you followed the directions here: http://wpilib.screenstepslive.com/s/...control-system
|
Re: motor encoder java
we are trying to sense position. we have it on an a and b channel plugged into the digital i/0 on port 1 and 2.
|
Re: motor encoder java
@joe yeah
but we are not 100 percent sure how to program it. |
Re: motor encoder java
Quote:
[ edit ] Provided you do want to use it as a quadrature, though, you would first create a new Encoder object: Code:
Encoder encoder = new Encoder(aChannel, bChannel);Code:
encoder.start();Code:
encoder.getDistance();Code:
encoder.setDistancePerPulse(someConstant); |
Re: motor encoder java
@irving that didn't work, I'm not sure whats wrong
|
Re: motor encoder java
Quote:
|
Re: motor encoder java
Quote:
- how you have the encoder mounted - how you have it wired (please use camera that can focus close-up) |
Re: motor encoder java
I have also been having an issue with the same symptoms. I am using the AS5145B magnetic encoder. We one PWM wire soldered in to the board as well as the signal part of another PWM wire. PWM wire one is soldered to ground, 5v, and a; PWM wire two is soldered to b. PWM wire one is connected to Digital I/O 3 and PWM wire two is connected to Digital I/O 4.
Here is my code: Code:
/*----------------------------------------------------------------------------*/ |
Re: motor encoder java
Quote:
|
Re: motor encoder java
No.
|
Re: motor encoder java
I meant to say that the cluster of the three PWM wires are connected to those pins.
|
Re: motor encoder java
We got it working. The problem was that we didn't have csn grounded.
|
Re: motor encoder java
Just a thought: We might have been able to save you 4 days of troubleshooting had you posted pictures of the wiring. |
| All times are GMT -5. The time now is 11:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi