Netduino home hardware projects downloads community

Jump to content


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.
Photo

StepGenie (An EE's Best friend?)


  • Please log in to reply
17 replies to this topic

#1 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 05:23 AM

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.

Links:
StepGenie's PDF: http://stepgenie.com/StepGenieSpec.pdf
StepGenie's Website: http://stepgenie.com/

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);

            }
        }

    }
}

-Cwbh
-Cwbh

#2 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 January 2011 - 01:13 PM

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...

#3 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 03:41 PM

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.
-Cwbh

#4 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 January 2011 - 04:24 PM

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/

#5 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 06:29 PM

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.

Introduction to Stepper Motors


-Cwbh
-Cwbh

#6 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 January 2011 - 08:43 PM

No, you'd hook a unipolar (with 6 wires) up to pins 5,6,7,8. The remaining two wires go to your powersource, possible through a power resistor first.

#7 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 08:53 PM

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
-Cwbh

#8 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 08:54 PM

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
-Cwbh

#9 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 January 2011 - 08:57 PM

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.

#10 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 04 January 2011 - 09:20 PM

Sorry, I didn't realize you didn't have one. I just found this. Looks like a good deal if you want it.

4 each Stepper Motors Yamagawa TS3103N60 24 V UNIPOLAR

EDIT: I just found this.
-Cwbh

#11 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 04 January 2011 - 11:44 PM

Cool, thank you.

#12 Charles

Charles

    Advanced Member

  • Members
  • PipPipPip
  • 192 posts

Posted 05 January 2011 - 01:06 AM

I got a stepgenie for Christmas, my wife said it came quickly, and it was packed very well. Strange.


Ok... I'm still stuck on the fact that your wife got you a StepGenie for Christmas. That's awesome!!

Did she get you the full demo board or just the chip itself?

#13 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 05 January 2011 - 03:56 AM

Ok... I'm still stuck on the fact that your wife got you a StepGenie for Christmas. That's awesome!!

Did she get you the full demo board or just the chip itself?


LOL... she was very grateful to receive a Google spreadsheet with part numbers from me this year. I was grateful to receive fewer sweaters. :D

#14 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 09 January 2011 - 05:11 AM

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.
-Cwbh

#15 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 11 January 2011 - 03:28 AM

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 :)
-Cwbh

#16 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 11 January 2011 - 02:09 PM

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.

#17 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 12 January 2011 - 12:10 PM

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...)
Posted Image

#18 CwbhX

CwbhX

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationNYC

Posted 12 January 2011 - 02:33 PM

Wow! Thanks again Bill! If I have time today I will put it together as well. We still need to find a unipolar stepper motor :/.
-Cwbh




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.