Posted: Mon Nov 19, 2018 7:05 pm Post subject: servo with quadrature encoder with duino board
Hello
it is not strictly to Bascom although code was written in Bascom. I ask because maybe someone had similar issue? Below short description:
Some time ago have bought from China small servo with quadrature encoder on the rear side. Encoder is powered with 5 VDC. When I connected:
- pins (channel A and B) from this encoder to the pins (2,3) of Arduino Uno
- Arduino Uno pin 5v to encoder's Vcc
- Arduino Uno pin GND to encoder's GND
and manually rotate this servomotor my program counts encoder ok. By manually rotating I understand that servo is not connected to the power (30 VDC), so it can be rotated in a hand. By saying ok I mean it counts in left direction and right direction and gives correct values.
The problem starts when I connect power (30VDC) to the servomotor and rotate it with a generated signals setp/dir. Servo rotates ok (left,right dir) but while reading encoder I get chaotic values. It doesn't matter in which direction I rotate the servo. I get in serial monitor chaotic values. Encoder is conneted to the Arduino pins 2 and 3 without capacitors. Maybe should I use some?
When I connected encoder from Lika.com (l-41) or Agilent (previously HP) then I got correct values as well. So reading encoders without powering servomotor is ok. Something is disrupting signals from encoder during powered servomotor. How to avoid it?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum