FEZ Spider and L298 Motor Control

I am brand new to FEZ and robotics. I bought the Fez spider starter Kit. I also bought the L298 module and and a Stepper motor ( sm-42byg011-25). I have read through the tutorial on the Motor Control and have no issue with the programming of the motor but I have no idea on how best to wire the actual motor to the module.

The motor has four wires red, blue, green and red. Which wire goes where?

In terms of battery power can I simply connect the motor to a 12v power source? Whats the best battery pack for the FEZ?

THank you in advance for any assistance you can offer.

The module is to drive brush motors not stepper motors. For stepper, you can use load module but we will also offer a stepper module. I think the community offer something for steppers as well. Of course there are many options out there but I am talking about the plug and play gadgeteer options.

What are you building with your stepper? I am curious.

Welcome to the community.

Thanks for the reply. I’m using the stepper motor to generate linear motion by rotating a threaded bar. I have looked at the load module but it would not be suitable because it cannot programmatically control speed or direction. I would like to control both of these. Do I need to get a stepper control module like that created by solder monkey, or is there some way I can make the motor control I have work? In future I would like to build a development platform using 4 Nema 17 motors in a direct drive type
Setup with mecanum wheels. Obviously I need to control the speed and direction of each motor carefully. What type of module or setup would be best to control the 4 motors? Thanks for your help.

I don’t believe it’s possible to control a stepper motor via the L298.

AFAIK, Solder Monkey’s is the only stepper controller module available today, though I’ve not used it myself.

As far as the question of the 4-wheel setup, you may want to look at the use of brushed motors with wheel encoders. I’ve got the Dagu Rover 5, and it has one encoder per wheel. I can definitely confirm that using omnidirectional wheels without using the encoders (which I haven’t hooked up yet) does not work very well. :slight_smile:

It’s also very easy to use an EasyDriver with an Extender module
https://www.sparkfun.com/products/10267?

Driver code:
http://www.tinyclr.com/codeshare/entry/352

Hi ianlee74,

THanks for the reply.

I have tried out the EasyDriver and I also have a Big EasyDriver that I will try out in a bit.

I have an issue with the Driver code though. I am using a FEX spider, with an extender module succretnly plugged into socket 11 on my main board.

The issue i have having is around the

(Cpu.Pin)FEZ_Pin.Digital.Di7

. Well actually It around the cpu pins in general.
I have looked for the reference that would contain that but im using a Spider so there doesnt seem to be one.

I have tried playing around:

GT.Socket Socky = GT.Socket.GetSocket(extender.ExtenderSocketNumber,true,extender,null);;
           
            OutputPort Direction = new OutputPort(Socky.CpuPins[4], false);
            OutputPort Step = new OutputPort(Socky.CpuPins[5], false);

I am fairly certain what i need to do is setup a digital output on whichever pin I have used on the extender module to connect to the step and direction inputs on the EasyDriver respectivly but im not 100% on how to do that.

Any help would be appreciated

How about something like this…

 var direction = extender.SetupDigitalOutput(Socket.Pin.Four, false);
var step = extender.SetupDigitalOutput(Socket.Pin.Five, false);

Perfect. Actually that makes so much sense now haha, Thanks alot.

Great! Be sure and post a video here for us to enjoy once you get it all working. :smiley: