Giter VIP home page Giter VIP logo

l6470-autodriver's Introduction

SparkFun AutoDriver - Stepper Motor Driver

AutoDriver

AutoDriver (BOB-13752)

The AutoDriver is a bipolar stepper driver based on the ST Micro L6470 chip. It allows a processor to control a single 3A bipolar stepper motor across an 8-45V supply range.

Repository Contents

  • /Hardware - All Eagle design files (.brd, .sch)
  • /Libraries - All Arduino libraries and board examples
  • /Production - Test bed files and production panel files

Documentation

License Information

This product is open source!

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please contact [email protected].

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.

l6470-autodriver's People

Contributors

braingram avatar brightdroid avatar gaerisl avatar jimbambuli avatar mhord avatar patrickalberts avatar pheipheiphei avatar robert-hunke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

l6470-autodriver's Issues

SJ3 note needed?

There is a note in the sch for SJ3 usage but I don't see an SJ3 anywhere in the design.

Mechanical drawing

A simple mechanical drawing that provides the location of the mounting holes and the board dimensions would be very nice.
Not everyone has EAGLE or knows how to use it to get a DXF these from the .brd file.

hardHiZ does not put motor in High-Impedance mode

calling hardHiZ() in v13 of this library does NOT put the motor in high-impedance mode.
I have looked at the code to find the issue but I have not been successful yet.
What does work and put the motor in high-impedance mode is hardStop().
You are welcome to test this for yourself.

Issues with "GetPos()"

Hi,

I've an issue with the function GetPos(). Effectively, if we see this picture :
image

When I move the motor, the getPos function display the current position of motors. If I move the motor 100 steps, getPos display 100 steps. If I move 200 steps, getPos display 72 steps, etc. Between 0 and 127, getPos display 0 to 127. But between 128 and 200, we can see 0 to 72...

I really don't know where the problem comes from.

The last version of AutoDriver library is : 1.3.2.
Motor : http://www.omc-stepperonline.com/gear-ratio-511-planetary-gearbox-with-nema-14-stepper-motor-14hs130804spg51-p-138.html
AutoDriver : https://www.sparkfun.com/products/11611
OS : Ubuntu 16.04

Somebody had the same problem and fixed it ?

Thanks !

PS : my code :

void setupPIN()
{
	//Setup wiringPi
	wiringPiSetup();

	//Setup PIN RESET/BUSY/ENDPOS A & B
	pinMode(PIN_RESET, 				OUTPUT); //PIN RESET
	pinMode(PIN_BUSY, 				INPUT);  //PIN BUSY
	pinMode(PIN_LASER, 				OUTPUT);  //PIN LASER
	pinMode(PIN_A_ENDPOSITION_A, 	INPUT);
	pinMode(PIN_A_ENDPOSITION_B, 	INPUT);
	pinMode(PIN_B_ENDPOSITION_A, 	INPUT);
	pinMode(PIN_B_ENDPOSITION_B, 	INPUT);

	//Open port CE0
	digitalWrite(PIN_CS, HIGH);

	//Reset Board A & B
	digitalWrite(PIN_RESET, LOW);
	digitalWrite(PIN_RESET, HIGH);
}

void setupBOARD_b()
{
	boardA.configSyncPin(PIN_BUSY, 0);
	boardA.configStepMode(STEP_FS);
	boardA.setOscMode(INT_16MHZ_OSCOUT_16MHZ);
	boardA.setMinSpeed(0);
	boardA.setMaxSpeed(500);
	boardA.setAcc(3000);

	boardB.configSyncPin(PIN_BUSY, 0);
	boardB.configStepMode(STEP_FS);
	boardA.setOscMode(INT_16MHZ_OSCOUT_16MHZ);
	boardB.setMinSpeed(0);
	boardB.setMaxSpeed(500);
	boardB.setAcc(3000);
}
int main()
{
	setupPIN();
	setupBOARD_b();
	long step;
	while (1)
	{
		boardB.resetPos();
		cout << "Input a step : "; cin >> step;
		boardB.move(1,step);
		while(boardB.busyCheck()){
		}
		cout << "test = " <<  boardB.getPos() << endl;
		delayy(1000);
		boardB.move(0,step);
	}
	return 0;
}

schematic issues

  1. Old style symbol for sparkfun logo.

  2. Use flag lables on VLOGIC and PGND nets

  3. C7 needs to be moved down one grid space, currently has a node on pin point.

  4. pin 6 (VREG) on U1 needs 3.3V NET drawn out at least one grid space straight out from pin point

  5. separate section with dotted grey lines on info layer

  6. R6 needs a PROD_ID

Cap silk looks off

The large 100uF/63V cap has silk that looks far too large. Low priority but would love to get it fixed on the next rev.

