PDA

View Full Version : Microstepper controller



aratti
- 8th February 2009, 18:52
I have been thinking for a while, how to put togeter a simple microstepper controller without using a ready made commercial driver.
At the end, I came up with this simple project capable to drive unipolar stepper motor in three different modes

FULL STEP

HALF STEP

MICRO STEP

The Pic micro used in this work is a Pic 16F628 a powerfull small micro with PWM capability. With this MCU plus a 74HC04 and a74HC86 the controller will produce 20 microsteps out of a nominal motor step.

An additional improvement of this controller, is the capability to accept travel commands of 24 Bits, wich gives to the user the possibility to send positioning profile of over 16 millions steps.

Controller accept commands via TTL serial port @ 9600,n,8,1 and return an (Ack) once the positioning profile has been completed.

Download the zipped file which contains schematic + software + user manual

Enjoy

Al.

fizyxman
- 1st June 2009, 01:26
Thanks -
I loved your stepper project, and this just as helpful. My students are very motivated by projects with possible robotic uses.

Thanks again - Fiz

Bruce
- 2nd June 2009, 02:39
Fiz,

Check out our Micro-Bot projects section; http://web.archive.org/web/20130116014126/http://www.rentron.com/Micro-Bot/index.htm

If your ship to address is a school, I'll send you a couple of our Micro-Bot circuit
boards - with a few additional components for experiments - gratis.

aratti
- 2nd June 2009, 08:58
Thank you Fiz, you are welcome.

Al.

El_AMPo
- 18th October 2010, 21:51
Seems like a nice way of driving steppers, really a clever solution with gate logic.
(long live gates, gates are[n't] dead)

One question:

The hex file included is version compatible with the 16F628A?

Just asking because sometimes compiled hexs for different versions just don't work

aratti
- 19th October 2010, 23:43
The hex file included is version compatible with the 16F628A?

You should have no problem.

Cheers

Al.

peu
- 19th November 2010, 20:00
Nice project! four questions:

1) Can this driver be used with 4 or 8 wire motors?
2) Can the microstepping be changed to 1/10?
3) Can the driver be modified to be used with step/direction signals?
4) What is the maximum Current/Voltage the circuit can handle?


Thanks!

aratti
- 20th November 2010, 17:18
Can this driver be used with 4 or 8 wire motors?

The project as per the schematic posted, uses a unipolar stepper motor. An 8 leads stepper can be used both as unipolar or bipolar depending how you connect the wires.
The 4 wires one is only bipolar and cannot be used with the circuit as shown in the project.
If you replace the four power darlingtons with two hbridges then you can drive bipolar stepper.


Can the microstepping be changed to 1/10

No. The code posted will accept only three modes: Full step - Half step and micro step (1/20)


Can the driver be modified to be used with step/direction signals?

No with the code posted.


What is the maximum Current/Voltage the circuit can handle?

This will depend from the size of the power transistor or mosfet and thermal dissipator that you will use.


Cheers

Al.

peu
- 20th November 2010, 18:15
thanks for your replies, I hope in the future you post an hex with step/dir so I can control it using mach3 software. Thanks!!

El_AMPo
- 22nd November 2010, 18:54
Working fine on the 16F628A

In my design I upgraded the power stage to an ULN2068 (1.5A max per output) and put an embedded FTDI usb to USART chip. All on a 100x50mm single sided PCB (I'll share the PCB as a sign of gratitude once I finish debugging it a little on the usb part).
Also i'm planning to put a safety stop serial command with another pic sniffing the serial commands, because if you make a mistake on the instruction it will execute completly before you regain control of the motor, and that on my aplication is critical.

I got a problem anyhow but i don't know if it's software related or from my "squeeze pcb components to the max to reduce pcb size" techniques.

Works fine on a half an full step mode, but on microstepping sometimes works and sometimes starts making a strange noise on the coils making them hum and jitter untill I reset the whole driver. It's probable that the pic or the gates gets a little dizzy from emi noise because all kinds of lab equipments are connected to the same line so i'm working on that.

One doubt i had is if driving the stepper motor by limiting to a fixed current won't reduce torque in half step modes? (2 coils at 50% current vs 1 coil at 100% current)
Then why is better to drive them this way?. I know constant curent means that is aproximately constant in torque independant of the coils activated, but wouldn't be better with full current on every coil at expense of more current?

El_AMPo
- 22nd November 2010, 19:03
thanks for your replies, I hope in the future you post an hex with step/dir so I can control it using mach3 software. Thanks!!

You can build up an interpreter for the serial stream with another pic, no so pretty but is a simple and fast solution.

Archangel
- 23rd November 2010, 09:41
Here is the device which brought me to PICs. I bought 3 kits from them, they work great and microstep.

http://www.piclist.com/techref/io/stepper/linistep/index.htm
http://www.piclist.com/techref/io/stepper/linistep/lini_use.htm
http://www.piclist.com/techref/io/stepper/linistep/faq.htm#37570.4504050926
He was selling kits on the web site and eBay

rmteo
- 23rd November 2010, 17:34
thanks for your replies, I hope in the future you post an hex with step/dir so I can control it using mach3 software. Thanks!!
4967
Here's a single chip commercial grade solution A3984 - DMOS Microstepping Driver (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1150-1-ND)

The A3984 is a complete microstepping motor driver with built-in translator for easy operation. It is designed to operate bipolar stepper motors in full-, half-, quarter-, and sixteenth-step modes, with an output drive capacity of up to 35 V and ±2 A. The A3984 includes a fixed off-time current regulator which has the ability to operate in Slow or Mixed decay modes.
The translator is the key to the easy implementation of the A3984. Simply inputting one pulse on the STEP input drives the motor one microstep. There are no phase sequence tables, high frequency control lines, or complex interfaces to program. The A3984 interface is an ideal fit for applications where a complex microprocessor is unavailable or is overburdened.
The chopping control in the A3984 automatically selects the current decay mode (Slow or Mixed). When a signal occurs at the STEP input pin, the A3984 determines if that step results in a higher or lower current in each of the motor phases. If the change is to a higher current, then the decay mode is set to Slow decay. If the change is to a lower current, then the current decay is set to Mixed (set initially to a fast decay for a period amounting to 31.25% of the fixed off-time, then to a slow decay for the remainder of the off-time). This current decay control scheme results in reduced audible motor noise, increased step accuracy, and reduced power dissipation.
Internal synchronous rectification control circuitry is provided to improve power dissipation during PWM operation.
Internal circuit protection includes: thermal shutdown with hysteresis, undervoltage lockout (UVLO), and crossover-current protection. Special power-on sequencing is not required.

El_AMPo
- 18th December 2010, 07:28
Aratti,
i've found a glitch in the microstepping mode, maybe you can confirm if it's software related.

If you enummerate the coils from A to D, then when changing from coil D to A the transition it's not in microsteps but a full step. Maybe an end loop thing?

I've attached a video (check the green leds, the transition between the one down and the left one)

http://www.youtube.com/watch?v=XBg-8xv5tWU

Happy holidays (the ones that have some)

Galder02
- 3rd January 2015, 17:52
Hello there, im interested in designing as microstepper controller via a pic, using everything that its needed (as i have been investigating, it uses pwm and other functions). The thing is that the only programming language i know well is picbasic pro. is it possible to do such thing with this compiler?, lets say using a pic like 16f877a or a 18fxx?, can somebody help me out with a code in this language?, tis for controlling a bipolar stepper motor. i only want to know how it works and undersand it because i dont have it very clear, and of course in basic language.

Thanks everybody, Regards.