The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Code posted!:If someone could test it for me that would be great. The soonest I can test it is Wednesday afternoon. Cheers!
My StepGenie just arrived in the mail along with 4 HEXFETs. I was hoping to drive a stepper motor out of a printer hat i took apart with this and my Netduino. I have read all of their documentation and am wondering how I would hook this up to the Netduino and program the Netduino to control it. From what I have read I can power the StepGenie directly from the Netduino's 5v power supply; I have an idea where to put the capacitor, but am not sure if it is in the write place. I figure I would put it in a bread board and jumper the whole thing together.
Main Part(Mostly questions):
From what i got reading their documentation I could use the Digital Output Pins on the netduino to set each value of the StepGenie to a 1 or a 0? Does "STEP" indicate the pattern I would be using with the motor, and then "DIR" is the direction? In diagram located on page 1 on the PDF two HEXFETS in the middle (B and C) take the wires coming out of the motor, while the two on the perimeter (A and D) handle the inputs from the power supply, and then each HEXFET has its own ground (Little arrows pointing down)? Wouldn't they need to be connected back to the StepGenie?
As I said before, and am really sorry if this wasn't the topic you wanted/or if you don't really know anything about this topic.
P.S. Beware! Took me 4-5 Weeks for mine to come (even thought they shipped me two instead of one), and some fell out of their casings in shipping. Oh, and Happy New Years!
Code (Has not been tested) and Photos:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace StepGenieNetduino
{
public class Program
{
static InterruptPort button;
static OutputPort Step;
static OutputPort Dir;
static OutputPort Mode1;
static OutputPort Mode2;
public static void Main()
{
// write your code here
button = new InterruptPort(Pins.ONBOARD_SW1, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
Mode1 = new OutputPort(Pins.GPIO_PIN_D5, true);
Mode2 = new OutputPort(Pins.GPIO_PIN_D6, true);
Dir = new OutputPort(Pins.GPIO_PIN_D8,false);
Step = new OutputPort(Pins.GPIO_PIN_D9, false);
button.OnInterrupt += new NativeEventHandler(button_OnInterrupt);
}
static void button_OnInterrupt(uint data1, uint data2, DateTime time)
{
while (data2 == 0)
{
Step.Write(true);
Dir.Write(true);
Thread.Sleep(500);
}
}
}
}
I got a stepgenie for Christmas, my wife said it came quickly, and it was packed very well. Strange.
You can definitely use the digital ios to set the various values high or low (1 or 0).
To test it, i would start with LEDs. Tie pins 1,2,3 to +5v -- 13,14 to Gnd. 11 and 12 to digital ios, and 5,6,7,8 to leds through resistors and LEDs (no mosfets). Everything else (4,9,10) can be left open.
This should put you in "Hi-torque" mode.
Depending on pin 12 (DIR), if it is high or low, the lit leds should shift "up" or "down" when you toggle pin 11 (STEP). I didn't save my code, but i just toggled a digital io and paused 200ms so I could see it.
Then, I played with pins 2 and 3 to try out the different modes.
One lesson I learned (which was the point, really!) was the difference between unipolar and bi-polar steppers. I got a bi-polar stepper for Christmas, but the stepgenie is designed for unipolar...
Okay, thanks Bill! Just wondering. Why would you put 5v on the 2,3 (Modes) and 13 to ground? Wouldn't you want to put 2 and 3 on a digital output? Are the leds just to test to see if it works(show a pattern)?
Also I am confused on how to tell which motor I have, but I think it is unipolar (4 wires coming from it).
-Cwbh
P.S. I will try to get the code out as quickly as I can, but more work has come up and my time is even shorter than I previously thought. So, Photos and code should come around the weekend.
for testing, i wouldn't put the modes on a digital IO yet, it would be one more complicating factor.
I think 4 wires means bipolar and it won't work (easily) with the step genie, you want a 6-lead.
http://www.probotix....ipolar_bipolar/
Would that mean I would hook it up to pins 5-10? I thought that four (Out ACBD) was the amount needed.
Thanks for the link! was very helpful and cleared up some confusion. Also, the chart is telling me unipolar has less torque? I have a pre-built gearbox for torque as i need a lot for an elevator.
Oh! This makes total sense now. Thanks so much Bill! I will try to find one. Do you have any recommendations on where to find on(Like in a printer, etc...)? Sorry for all of the confusion. I will still hook up the LEDs just to test it if I cannot find a unipolar soon.
-Cwbh
Oh! This makes total sense now. Thanks so much Bill! I will try to find one. Do you have any recommendations on where to find on(Like in a printer, etc...)? Sorry for all of the confusion. I will still hook up the LEDs just to test it if I cannot find a unipolar soon.
-Cwbh
I'm looking myself! My wife got me a bi-polar for Christmas, so... I either need to find a unipolar, or build the circuit to handle the bi-polar using a h-bridge.
My code(probably bug filled) and test LEDs with the Stepgenie should come Monday-Wednesday. Sorry for the delay... Updating my profile statuses to latest info
EDIT:I just put together some code from what Bill said. It hasn't been tested, and probably won't be till Monday.
Delayed until Wednesday. Bill, do you have any advice on how the LEDs should be grounded and powered? Should I power the whole thing from the 5v and 3.3v lines? and then ground them all into the Netduino (Which out of the 3 grounds though).
-Cwbh
P.S. Sorry for so many questions, maybe I can help you in the future with something
Hey there. I just noticed your private message, sorry! I also stumbled across my step genie still setup w/ LEDs in a breadboard; i will post a picture tonight for you.
OK, here's a video of the stepgenie in action using LEDs:
http://www.youtube.com/watch?v=KjkVbNI8YBI
The code looks like this:
public static void Main()
{
OutputPort d0 = new OutputPort(Pins.GPIO_PIN_D0, false);
while (true)
{
d0.Write(true); //send a "step" to the StepGenie -- basically just a pulse
d0.Write(false);
Thread.Sleep(250);
}
}
It's wired up like this:
pins 1,2,12 -> 5v (from netduino)
pins 3,13,14 -> ground (from netduino)
pins 5,6,7,8 -> 220ohm resistor -> led -> ground
pin 11 -> D0 on the netduino
With this setup, you can move pin 12 from 5v to Gnd to switch directions; pins 2,3 can be moved to try different modes. Or, connect them up to digital ios on the netduino and change them through programming.
Hard to follow picture of the circuit: (I ran out of 220 ohm resistors so I used a blue potentiometer on one of the leds...)