Stepper Motors & EasyDriver board

22 views
Skip to first unread message

Jim Cove

unread,
May 21, 2016, 2:11:01 AM5/21/16
to gctec...@googlegroups.com

HI All, I’m stuck!

I desperately need to get this working before Monday;

   Scope:

                Get user settable speed and duration from two potentiometers (I can do that)

                Display ‘pot’ values on LCD (I can do that)

Detect while button pressed (I can do that)

Drive a stepper motor continuously in one direction at the pre-determined speed while button pressed(*PROBLEM*)

Upon button release, reverse stepper briefly at maximum speed for duration set by potentiometer above(*PROBLEM*)

 

I cannot find a suitable driver or method of continuously sending the pulses to the stepper controller.

 

The controllers I have are:

1)      Easy Driver

2)      HY-DIV268N-5A (based around the TB6600 chip)

Both of these use a logic high or low to determine ‘direction’ and ‘enable’.   The speed of the controller (and hence the stepper) is controlled by the frequency of the pulses.

 

I can do it using delay() but I really don’t want to go down that path.   I can also do it using tone() but only causes continuous operation while ‘in’ the function.   Continuing on around the void loop() causes the function to stop, resulting in jerky operation..

 

I am sure that someone smarter than me could pulse it using background timers but that is beyond me!

 

Any help or (polite!) suggestions, very much appreciated!

 

Thanks,

Jim  Cove

 

Ron Hunn

unread,
May 21, 2016, 3:07:08 AM5/21/16
to gctechspace

Jim
You'll use a pwm instruction to send the pulses to the step pin on your controller.

https://www.arduino.cc/en/Tutorial/PWM

Ron

--
You received this message because you are subscribed to the Google Groups "Gold Coast TechSpace Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gctechspace...@googlegroups.com.
To post to this group, send email to gctec...@googlegroups.com.
Visit this group at https://groups.google.com/group/gctechspace.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/7d3000bd6ff545c6b924bcd2498e4910%40bne3-0011embx.exchange.server-login.com.
For more options, visit https://groups.google.com/d/optout.

Jim Cove

unread,
May 21, 2016, 3:11:03 AM5/21/16
to gctec...@googlegroups.com

Thanks Ron, but PWM is only one fixed frequency (500Hz for the Arduino), it is the width of the pulse that varies…  these controller cards (and they seem to be as common as mud!) don’t appear to care much about pulse width, rotational speed is determined by the frequency…

/Jim


For more options, visit https://groups.google.com/d/optout.


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7597 / Virus Database: 4568/12268 - Release Date: 05/20/16

Ron Hunn

unread,
May 21, 2016, 3:14:42 AM5/21/16
to gctechspace

Ohhhh yeah.  Sorry about that. You'll need to adjust the delay between pulses then. 

Ron

Robert Moller

unread,
May 23, 2016, 3:53:29 AM5/23/16
to gctec...@googlegroups.com
Sorry, just seen this today.
check out this site for simple stepper codes.


If the stepper is to large, the easy driver will not work.
To test the cable leads, put an LED on two wires, turn the motor and the led will light up in both directions when the belong together.
Robert

--
You received this message because you are subscribed to the Google Groups "Gold Coast TechSpace Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gctechspace...@googlegroups.com.
To post to this group, send email to gctec...@googlegroups.com.
Visit this group at https://groups.google.com/group/gctechspace.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/7d3000bd6ff545c6b924bcd2498e4910%40bne3-0011embx.exchange.server-login.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Moller
Painter and Decorator
General Maintenance
Sign Writer

T: 0426822733



Robert Moller

unread,
May 23, 2016, 4:02:43 AM5/23/16
to gctec...@googlegroups.com

Robert Moller

unread,
May 23, 2016, 4:04:31 AM5/23/16
to gctec...@googlegroups.com

Jim Cove

unread,
May 23, 2016, 4:47:16 AM5/23/16
to gctec...@googlegroups.com

Hi Robert – thanks.

I had tried the ‘easydriver’ library but found when the program was off’doing other stuff’, the stepper stopped!   Not what I wanted at all…