Uploading Example Sketch to Arduino Mega 2560 Hangs

I was having issues uploading the SparkFunGetSetParamTest sketch to the Arduino Mega 2560. I found that any Serial.print or Serial.println that had three exclamation points in a row "!!!" cause the upload to hang. I was able to comment those lines out and get the sketch to upload. Changing those to two in a row also fixed the uploading issue. Have you seen this issue yourself?

Missing getPos function?

Customer sent in some tutorial feedback. He claimed that the getPos function, while very prevalent in the tutorial, is nowhere to be found in the library. I looked through the lib files and couldn't find a function named getPos(). Did this change? Was it never there to begin with? Am I blind?

Board issues

  1. I think we may want to go with the "PANASONIC_E" package for C3. "PANASONIC_C" is the current package, and when you compare it to a scaled product image, it looks too small:
    image

  2. Dimension line is 0.010, should be 0.008

  3. Would it be beneficial if we pre-populated all of the PTH connectors with the SS? If so, we should move the packages to locking style.

  4. Please add test point to 3.3V net

  5. JP1 2 3 and 4, and R4 do not have >NAME text object in the package.

  6. remove the M.Hord text object on tvalues

  7. add dimension measurements onto the measures layer 47

  8. The HTSSOP28 packages used on the L6470 needs it's outline silk bumped up to 8 mil. same thing for trimpot (R4)

  9. What does the switch do? Can we add any schematic note and/or board silk to be more descriptive than "SWITCH"

  10. Can we add some silk boxes around the GND MOTOR pins, and POWER pins to more clearly shot that each pin is doubled up.

  11. Can we scoot the 3 way jumper out a bit so the labeling can be more uniform (that is, each label being on each outer side of the jumper) Or just scoot C8 up a bit so the "3.3V" can live directly above jumper.

  12. Looks like there are 4 active low pins on the L6470. We should probably get those updated in the symbol to show that.

  13. We should probably add some silk to label the trimpot. Maybe just "Trimpot to ADCIN".

goto/gotodir functions do not work

Hello,

I seem to be having issues getting the goTo and goToDir functions to work. When the function runs, the motor moves quickly and then stops responding. I see serial messages from my program indicating that the micro is still alive. I should note that the goToDir motor motion is fast and not smooth like run.

I can also report that the run function works fine. Source examples for both below:

Working

void loop() {
      if (dir == 1) {
        Serial.println("going fwd");
        boardA.run(FWD, 100);
      } else {        
        Serial.println("going bwd");
        boardA.run(REV, 100); 
    }
      Serial.println("zzzz 2 secs");
      delay(2000);
      dir*=-1;
      Serial.println("soft stopping");
      boardA.softStop();
      Serial.println("checking busy");
      while (boardA.busyCheck()) {
          Serial.print("busy pos");
          Serial.println(boardA.getPos());
      }
}

Not working

void loop() {
      if (dir == 1) {
        Serial.println("going fwd");
        boardA.goToDir(FWD,400);
      } else {        
        Serial.println("going bwd");
        boardA.goToDir(REV,400); 
    }
      Serial.println("zzzz 2 secs");
      delay(2000);
      dir*=-1;
      Serial.println("soft stoppping");
      boardA.softStop();
      Serial.println("checking busy");
      while (boardA.busyCheck()) {
          Serial.print("busy pos");
          Serial.println(boardA.getPos());
      }
}

Conversion Values for ACC and DEC Registers

in accCalc you are using the value 0.137438 to convert to the proper register value. The equation is

[step/s^2] = ACC *2^-40/tick^2 where tick = 250ns

so

ACC = [step/s^2]*tick^2/2^-40 and
tick^2/2^-40 = .0687. This is the value that I think should be used to convert from [step/s] to ACC and DEC.

feature request: L6480 version (external Mosfets)

Let's create an L6480 (instead of L6470 ) version.
They allow up to 82V and use external mosfests.
So we can choose our own maximum current.
That would allow the use with stronger steppers (e.g. in the base of a robotic arm, steppers for vehicle movement or CNC work).

dSPIN_support:165 error

Hello,

I have used your example with success and recent reinstalled my 1.5.3 IDE and am getting a new error on line 165 of dSPIN_support it looks like

dSPIN_support:165: error: 'SPI_CLOCK_DIV16' was not declared in this scope

Any ideas where this error could be coming from? Thanks!

Support for the Arduino Due

Hey again,

I wan't to use the lib with Arduino Due. But because of the different architecture of the Due your lib is not working. Can you make that working, please?

Best, Albrecht

Timing issue using Teensy 4.0

I have found that there appears to be a timing issue when using the L6470 library on a Teensy 4.0. The Teensy sends the next byte before the previous was processed by the L6470.

I have traced the problem to the SPIXfer() function, and have made it work by inserting delays at strategic locations

