Jump to content

Search the Community

Showing results for tags 'Stepper'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 5 results

  1. Atom74

    Library stepper.h

    Hey guys, I´m using a stepper motor in half step mode. In half step my motor has 400 steps. I wanna make it move one step at time with short pauses between each movement (2,5s). Also, after it completes the 400 steps it should start moving on the opposite direction. I´m using the library stepper.h but I´m having some doubts about it, this is my code at the moment: #include <Stepper.h> int x = 1; // step int z = 0; int w = -1; const int stepsPerRevolution = 400; // number of steps in half step mode Stepper myStepper(stepsPerRevolution, 8,9,10,11); void setup() { myStepper.setSpeed(60); // 60 rpm } void loop() { myStepper.step(x); delay(2500); // pause between each step 2,5s x++; if(x==stepsPerRevolution) z=1; // when 400 steps then move in the opposite direction while(z){ myStepper.step(-w); delay(2500); w--; if(w==-stepsPerRevolution) z=0 && x=1; } } } I don´t know if it is configure correctly. Should I use stepsPerRevolution = 200 (number of steps in full step mode) with x increasing in 0.5 by time? Also, can I use myStepper.step that way? Thank you!
  2. I just got the msp430G2 launchpad with the MSP430G2553 mcu. For stepper motor driver im using the boost-drv8711 boosterpack. I was able to get it running with the tutorial that it came with. However i cant run it with Energia. It might be because of the enable bit (0x0) but i dont know how to set it 1 on energia. Do any of you have any experiance of this setup ? The motor im running is bipolar sanyo denki 103h5208-5240. My code so far is like this (i used the arduino example, board pin layouts in attachment): #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // These are the pins for the driver STEP/AIN1 , DIR/AIN2, BIN1,BIN2 Stepper myStepper(stepsPerRevolution, 9, 10, 12, 13); void setup() { pinMode(9, OUTPUT); // same as above pinMode(10, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); pinMode(6, OUTPUT); // pin for the nSleep which wakes up the board digitalWrite(6, HIGH); // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); } void loop() { // step one revolution in one direction: Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(100); // step one revolution in the other direction: Serial.println("counterclockwise"); myStepper.step(-stepsPerRevolution); delay(100); }
  3. // * DATE: 1/21/2013 // * DESCRIPTION: Simple program to run 8 lead stepper motor at half-steps #include "msp430g2452.h" volatile unsigned short a = 1; volatile unsigned short i = 1; volatile unsigned short j = 2; volatile unsigned short k = 3; volatile unsigned short l = 4; volatile unsigned short m = 5; volatile unsigned short n = 6; volatile unsigned short o = 7; volatile unsigned short p = 8; /* MAIN */ void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR &= ~BIT3; P1IE |= BIT3; P1DIR |= BIT0; // Set P1.0 to output direction P1DIR |= BIT1; // Set P1.6 to output direction P1DIR |= BIT2; // Set P1.1 to output direction P1DIR |= BIT4; // Set P1.2 to output direction TA0CCR0 = 15000; // Count limit (16 bit) TA0CCTL0 = 0x10; // Enable counter interrupts, bit 4=1 TA0CTL = TASSEL_1 + MC_1; // Timer A 0 with ACLK @ 12KHz, count UP _BIS_SR(LPM0_bits + GIE); // LPM0 (low power mode) interrupts enabled } #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer0_A0 (void) { // Timer0 A0 interrupt service routine if (i == a) {P1OUT ^= BIT0; P1OUT = BIT0; } if (j == a) {P1OUT ^= BIT0 + BIT1; P1OUT = BIT0 + BIT1; } if (k == a) {P1OUT ^= BIT1; P1OUT = BIT1; } if (l == a) {P1OUT ^= BIT1 + BIT2; P1OUT = BIT1 + BIT2; } if (m == a) {P1OUT ^= BIT2; P1OUT = BIT2; } if (n == a) {P1OUT ^= BIT2 + BIT4; P1OUT = BIT2 + BIT4; } if (o == a) {P1OUT ^= BIT4; P1OUT = BIT4; } if (p == a) {P1OUT ^= BIT4 + BIT0; P1OUT = BIT4 + BIT0; a = 0; } a = a+1; } #pragma vector = PORT1_VECTOR __interrupt void button_push_isr(void) // Push Button Interrupt { P1IFG &= ~BIT3; // Clear P1.0 Button Flag TA0CCTL0 = 0; _BIS_SR(LPM0_bits + CPUOFF); // LPM0 (low power mode) interrupts enabled }
  4. What have you guys used for stepper motor position feedback? I'm aware of shaft encoders, hall effect sensors, magnet and reed switches... but haven't used any to actually get feedback/control. Code/Links appreciated (especially Energia sketches)! It's for use with a little open source 1000PSI hydraulic pump that I'm iterating. The stepper feedback is for accurate hydraulic flow measurement, which will help us zero in on hydraulic positioning (not an easy thing!) curious/interested (blogpost -no BS, no commercials): http://www.arduinoforgoodnotevil.blogspot.ca/2013/07/arduino-1000-pounds-per-square-inch.html THANKS!
  5. Hi all! The current project I'm working on with Stellaris is a stepper (step, direction) driver. I have these TB-6560 drivers that I got on eBay for cheap (here), and I've successfully driven the motors using the 32 bit timer. I've been able to set the frequency using a variable, etc, and hoping to implement acceleration, etc. The goal is to eventually write an entire gCode interpreter and be able to drive the CNC via a serial connection that dumps gCode to the Stellaris. I'm running in to a weird problem though. I'm attempting to add a control panel I got form Deal Extreme that connects via software SPI. I've been able to successfully interact with it using a library developed by Dan Oprescu. Works great in its own CCS project. I can read buttons, update the 7-seg displays, light LEDs, and everything works great. I've moved his library into my stepper project, and all hell breaks lose. As soon as I include the TH1638.h header in my stepper project I get hundreds of build errors. The really weird part is they don't seem to be coming from any of my code files. They are all coming from compiler includes in iosfwd and exception. I looked around on the web and I found something about including pre-compiled headers being a problem, but I'm a bit lost in this. I compared all the CCS project settings between the TM1638 project example, and my stepper project, and nothing seems out of place. I'm sure I'm missing something, but I have no clue how to debug this. If anyone has any ideas that would be greatly appreciated. I've attached my code so far if anyone has a few minutes to look it over! I'll keep posting here as I progress through the project as well! Suggestions and pointers welcome! EDIT (10-15-2012) Here's (attached) the latest updates to my code with the solutions listed below, if anyone is interested. I'll probably copy it over to github and then post it under the code section before too long here. I want to get it a little further before I do that. I'm sure I'm doing some things wrong here and I may have to change approaches, but this is what I've got so far! EDIT 2 (10-15-2012) Here is a link to the project git repo. Feel free to clone and code! https://github.com/VirtualEnder/Stepper Stepper.zip
  • Create New...