Today I found a great site re using timers (http://www.engblaze.com/microcontroller-tutorial-avr-and-arduino-timer-interrupts/)  and have now got it driving really well using my own version of a stepper driver, which uses the interrupts to create the pulses, while leaving the processor free to do stuff like check switches and update the LCD.!!!

 

I’ve never used the timers/interrupts before, but it has certainly solved this issue!

 

Cheers,

Jim

 

From: gctec...@googlegroups.com [mailto:gctec...@googlegroups.com] On Behalf Of Robert Moller
Sent: Monday, 23 May 2016 6:05 PM
To: gctec...@googlegroups.com
Subject: Re: [gctechspace] Stepper Motors & EasyDriver board

 


For more options, visit https://groups.google.com/d/optout.

No virus found in this message.
Checked by AVG - www.avg.com

Version: 2016.0.7597 / Virus Database: 4568/12279 - Release Date: 05/22/16

Mark Voevodin

unread,
May 23, 2016, 5:38:05 AM5/23/16
to gctec...@googlegroups.com
There is a RTOS available for Arduino, that does that for you, if Memory serves me. 

RTOS = Real Time Operating System

Mark

Sent from my iPhone

Jim Cove

unread,
May 23, 2016, 9:01:38 AM5/23/16
to gctec...@googlegroups.com

Thanks Mark,   Dr Google knows a little about such a thing: https://create.arduino.cc/projecthub/feilipu/using-freertos-multi-tasking-in-arduino-ebc3cc

 

I believe I have it working using an interrupt driven pulse to the stepper, but (when I get time) I have a read of that article.

 

/Jim

Version: 2016.0.7597 / Virus Database: 4568/12280 - Release Date: 05/22/16

--
You received this message because you are subscribed to the Google Groups "Gold Coast TechSpace Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gctechspace...@googlegroups.com.
To post to this group, send email to gctec...@googlegroups.com.
Visit this group at https://groups.google.com/group/gctechspace.

Robert Moller

unread,
May 25, 2016, 6:13:01 PM5/25/16
to gctec...@googlegroups.com
Hi Jim, yes the Arduino IDE had software in Samples to make the Stepper rotate. Not sure I they changed it.

I ones said that the Teflon piece that came with the Cocoon (ALDI) 3D printer was a guide for the filament. Now I know that when you take the printer head apart that this is a spare part for the inside of the print head. Teflon does not melt under the temperatures we print with.
Robert

On Sat, May 21, 2016 at 4:10 PM, Jim Cove <j...@mastercut.com.au> wrote:

--
You received this message because you are subscribed to the Google Groups "Gold Coast TechSpace Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gctechspace...@googlegroups.com.
To post to this group, send email to gctec...@googlegroups.com.
Visit this group at https://groups.google.com/group/gctechspace.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/7d3000bd6ff545c6b924bcd2498e4910%40bne3-0011embx.exchange.server-login.com.
For more options, visit https://groups.google.com/d/optout.

Jim Cove

unread,
May 25, 2016, 8:20:15 PM5/25/16
to gctec...@googlegroups.com

Stepper problem all solved using the interrupt timers…

Good to know re the Teflon – I didn’t know that (wonder if I kept it???)!

 

/Jim

 

From: gctec...@googlegroups.com [mailto:gctec...@googlegroups.com] On Behalf Of Robert Moller
Sent: Thursday, 26 May 2016 8:13 AM
To: gctec...@googlegroups.com
Subject: Re: [gctechspace] Stepper Motors & EasyDriver board

 

Hi Jim, yes the Arduino IDE had software in Samples to make the Stepper rotate. Not sure I they changed it.


For more options, visit https://groups.google.com/d/optout.

No virus found in this message.
Checked by AVG - www.avg.com

Version: 2016.0.7598 / Virus Database: 4568/12293 - Release Date: 05/25/16

Mark Voevodin

unread,
May 25, 2016, 9:26:55 PM5/25/16
to gctec...@googlegroups.com
Jim,

Only a problem if you turn the temp up too much on the hot end, and melt the PLA into a black mess, fusing it to the teflon, and thereby requiring replacement.

Easy to do, but another reason to double check your settings before printing.  Like measure twice, cut once - but for 3D printing it would be Check Setup twice, 3D print once?? :)

They obviously have had a few people do it, and worked out it is cheaper to provide a spare, than waste time on support calls.  Good customer service.

regards

Mark Voevodin

Reply all
Reply to author
Forward
0 new messages