Controlling slots cars with a mosfet

Ok let me apologise for being a newbie.
I am in the middle of a project for work and I am stuck on a power control issue

I am trying to automate the speed of a Scalectrix car using a Freetronics N Mosfet - N-MOSFET Driver / Output Module | Freetronics
controlled by a Ethermega EtherMega (100% Arduino Mega 2560 compatible with onboard Ethernet) | Freetronics

I seem to have the Mosfet wired in OK. I had it controlling a 9v led, fading up and down perfectly. When I wire it up to the 16v track i get a strange result - the mosfet can no longer be switched off and the voltage ranges from 16v and 24v when a PWM signal is altered.

Can someone give me clue if I have the right mosfet or if there is a better way of doing this.

Thanks for any help that can be offered.

bobster:
I seem to have the Mosfet wired in OK. I had it controlling a 9v led, fading up and down perfectly. When I wire it up to the 16v track...

Just how are you doing that?
Which PWM pin are you using?
If you digitalWrite a "1" to it does it go full on, and, if you digitalWrite a "0" to it does it go off?
It's running a motor, basically, but I'll bet there's no "flyback" diode across +V and that module's D terminal.

the very basic sketch i have been using for testing is here, I've been altering the output to pin 9 from 0 to 255. Should I be using a digitalwrite?
I'm not sure about the diode but I thought the module dealt with that?

void setup() {
pinMode(9, OUTPUT);
analogWrite(9, 0);
}

void loop(){}

Post a schematic showing how you have connected the Arduino, mosfet, motor, and motor power supply together. A hand-drawn one will do.

bobster:
the very basic sketch i have been using for testing is here, I've been altering the output to pin 9 from 0 to 255. Should I be using a digitalwrite?
I'm not sure about the diode but I thought the module dealt with that?

void setup() {
pinMode(9, OUTPUT);
analogWrite(9, 0);
}

void loop(){}

If you have the motor/slot between +V and the FET module's "D", then there ought to be a diode across the motor/slot as previously described. (There's nothing on the board that way, it's an off-board consideration.)

void setup ()
{
   pinMode (9, OUTPUT);
}

void loop()
{
  digitalWrite (9, HIGH);
  delay (1500);
  digitalWrite (9, LOW);
  delay (1500);
}
void setup ()
{
   pinMode (9, OUTPUT);
}

void loop ()
{
   // ramps up and back down, then takes a 2 sec
   // rest and starts over
   analogWrite(9, 10);
   delay (1000);
   analogWrite(9, 75);
   delay (1000);
   analogWrite(9, 150);
   delay (1000);
   analogWrite(9, 250);
   delay (1000);
   analogWrite(9, 150);
   delay (1000);
   analogWrite(9, 75);
   delay (1000);
   analogWrite(9, 10);
   delay (1000);
   analogWrite(9, 0):
   delay (2000);

Anyway, do show your work, sketch and photo your set-up.
D5 and D6 have a situation where very low PWMs are greater than the numbers (that's mentioned in the 'Reference'), that's why I asked how digitalWrite worked. Just trying to help you wring this out.

Has anyone found a solution to this issue. It seems to me that the issue is most likely a wiring one with the mosfet and not a software issue. Any help would be appreciated and I'll post a schematic of how we're running it in another reply.

It's not possible for me to diagnose the problem without seeing a schematic of how the system is wired up.