3 Axis Stepper Control

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

shall i reduce the value of Gate drive resistors from 1K to 100 ohms or less?
In schematic it is 1K. I will complete the assembly work tomorrow.
No, please. Keep that 1K. I am thinking you might need to add opto-coupler. so 1K is pretty OK.

You can change R1,R2,R3 & R4 to 2.2K. Now it is 1K in the schematic. Normally we use 2.2K there
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Good Evening, Sorry for late reply,
Ok i will use 1K now.
One thing i want to know, as my Motors are 24V type,
i have order a transformer having 3 sec windings,
One 0-24V/ 7A for 3 Motors, one 5V/0.5A for IC and Drive.
Will it be OK. We can add Opto if needed.

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

Hi
The motor rating is 1.5A per winding which means it could be 1.5*2 =3A maximum when using half-step. so 7A should be OK. 5V/0.5A is fine for control circuit.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Sorry for late reply, You rightly said our Motors are 24V/1.5A ratings,
but we are using 3 Motors so 1.5A*3=4.5A will be the current. So i order for 7A.
Assembly of the PCB is already completed, i am waiting for the Transformer to arrive.
I will post the final schematics after getting the Transformer and wiring the board fully.

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

but we are using 3 Motors so 1.5A*3=4.5A will be the current. So i order for 7A.
Actually I think Motor has 1.5A rating for each winding rather than the Motor. For half-step driving we will energize both winding of a single motor which could draw 1.5*2 =3A current that means 3 Motor could draw as high as 3*3=9A. I might be wrong but we need to check that.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thanks for the replay, If you are right each motor will draw 3A at maximum load so 9A is needed to drive 3 Motors.
So let me tell my supplier to increase the current to 10A. This will solve our problem.
What do you say?

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

Yes, I feel that will be risk less. I have checked motor datasheet and it says 1.5A per phase which means it could take 3A maximum. so we should certainly move to 10A.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Here i have attached my assembled PCB image and a fresh Schematics with a little change in switch connections
and included the Transformer n the bridges.
I think we can check the hardware using my external power supply without connecting the Motor now.
So lets write the code. What do you think?

Thanks
With best regards
sks
Attachments
PCB_01.jpg
PCB_01.jpg (94.6 KiB) Viewed 14941 times
stepper ctrl_01rev1.pdf
(102.13 KiB) Downloaded 378 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

I think we can check the hardware using my external power supply without connecting the Motor now.
So lets write the code. What do you think?
I think that's always good to do that. You can test current drawing by putting motor as well. Also can see whether the motor is driven properly or not.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thanks for the reply. I have few questions, shall i test the Motor with out the CPU by making Transistor base to high/low ?
Or we write a simple code and test the Motor with CPU?
Please answer.

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

Hi

Here is a test program to test the stepper motor. Step angle=1.8 so number of step per revolution = 360/1.8 =200
Attachments
stepper_test.fcf
(6.5 KiB) Downloaded 470 times
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Good Evening.
In the sent code you have used 20MHz Crystal but in my hardware i have used a 4MHz crystal.
Shall i correct in the code 20MHZ to 4MHZ and HS to XT ?
Pl replay.

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

In the sent code you have used 20MHz Crystal but in my hardware i have used a 4MHz crystal.
Shall i correct in the code 20MHZ to 4MHZ and HS to XT ?
Yes, you can do that. That should be OK.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Sorry in my Flowcode version, i can't compile the code. There is no component.
So i have to wait till i upgrade my software. you know my condition, there is no way
other than waiting. Sorry

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

No you can compile. I have an alternative solution. I will post the code asap.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

Hi

I have changed the c component for stepper motor and embed that in supplementary code hope that you have the right to use supplementary code. The only issue now you will not be able to simulate and as you don't have the component for stepper motor without upgrading you will not be able to simulate.

Another thing is that I have hard-coded the pins for stepper motor drive to RB<0:3>. You will not see anything in the panel. If you want to change pin please let me know I will tell you how to do that. Please try to compile that and let me know how you get.

