Off hand I do not see anything wrong with the logic, so check hardware.

Can you add to your code a quick debug out put---serot to hyperterm the values of Speed and AnalogLow/High or the ADC value of that pin?

The ADC with out the pot could float to mid range.

Along with the debug, check the voltages at the ADC pins(sure you have done this,basic trouble shooting).

Hard code Duty a a give value to check the output(if you have a spare pin --- add some where in the main loop--- if pin? then Duty = ?.

I know this is not much help but a the moment it is all I can suggest