Choosing a motor controller/driver for a linear actuator (brushed DC motor)

Dear GHI Community,

I can say for sure that having/using the FEZ Spider Kit and programming in C# using the .NET Micro Framework is a really nice/easy way of accomplishing/realizing project ideas.

For the first time I would like to use the possibility to ask you for some help and suggestions. I did search the forum here and I found a few helpful topics on controlling a brushed DC motor, but I wanted to ask you here once again for your opinion because I am quite new to this matter and a little bit confused because there are so many products out there that I find it a bit difficult to focus on any. I am not sure which controller/driver to choose. This is why I need your help/input on this issue.

What I want to do is to find an easy way to control a 24V DC brushed motor. According to the manufacturer of the linear actuator the motor is a 24V DC permanent magnet brushed motor. I do posses the L298 Motor Driver from GHI but obviously I cannot use it since the linear actuator I want to use draws up to 20A peak current and about 10A continuous current (the L298 module allows only up to 3A).

You can see from the attached images that the motor operates with 24V and it will draw 2.2A without load and 9.5A with full load (this is the typical continuous current draw) but bear in mind that the peak current draw might be about 18A while starting and about 14A while operating. The different curves are for different ambient temperatures.

There are many ready-to-use controllers out there, I think I would not even need to solder up my own module using chips and other components. I can just buy an available motor controller and then program it the way I want it to work. Exactly here is my problem. When I have an external component (not original GHI module) I do not really know how to write a driver and then use it with my FEZ Spider Kit. Do I have to build my own module using the “.NET Gadgeteer Module Builders Guide” officially available, or I can just write the driver in my code? How do I write this driver so that I can control my motor?

I made a research on suitable motor controllers from different manufacturers and here is a list I came up with (listing only a few because there are really a lot more out there):

[ol]DC Motor Driver 2x15A, 4.8-35V ([/ol]
[ol]Pololu 18v15, 5.5-30V, 15A Motor Controller ([/ol]
[ol]Pololu 15A, 5.5 - 50V Single Motor Controller ([/ol]
[ol]Cytron 13A, 5-25V Single DC Motor Controller ([/ol]

Let’s take for example the last motor, the Cytron 13A, 5-25V Single DC Motor Controller. On the official website of the manufacturer ( you can find the manual (’s_Manual.pdf) and a sample code ( They are using some PIC microcontroller (PIC 16F887) but they say that any other microcontroller (and I want to use FEZ Spider) can be used to control the circuit and thus the motor. They say that it is very straightforward - there are only three wires (PWM, DIR and GND, DIR for direction). But I really do not know how to start writing a simple driver so that I can use this motor controller with my FEZ Spider and control my motor. I would appreciate it if you could help me start with this. It seems easy (there are really actually two lines I need to control: PWM and DIR, so supply PWM signal and digital signal for the direction) but I do not know how to start. Can you help me and give me some examples using this motor controller from Cytron? Or perhaps for the first one, the DC Motor Driver 2x15A, 4.8-35V. I just want to see how to write my own drivers for some external, non-Gadgeteer components. I know that for some of you it seems like an easy game, but I am quite new and unsure.

I am also not sure why the Cytron motor controller costs about 16$ and the others about 50$. What can the other motor controllers do that the Cytron one cannot?

If you have any other suggestions, like some other (better, cheaper, etc.) motor controllers that I can use directly with FEZ Spider, then please share them with me, I would be grateful. If you know any resources I can use, then please share the link.

Thank you in advance for your time and cooperation!

I have been using Roboteq motor controllers for quite a while now and found them to be reliable and feature-packed. For the motor characteristics that you specified, I’d recommend this controller:

What makes Roboteq controllers particularly attractive is the sheer number of ways you can talk to them. They accept both serial RS232 or TTL commands, PWM input, analog input, and even have the ability to execute custom programs written in their proprietary scripting language which is then stored in nonvolatile memory. Since you have a FEZ, you likely won’t make use of the last option, but the first 3 give you a lot of flexibility in how you send commands. They also have real-time telemetry feedback, so you can monitor practically any performance metric you’re interested in on-the-fly, if you choose. They also have encoder and limit switch inputs, if you need them for your application. They also have closed-loop PID for more advanced applications. Some of their other models are also capable of controlling up to 2 motors simultaneously.

The above controller goes for $125, which might be a bit higher than your standard hobby controllers.

Brushed motors are simply controlled through PWM. Any board with H-bridge chip capable of handling your motor can be wired to your spider using breakout module.

As for the software driver, you do not even need one. You can wire your motor controller exactly like we do on our motor controller and then use the exact same driver.

Welcome to the community.

How you go about this and what hardware makes sense depends on your application. You mentioned a linear actuator. Do you need to control position, velocity, both? How accurately? Is there a position transducer in your system? Will there be a control loop in your software trying to maintain position, velocity or both? If you’re going to work on the moderate performance end of the spectrum you may want to look at complete motor controllers from companies like

or for really high performance

Their products have a serial interface (RS232, 485 or USB). After you setup the controller, all you do is send a serial command telling it how fast to spin or how far to move and it handles the rest. Of course, you pay for this level of integration and performance but if time is money to you, then they might be worth looking at.

Thank you all for your replies.

@ Gene

Well, I think these controllers/drivers are very nice but they are really an overkill for my project, I really do not need such good quality.

@ Iggmoe

The ROBOTEQ motor controllers are also a very good solution. I even like this one ( more because it can operate two motors. I will consider buying it, although the price is a little bit over my budget.

Most probably I will buy either the DC Motor Driver 2x15A, 4.8-35V ( or the Cytron 13A, 5-25V Single DC Motor Controller ( I would like to ask you to provide some sample code on how to use one of these two motor controllers. Here ( there is some sample code for the DC Motor Driver 2x15A, 4.8-35V, can you help me with the code for my FEZ Spider. When I connect it to the Spider, how do I address the pins and how do I send the PWM signal? I know it must be very easy for you, but please do help me or share a link with some information. And here ( you can find some sample C code for the Cytron 13A, 5-25V Single DC Motor Controller. Could you help me to get this code work for the FEZ Spider?

Thank you in advance!

@ Teodor17, I can also wholeheartedly endorse the RoboteQ controllers.

They have been absolutely bombproof, they have encoder inputs and a scripting language that allows you to put motor specific application code directly on the controller (using a variant of VBScript)

One thing we love about the RoboteQ controllers is they have a 5V, 100mA auxiliary power supply output which you can put through a simple low dropout regulator to get 3.3V for your NETMF board.

We’ve used the scripting combined with NETMF very successfully.

Just remember that motors are noisy, high current devices that can play havoc with grounding and signal lines. Be super careful to check the absolute maximum ratings of the drive components, especially maximum voltage, and operate well underneath them.