PS: It's better to upgrade as soon as possible. I know you are in bit difficulty. Hope that will be solved soon.
Attachments
stepper_test_opt2.fcf
(12.06 KiB) Downloaded 352 times
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Good Morning. Thanks for giving me hope and sending the code.
Thanks, now i am able to compile the code.
I am very much serious to upgrade, but sorry to say it will take time. unless i arrange funds how can i?

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

I am very much serious to upgrade, but sorry to say it will take time. unless i arrange funds how can i?
Yes, I understand. Hope that you will be able to upgrade soon. The code you have compiled you can test that whether it works ok or not. I hope it will work fine. If so, you actually get the whole stepper motor component in the supplementary code and you should be fine in your CNC project.
Enamul
University of Nottingham
enamul4mm@gmail.com

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thanks for the reply, I will test the compiled code tomorrow, as the transformer
will reach me tomorrow. Then only i can post the result.

Thanks
With best regards
sks

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: 3 Axis Stepper Control

Post by bercioiu »

Hi S.K.S.
You can use IRLZ44 instead of your IRFZ44.
IRLZ44 is an logic level gate drive, this means that you don`t need anymore other component to drive the FET. Output pic will drive de FET directly, connecting the gate directly to the out pin of the pic.
Here or here you can see some applications for CNC drivers whit IRLZ44. I build one of them with IRLZ24 (17Amps.) because my motors are rated to 1.5 A.
Now, I want to build an driver with pic, that`s why I`m here. Did the transformer arrived? If yes, how did your driver work for the moment ? What are the results?

Thank you and I look forward to hearing from your project!

Puiu Bercioiu

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr bercioiu,

Thanks for your reply on my thread and suggesting. Yes my Transformer has arrived, sorry i have not tested yet.
I will search the suggested MOSFET IRLZ44 locally and let you know after that.
I will post the result of my project after testing.

Thanks
With best regards
sks

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr bercioiu,

I have studied the Schematics provided the links by you. Thanks.
In OS3schematic.pdf control is from parallel port. right?
Have you done this project? If yes, what interface software you are using to control the CNC Machine, kindly tell me.

Thanks
With best regards
sks

bercioiu
Posts: 161
Joined: Sun Feb 25, 2007 10:56 am
Location: bucharest, romania
Has thanked: 90 times
Been thanked: 34 times
Contact:

Re: 3 Axis Stepper Control

Post by bercioiu »

I recently completed that project. is a standard controller and driver for stepper motors, based on logic gates, connected to the parallel port of the computer.With that type of controller-driver you can use any soft you have including EMC2, MACH3, KCam etc (all software that use parallel port). I don`t have an parallel port yet to my computer but i tested the controller with an simple circuit made by me with an 16F877A PIC and an simple program in Flowcode that simulate the dir/step signals. I also made in Flowcode an little program that move the three motors ( with switches on manually mode ) for a better positioning of the three axis.

You can read all about that project at this link.

s.k.sahoo
Posts: 147
Joined: Sun Sep 16, 2012 3:02 am
Has thanked: 144 times
Been thanked: 7 times

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr bercioiu,

First of all, Thanks for a quick response.
I have assembled the PCB as instructed by Mr Enamul. I do think for a Serial or USB input Controller, as parallel port is N/A these days.
Anyway, if you can proved me the complete Project of yours, including the Mechanical design, it will be a great help.
What do you do with this CNC machine? If you makeup your mind please send to my mail.
My email id: sahoosurendrak@gmail.com

Thanks
With best regards
sks

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 3 Axis Stepper Control

Post by Enamul »

Hi Mr bercioiu,

Your project looks interesting but the two important issues are:

1. You have designed the system with digital ICs whereas we are trying to make something with PIC to control the motors and also to interface with PC.

2. Parallel port is almost become absolute in modern desktops. Even the DB9 serial port is not available to new PCs. But serial to usb converter could solve the issue if Match3 works with that.

Do you have any plan to make a PIC based controller and interface unit for your CNC controller? We will be grateful to have your guidance.
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply