Getting Robot Motor & Servo Cross Talk

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
        // Move Forwards
        FEZMini_Robot.Move(50, 50);
        // Stop
        FEZMini_Robot.Move(0, 0);

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

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

See this please (link removed)


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?

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

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

Any hints here?

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

Any luck gus?

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:

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

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.

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?

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.

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.

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:

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

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?

If the servo powered separately the problem disappears

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):H-Bridge DC Motor Schematic - Robot Room

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