Main Site Documentation

First try at PWM


I have a belimo MFT controller and I want to control it’s position. It says it uses
150s PWM.59-2.93s

I cannot get this thing to move! I know I have the connections correct just not sure if I have the setpulse variables correct. Can someone give me a hand on what I need to set for the low,mid and high range???



Can you post a link to a datasheet for your MFT and the code you are using?


Here is the link

Looks like it needs a full second and then the high pulse which is in the seconds… I dont thing SetPulse can do this. My code was just different SetPulse settings. How would I send a 1 second low and a 1 second high pulse?



Connect your controller to digital I/O of your FEZ and use OutputPort and Timer class. You could also use OutputCompare class to generate whatever signal you want.


PWM really isn’t well suited to having pulse widths in the seconds range, you can use outputcompare, or run the pin manually using a digital output and timers…

Looking at the wiring diagrams though for the PWM, the control signal either has to be +V or COM, where +V is 24VAC, and COM is neutral. You definitely can’t directly control that from the microcontroller pins. You will have to use a 2N2222A or some kind of transistor to drive the circuit.


Thanks everyone I am thinking outputcompare is the way to go.

Ron2, Can you help with the circuit to drive this? I would hate to blow something up! Basically though I need to have the fez turn on the transistor to allow the 24VAC to flow and off for the high/low signals??


OK, Got this working with a relay pulsing 24V AC to the relay. Works awesome. I am going to switch to a triac once I get to RS. This will change the actuator in 45 degree increments.

const uint period = 1 * 1000 * 1000;
            const double low = .59*1000*1000;
            const double high = 2.930 * 1000 * 1000;
   var oc = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.Di10, false, 2);
            for(int a = 0;a<180;a=a+45)
                uint pos = (uint)(((float)((high - low) / 180) * (a)) + low);
                timings[0] = pos;
                timings[1] = period;
                oc.Set(true, timings, 0, 2, true);