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
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.
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
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/CAAjSuEhn_LJ-UWBZc-JZWpYaeqwB%2BpzaB0trtL0n9cdRcPM33Q%40mail.gmail.com.
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
Ohhhh yeah. Sorry about that. You'll need to adjust the delay between pulses then.
Ron
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/f2b27ee21eb946b5ae726738cbc8d09a%40bne3-0011embx.exchange.server-login.com.
--
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.
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
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/CAJW5UQurdwYH%2BU0SMnR3jiP9uJSn0F-hEXWnbgiZmwLkxBgf7w%40mail.gmail.com.
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
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/d48ea030582d419bbd17a4621e8bef06%40bne3-0011embx.exchange.server-login.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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/72E96FD3-E49F-4DAE-A75A-CC5750BD54C9%40nitel.com.au.
--
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.
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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/CAJW5UQuWNtAOyEo-fDmtTwPeZUt%3DVO_0VRDpuRNM%2Bx56%3DE9UHQ%40mail.gmail.com.
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
To view this discussion on the web, visit https://groups.google.com/d/msgid/gctechspace/7fa5487ef9fe4154893274383700303e%40bne3-0011embx.exchange.server-login.com.