servo with quadrature encoder

Hello,

this is my first post here so i'd like to say Hello to you :slight_smile:
and now I'd like to describe my odd problem with servomotor. 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?

servo controller :

btw
when I connected encoder from Lika.com (l-41) then I got correct values as well.

Maybe someone had something similar?

Regards,
Martin

Is there any chance the motor is now rotating faster than you were turning it by hand?

Paul

It is faster than by hand but it is not too fast to be so chaotic. Powered servomotor rotates 1 rotation per 2 seconds.

Is it a servo motor or a stepper motor? The link is for a stepper motor driver?

Post a link to the datasheet for the motor.

...R

Actually it is stepper with encoder on a rear side and it is connected with M545 controller.
The link below leads to this stepper
https://pl.aliexpress.com/item/Original-Leadshine-573HBM20-2-0N-m-283-Oz-In-3-Phase-NEMA23-Closed-loop-step-motor/32852527014.html?spm=a2g17.10010108.1000016.1.58542600pcaHaC&isOrigTitle=true

krolikbest:
Actually it is stepper with encoder on a rear side and it is connected with M545 controller.
The link below leads to this stepper
https://pl.aliexpress.com/item/Original-Leadshine-573HBM20-2-0N-m-283-Oz-In-3-Phase-NEMA23-Closed-loop-step-motor/32852527014.html?spm=a2g17.10010108.1000016.1.58542600pcaHaC&isOrigTitle=true

I give up!

Paul

krolikbest:
Actually it is stepper with encoder on a rear side and it is connected with M545 controller.

Now that we know what you have maybe you can restate the problem ?

...R

That's a 3 phase motor, you have a 2 phase driver.

Sorry my mistake. I pasted wrong link. The good one below:

https://pl.aliexpress.com/item/Freeshipping-JMC-57-2-phase-closed-loop-stepper-servo-motor-57J1880EC-1000-static-torque-2-2N/32849138526.html?spm=a2g17.10010108.1000016.1.7c327c49b85lef&isOrigTitle=true

and it is of course 2-phases motor.

Today I did simply test:

  • servomotor is not powered up
  • Uno is powered up and I can read encoder's value = 0. That is good. manually rotate the servo and read correct values.
    -reset Uno and again encoder's value =0.
    -powered up the motor and then encoder's value is equal.. whatever you want but not 0, but I didn't rotate the motor...
  • powered down motor, reset Uno and back I'm reading value 0

Regards

Martin

The link for the motor says it requires 5 amps and the link for the driver says a max of 4.5 amps and I would not be surprised if the driver manufacturer was being optimistic :slight_smile:

You problem sounds like interference between the power lines for the motor and the encoder signals. How have you got everything connected - a schematic drawing and a photo of the wiring would be useful - but not either of them on its own.

...R

I've changed servo controller to dedicated one and actually problems disappeared. new controller is:
http://www.suncormotor.com/content/?389.html

Thank you for a useful help.

Regards,

Martin