Stepper motor Drivers in flowcode

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Aidanb2
Posts: 1
Joined: Fri Nov 24, 2017 5:57 pm
Contact:

Stepper motor Drivers in flowcode

Post 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

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Stepper motor Drivers in flowcode

Post 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.

kosielemmer
Posts: 5
Joined: Fri Oct 29, 2021 2:47 pm
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

kosielemmer
Posts: 5
Joined: Fri Oct 29, 2021 2:47 pm
Contact:

Re: Stepper motor Drivers in flowcode

Post by kosielemmer »

Hi

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

Thanks very much

chipfryer27
Valued Contributor
Valued Contributor
Posts: 664
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: Stepper motor Drivers in flowcode

Post by chipfryer27 »

Hi

You can find them under Component Libraries > Outputs > Mechatronics

Regards

kosielemmer
Posts: 5
Joined: Fri Oct 29, 2021 2:47 pm
Contact:

Re: Stepper motor Drivers in flowcode

Post 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
Attachments
Capture.PNG
Capture.PNG (44.6 KiB) Viewed 5575 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 664
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

kosielemmer
Posts: 5
Joined: Fri Oct 29, 2021 2:47 pm
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

chipfryer27
Valued Contributor
Valued Contributor
Posts: 664
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: Stepper motor Drivers in flowcode

Post 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

kosielemmer
Posts: 5
Joined: Fri Oct 29, 2021 2:47 pm
Contact:

Re: Stepper motor Drivers in flowcode

Post by kosielemmer »

Thanks so much. Will give it a whirl

Post Reply