Page 1 of 1

Stepper motor Drivers in flowcode

Posted: Sat Nov 25, 2017 11:44 am
by Aidanb2
Hi,

I'm new to flowcode so hopefully somebody can help me with this. I'm trying to control a nema23 stepper motor using a motor driver and an arduino nano. I am unsure how to program this in flowcode. In flowcode the stepper motor output assumes that you will be connecting the coils of the stepper directly to the micro controller however there doesn't seem to be a way of selecting a motor driver output with STP DIR and ENA pins.

There have been a number of posts on this forum that appear to be from other beginners in a similar situation to me, mentioning using led outputs and other methods to presumably replicate the driver but I cannot find a clear guide explaining how to do this in FC7, and these are quite difficult to follow as a beginner. Could someone please help with this?

Cheers

links to other posts:
viewtopic.php?f=46&t=16989&p=70773&hili ... tor#p70773
viewtopic.php?f=46&t=18906&p=81717&hili ... tor#p81717

Re: Stepper motor Drivers in flowcode

Posted: Sun Nov 26, 2017 1:25 am
by Docara
Hi

FC does not assume you will be connecting a stepper motor directly to the microcontroller or any other motor for that matter! FC sets up and configures the control waveforms needed,, YOU must supply the buffers/drivers to interface to your chosen motor. How can any microcontroller supply 2.5A ish the Nema range of motors want.

Do you homework and investigate how to interface the outside world to a microcontroller.

Going back to your post, as you are using a driver module then look in the data sheet and it will tell you what it requires to function. Is it just an H-Bridge driver or a dedicated stepper motor driver etc. As you have not posted the driver you are using how can we help any further.

Matt

Re: Stepper motor Drivers in flowcode

Posted: Mon Nov 27, 2017 6:27 pm
by Benj
Hello,

This is a stepper driver I've used before on a CNC project.

https://www.sparkfun.com/products/12779

You can drive it from Flowcode using LED components for the step and direction outputs. We can probably make a component quite easily so I'll get it on the list.

Re: Stepper motor Drivers in flowcode

Posted: Fri Oct 29, 2021 2:51 pm
by kosielemmer
Hi there

Is there a component available for a stepper driver. I have numerous and want to use them with an Arduino uno and a nema17 to build an automated filament winder.

Thanks very much

Re: Stepper motor Drivers in flowcode

Posted: Fri Oct 29, 2021 3:02 pm
by Benj
Hello,

Flowcode v9 supports step and direction type stepper drivers.

In earlier versions of Flowcode you probably need to do things using general purpose outputs such as LED components.

For example.
viewtopic.php?f=76&t=21384

Re: Stepper motor Drivers in flowcode

Posted: Fri Oct 29, 2021 3:11 pm
by kosielemmer
Hi

That was quick. I couldn’t find the drivers in v9 but will look some more.

Thanks very much

Re: Stepper motor Drivers in flowcode

Posted: Fri Oct 29, 2021 10:30 pm
by chipfryer27
Hi

You can find them under Component Libraries > Outputs > Mechatronics

Regards

Re: Stepper motor Drivers in flowcode

Posted: Sat Oct 30, 2021 6:41 pm
by kosielemmer
Thanks very much

All I have are in the attached. I am using v9 though - is there a difference?

Hope I am not being dense

Re: Stepper motor Drivers in flowcode

Posted: Sat Oct 30, 2021 10:19 pm
by chipfryer27
Hi

Try using the Stepper Motor (Generic) or the NEMA8. The NEMAxx is really just a reference to the physical size of the motor and the component will probably work for all NEMA motors. The Wiki for these doesn't have an example as yet.

For both, under Properties > Driver you can choose between driving coils directly (via FETs or the like as Matt suggested in an earlier post in the thread) or use Step/Direction to provide signals to a driver board. The latter is probably easier as you can get away with just using Pulse / Direction / Enable pins if application allows.

Many driver board out there catering from hobby to industrial. Which one are you thinking on using?

Hope this helps

Regards

Re: Stepper motor Drivers in flowcode

Posted: Sun Oct 31, 2021 11:10 am
by kosielemmer
Hi again

I have a few - testing really with 2209 drivers and 17HS4023 steppers but will probably use TB6600 4A 9-42V Stepper Motor Driver Controllers with stronger nema 17 motors. I have all those already and had it working with the CNC shield but want to be more economical and also use this little project to learn flowcode.

Thanks for your help here.

All the best

Re: Stepper motor Drivers in flowcode

Posted: Sun Oct 31, 2021 5:05 pm
by chipfryer27
Hi

I've used TB6600 drivers and they are quite capable. I used pulse / direction with a duty cycle of 25% with little trouble at all (well apart from me doing something stupid).

The generic stepper component will work fine.

You seem quite familiar with stepper operation so I'm guessing you may just need a hand with FC itself to create the required pulses. Many ways to do such including using component, delays, PWM or timer interrupts.

Once you establish how many steps per revolution you need, and subsequent revs per second, you can work out your pulse rate and duty cycle. I'm not overly familiar with the Nano but it is more than capable of this.

I can probably knock up a very basic example if you get stuck.

Regards

Re: Stepper motor Drivers in flowcode

Posted: Sun Oct 31, 2021 6:01 pm
by kosielemmer
Thanks so much. Will give it a whirl