Main Site Documentation

Getting Robot Motor & Servo Cross Talk


#1

I have my FEZ mini robot with a servo connected. When I run this simple program, when the motors turn on servo starts going bananas, (random motion). Seems like there is some kind of cross talk going on. When the motors stop the servo returns to the 90 position. Any ideas??



using System;
using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
public class Program
{
    public static FEZ_Components.ServoMotor myServo = new FEZ_Components.ServoMotor(FEZ_Pin.Digital.Di8);

    public static void Main()
    {
        // Set Servo Position
        myServo.SetPosition(90);
        Thread.Sleep(2000);
        // Move Forwards
        FEZMini_Robot.Move(50, 50);
        Thread.Sleep(5000);
        // Stop
        FEZMini_Robot.Move(0, 0);
    }
}



#2

Is the servo connected directly to a PWM pin or OC?


#3

The motor controller uses PWM and so you need to use OC to control the servos

See this please (link removed)


#4

OK.

Looking at the servo driver “FEZ_Components_ServoMotor.cs” it looks like it’s using OC.
Looking at the robot driver “FEZMini_Robot.cs” it looks like it’s using PWM.

Motors connected to motor pins & servo connected to Servo Port 8 on inex board.

What am I missing here?


#5

Perhaps post entire project folder so that we can take a closer look for you?


#6

The project is only the code posted with "“FEZ_Components_ServoMotor.cs”, and FEZMini_Robot.cs added.

Any hints here?


#7

Let me try it on a robot tomorrow and get back to you


#8

Any luck gus?


#9

I am so sorry I couldn’t get to this today :frowning: but I just thought of something. Are you using the latest beta? There was a bug in PWM in the last release.

If not, pleases download and update firmware/assemblies to latest beta and the problem will most likely disappear :wink:


#10

Downloaded the Sept 20th Beta. Updated firmware.
Still getting same crazy behavior…


#11

We finally got a chance to try it and yes we can see the same behavior. Digging more into it, we learned that all signals are perfect! What is causing the problem is power. When the motors run with no load, they generate a lot of noise. Looks like the robot is not filtering that noise enough and the servo is acting funny with that very little noise we have! I blame it more on the servo! Try to put force on the wheels and you ill see how the servo will stop acting funny.

The fix: (none is ideal but here are some ideas)

  1. try a different servo if you have one
  2. add filtering on the power line going to the servo. I tried capacitor and it wasn’t enough! We will need some ferrite beed + capacitors.
  3. power the servo separately. I didn’t try to get voltage directly from the batteries to the servo but this will probably work.

#12

Best way would be to power the servo externally then. Strange that adding capacitor didn’t work out. Maybe a noise filter would do the trick?


#13

I would be surprised if it was a servo error. I have done a lot of playing with servos lately and I havn’t had any issues with noise, even when pulling power from the FEZ. It may depend on your servo, though.


#14

I do not know either why the servo would be the cause either. Gus said it’s the servo, however I would think it would be the DC motor. They are known for enormous noise.

Anyway. Connecting motors to a different power supply then your chip is the best thing to do.


#15

There is noise but it is not too bad at all, maybe 50mV of noise winch shouldn’t effect anything. For example FEZ Mini still works fine even with that noise coming in :slight_smile:


#16

OK, so what servo did Hai Nguyen use in the July 18, 2010 video on the tinyclr.com Main page. Servo seems to behave itself in that video, whats did he do different?


#17

I have the same problem with my new FEZ mini robot even if servo is powered directly from batery pack. Is this issue somehow resolved?


#18

If the servo powered separately the problem disappears


#19

I don’t know how the motor control is done, but in general adding some fast shottky diodes is always a good measure (if the robot doesn’t have them yet).
Look at this page (there is a connection diagram in the middle of th page):http://www.robotroom.com/HBridge.html

I had similar issue with my late CNC router (RIP :slight_smile: ) and the diodes made all the difference…

Regards
Yuriy