Rev. 1.1 7/08 Copyright © 2008 by Silicon Laboratories AN155AN155STEPPER MOTOR REFERENCE DESIGN1. IntroductionStepper motors are used in a wide varie
AN15510 Rev. 1.1regulator. The total worst-case VDD current draw for theboard is about 25 mA. This condition occurs when bothLEDS are on and the seria
AN155Rev. 1.1 115.2. User InterfaceThe primary user interface is an ASCII terminal with abaud rate of 57,600 bps. The main loop of the codeparses the
AN15512 Rev. 1.1and set the doneFlag. The doneFlag is used as ahandshaking mechanism for the main loop to displaythe done message.If the motor state i
AN155Rev. 1.1 13APPENDIX A - SCHEMATIC
AN15514 Rev. 1.1APPENDIX B - BILL OF MATERIALSQty Designator Description Value pkg mfr PN Manufacturer1 C1 electrolytic capacitor 470 u EEU-FC1E471 Pa
AN155Rev. 1.1 15APPENDIX C - PCB ARTWORKFigure C1. Silk LayerFigure C2. Top Layer
AN15516 Rev. 1.1rFigure C3. Bottom LayeFigure C4. Top Solder Mask
AN155Rev. 1.1 17Figure C5. Bottom Solder Mask
AN15518 Rev. 1.1APPENDIX D - CODE FLOWCHARTSFigure D1. Main LoopmainInit SYSCLK.Init Port.Init Timer.Init UART.Init motorvariables.Enable Interrupts.m
AN155Rev. 1.1 19Figure D2. Move (Profiler)movetarget =position?target >position?set forward flag.calculate length.clear forward flag.calculate leng
AN1552 Rev. 1.1turning. Press the function switch again. The motor willrotate four turns the other direction.It the LED does not illuminate, check the
AN15520 Rev. 1.1Figure D3. Timer ISRTimer_ISRforward ?increment StepIndex.increment position.done ?get value from table.multiply by Tzero.write value
AN155Rev. 1.1 21Figure D4. UART ISRUART_ISRreceiverinterrupt flagset?receive bufferfull?clear receiver flag.read SBUF sfr.put into readBuffer.Incremen
AN15522 Rev. 1.1APPENDIX E - CODE LISTING//-----------------------------------------------------------------------------// Stepper.c//----------------
AN155Rev. 1.1 23// stepper motor linear velocity profile// 255 * [sqrt(n+1)-sqrt(n)]// n = 0 to 255//const unsigned char code StepTable[256]={ 0xFF,
AN15524 Rev. 1.1//// BUFFERED UART FUNCTION PROTOTYPES//--Top Level - User Functions ------------------------------------------------// put a string
AN155Rev. 1.1 25unsigned char Tzero; // initial period, sqrt(2/alpha)unsigned char PatternIndex; // index for step patter
AN15526 Rev. 1.1 theChar = getc(); // get character to be parsed switch(theChar) // parse character
AN155Rev. 1.1 27// PORT_Init//-----------------------------------------------------------------------------//// Configure the Crossbar and GPIO ports.
AN15528 Rev. 1.1 putc('>');}//-----------------------------------------------------------------------------void delay (void)
AN155Rev. 1.1 29 { if (target > Position) { Forward = 1; // set forward flag length = target - Positio
AN155Rev. 1.1 3integer. The range is 0 to 255. If you enter 256 it will beinterpreted as a zero. The number 257 will beinterpreted as a one. Entering
AN15530 Rev. 1.1 PatternIndex &= 0x07; // fix modulus 8 counter Position--; // increment Position }
AN155Rev. 1.1 31 putc(*string); // put character at pointer in buffer string++; // increment pointe
AN15532 Rev. 1.1 } return i; // return uchar value}//-------------------------------------------------------------------
AN155Rev. 1.1 33// readc()//// The readc() function is the lowest level function which provides// direct access to the read buffer. It reads one chara
AN15534 Rev. 1.1}//-----------------------------------------------------------------------------void uartISR(void) interrupt 4 // main UART in
AN155Rev. 1.1 357. Notes:
AN15536 Rev. 1.1CONTACT INFORMATIONSilicon Laboratories Inc.400 West Cesar ChavezAustin, TX 78701Tel: 1+(512) 416-8500Fax: 1+(512) 416-9669Toll Free:
AN1554 Rev. 1.1voltage. A clamped unipolar drive circuit is shown in Figure 2.When Q1 is turned on, current will flow from the +12Vsupply, through the
AN155Rev. 1.1 5The performance differences between unipolar andbipolar drives are subtle. The unipolar drive only useshalf of the actual motor winding
AN1556 Rev. 1.1Four of these states only have one transistor on at anyone time. The half-step pattern allows a positioningaccuracy of 0.9° for a 1.8°
AN155Rev. 1.1 7Solving Equation 3 for time gives the results shown inEquation 4. This is the absolute time required to providea linear acceleration pr
AN1558 Rev. 1.1In contrast the linear-acceleration profile is much morecomplex. A single fixed table cannot be used. The initialconditions of each acc
AN155Rev. 1.1 9swapped during the layout phase for optimum routing tothe MOSFET gates. The stepping pattern has beenchanged accordingly. The port outp
Kommentare zu diesen Handbüchern