byte AutoDriver::SPIXfer(byte data)
{
byte dataPacket[_numBoards];
int i;
for (i=0; i < _numBoards; i++)
{
dataPacket[i] = 0;
}
dataPacket[_position] = data;
digitalWrite(_CSPin, LOW);
delayMicroseconds(1);
_SPI->beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE3));
_SPI->transfer(dataPacket, _numBoards);
delayMicroseconds(1);
_SPI->endTransaction();
digitalWrite(_CSPin, HIGH);
delayMicroseconds(5);
return dataPacket[_position];
}

AutoDriver ABS_POS problems

About two months ago I ordered an L6470 AutoDrive V13 board from SparkFun to use with a machine tool rotary table. I have gotten the board to work with an Arduino Mega and a 34 vdc power supply.

However the position count from ADboard.getParam (ABS_POS) has problems:

  1. Even with the board set to full stepping, ADboard.configStepMode(STEP_FS), 
    ABS_POS increments by about 128 microsteps instead of full steps.
    
  2. The count appears to be modulo 2**16 unsigned instead of 2**21 two’s complement.
    

For example (the decimal numbers are 2**16 unsigned):

When ABS_POS is incremented from 0x007FFF (32,767), ABS_POS is set to 0x3F8000 (32,768).
When ABS_POS is incremented from 0x3FFFFF (65,535), ABS_POS is set to 0x000000.
When ABS_POS is decremented from 0x000000, ABS_POS is set to 0x3FFFFF (65,535)
When ABS_POS is decremented from 0x3F8000 (32,768), ABS_POS is set to 0x007FFF (32,767).

ADboard.getPos() interprets the count as 2**21 two’s complement.

When the count reaches 0x007FFF (32,767), it rolls over to 0xFFFF8000 (-32,768)..

Following are portions of a monitor log file of readings once a second.

get_pos is the value return by long getPos(); first HEX then DEC.
ABS_POS is the value returned by unsigned long getParam(ABS_POS), first HEX the DEC
&0x00FFFF is the ABS_POS value masked by &0x00FFFF, first HEX then DEC.

10:2:22 Run FWD 1.00 steps/sec for 20 secs
get_pos: 7EB9 32441 ABS_POS: 7EB9 &0x00FFFF 7EB9 32441
get_pos: 7F3B 32571 ABS_POS: 7F3B &0x00FFFF 7F3B 32571
get_pos: 7FBE 32702 ABS_POS: 7FBE &0x00FFFF 7FBE 32702
get_pos: FFFF8040 -32704 ABS_POS: 3F8040 &0x00FFFF 8040 32832
get_pos: FFFF80C2 -32574 ABS_POS: 3F80C2 &0x00FFFF 80C2 32962
get_pos: FFFF8144 -32444 ABS_POS: 3F8144 &0x00FFFF 8144 33092

get_pos: FFFFFE87 -377 ABS_POS: 3FFE87 &0x00FFFF FE87 65159
get_pos: FFFFFF09 -247 ABS_POS: 3FFF09 &0x00FFFF FF09 65289
get_pos: FFFFFF8B -117 ABS_POS: 3FFF8B &0x00FFFF FF8B 65419
get_pos: D 13 ABS_POS: D &0x00FFFF D 13
get_pos: 8F 143 ABS_POS: 8F &0x00FFFF 8F 143
get_pos: 112 274 ABS_POS: 112 &0x00FFFF 112 274

10:17:54 Run REV 1.00 steps/sec for 20 secs
get_pos: 174 372 ABS_POS: 174 &0x00FFFF 174 372
get_pos: F1 241 ABS_POS: F1 &0x00FFFF F1 241
get_pos: 6F 111 ABS_POS: 6F &0x00FFFF 6F 111
get_pos: FFFFFFED -19 ABS_POS: 3FFFED &0x00FFFF FFED 65517
get_pos: FFFFFF6B -149 ABS_POS: 3FFF6B &0x00FFFF FF6B 65387
get_pos: FFFFFEE9 -279 ABS_POS: 3FFEE9 &0x00FFFF FEE9 65257

get_pos: FFFF8144 -32444 ABS_POS: 3F8144 &0x00FFFF 8144 33092
get_pos: FFFF80C1 -32575 ABS_POS: 3F80C1 &0x00FFFF 80C1 32961
get_pos: FFFF803F -32705 ABS_POS: 3F803F &0x00FFFF 803F 32831
get_pos: 7FBD 32701 ABS_POS: 7FBD &0x00FFFF 7FBD 32701
get_pos: 7F3B 32571 ABS_POS: 7F3A &0x00FFFF 7F3A 32570
get_pos: 7EB8 32440 ABS_POS: 7EB8 &0x00FFFF 7EB8 32440

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.