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

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

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Happy to see you after a long time.
I have tested the hardware, Sorry its not working. The Motor is in to start condition.
Without the Motor, all Gates Mosfet shows High to Low sequentially.
Do you require any data of the hardware such as voltage of different points.

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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

I have redrawn my Schematic using 4Nos Opto in between the 16F877A and the push pull Tr drivers.
Please check the attached schematic and comments.

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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Sorry, missed the attachment. Here it is.
sks
Attachments
stepper ctrl_02.pdf
(112.85 KiB) Downloaded 365 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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

Hi

I think you have to change couple of things like opto-coupler collector power should be 12V which will drive push-pull circuit. pull-down 5.6K resistor has to bring in each pin 4 of opto-coupler. Push-pull drive voltage should be 12V
Please let me know if you are not clear.
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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Hello Mr Enamul,

Please check the modified schematic and comment.

Thanks
With best regards
sks
Attachments
Stepper CTRL_02.PDF
(118.16 KiB) Downloaded 353 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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

That looks better and might need to tune slightly later on but should work now. Just be careful about current rating of bridge rectifier. If still MOSFET become hot it could be due to Vdd=25V, we might need to move high vdd MOSFET
Enamul
University of Nottingham
enamul4mm@gmail.com

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 Sire!
Fist of all I`m not the designer for that project. I only executed that project following the schematic. As I wrote above, only for testing I was simulate the parallel signals with pic. I do not intend to use that controller in combination with a pic or something... I post that schematic for mister SKS to see how to drive the motors more easily...
And for the second issue, that`s why I`m here, to learn how to make an controller based on pic without parallel port...

Sorry if I was misunderstood ...

For SKS:

You must be careful when choosing optocouplers because it is an issue about the rate transfer, I suggest you to choose HCPL6230 or something like that.

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

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr bercioiu ,

It is OK. we thought you must have done the complete CNC project, so i asked for.
You are always welcome to this forum, we all learn here. No body is perfect, we learn from each other.
I am glad to know, you want a PIC based controller like mine, so we can work together, if you don't mind.
I saw my motor running today. I used V451T OPTOCOUPLER (as these were with me), its working all right.
I am thinking to change my MOSFET from IRFZ44 to some other low VDS one. The MOSFET are hot enough.

Thanks for your suggestion
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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thank God, the motor start running after changing the Delay value from 1Sec to 50uSec.
The MOSFET is still Hot enough at 15V, i am planning to change the MOSFET.
Please check the modified sch using opto and Start/Stop and For/Rev Switches.
Please send me the code.

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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

The MOSFET is still Hot enough at 15V, i am planning to change the MOSFET.
You mean you are driving the motor and MOSFET both using 15V. I think you haven't used any regulator to regulate the voltage for motor (according to schematic). Did you check when the motor starts running what is Vdd voltage? Is it drops very low or not too much?
Please check the modified sch using opto and Start/Stop and For/Rev Switches.
I guess you have missed to post the schematic.
Enamul
University of Nottingham
enamul4mm@gmail.com

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 »

s.k.sahoo wrote: The MOSFET is still Hot enough at 15V, i am planning to change the MOSFET.
Do you have a chopper or a power resistor to limit the current to the motor? Anytime a power supply for the stepper motor is used that is greater than the rated voltage of the motor, current limiting is required. The coil resistance of the motor can be computed by dividing the rated voltage by the rated current. For example a motor at 5.2 volts @ 1.6 Amps (5.2/1.6) has a coil resistance of 3.25 ohms. To compute the size of the current limiting resistor subtract the motor voltage rating from the power supply voltage and divide it by the current rating. For example using a 12 volt power supply with the above motor ((12-5.2)/1.6), you would need a 4.25 ohm resistor. The wattage rating of that resistor is the current squared times the resistor value (1.6 * 1.6 * 4.25) or in this case 10.88 watts minimum. Power resistors come in standard wattage rating of 1, 5, 10, 25, 50 watts. So, take care of yours motors!

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

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thanks for the reply and query.
" You mean you are driving the motor and MOSFET both using 15V "
Actually Motor Common is connected to 24V rail and A,A1,B,B1 of motor terminal is connected to MOSFET directly without any current limiting resistors.
" I think you haven't used any regulator to regulate the voltage for motor (according to schematic) "
Yes there is no regulator in 24V rail to Motor.
I have reduced the 24V supply rail to 15V Dc by Variac, just to check. OK
The VDD drop is very low.
Already attached the sch on Sat Dec 29, 2012 12:31 am . Ok again here is the sch.
SHALL I STICK THE MOTOR SUPPLY RAIL TO 24V OR REDUCE TO 15 TO 18V DC ? Pl answer

Thanks
With best regards
sks
Attachments
Stepper CTRL_02.PDF
(118.16 KiB) Downloaded 289 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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

Hi,
Here is the code for start/stop and CW/CCW control for the stepper motor. Please let me know how you are getting.
Attachments
stepper_test2_opt2.fcf
(14.13 KiB) Downloaded 291 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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

I wish all of the Flowcode Team and you "HAPPY NEW YEAR".
Thanks for the code.
I test the code found,
1: To START the Motor i have to press the switch and hold, when i release the switch motor STOPs.

It should be like this, In 1st press the Motor should START running and in 2nd press it should STOP running.

2: Like the START/STOP, the Motor should RUN CW by default, after pressing it should RUN CCW.

3: Motor is Running very slowly, the speed should increase may be 10 to 20 times, i don't have a RPM Meter, i do guess the speed.

4: The motor is HOT at this speed.

Waiting for your replay

Thanks
With Best wishes
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 »

The motor is hot because all the current go through it. That motor will be fride in max 10 min without limiting the current ...
By the way : "HAPPY NEW YEAR" :D

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

Re: 3 Axis Stepper Control

Post by Enamul »

Yes, bercioiu is right. You have to limit the current as I have told. Did you do that already? If not please do 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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamu and Mr Bercioiu,

HAPPY NEW YEAR.
Thanks for the suggestion and guidance.
I want to know what will be the Control Freq, % of Duty Cycle (MAX ON TIME and OFF TIME)?
How Control the Speed by adding a Pot in to AN0 input.
Can we add a Voltage and Current sense from the Motor and control the pulse width?

I have given +12V to 16V supply to the Motor, the Motor wont run at +12V with a torque,
If i increase the voltage to +15 to +16v it runs but generating heat. I dont know how to solve this problem.

I don't know much about Stepper Control. Please help.

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 »

To limit the current, you must know exactly what are the electrical characteristic of your motor. I didn't find your particular type of motor... Are you sure that you typed correct the type/model ? I ask because I don`t find the datasheet for that model ( 23KM-K051-G2 ). Without the electrical characteristics you cant compute the right series resistor. I told you in a previous post that if you use a power source to feed your motors that is greater then the nominal tension of the motor you have to limit the current. I don`t know what is the nominal tension of your motors... If is 5V, you have to subtract the motor voltage rating from the power supply voltage and divide it by the current rating: 24V(your power supply) - 5V (rating motor) = 19V. For this 19V you have to put an power resistor. But, to calculate the resistor, conf. Ohm law, you have to know the rated current of your motor. I assume that the current rated is 1.5A, then you have to put an (19V/1.5A) 12.6 ohm resistor and the wattage of the resistor have to be (1.5 x 1.5 x 12.6) approximately 30W... a lot of power, which now, without resistor, goes directly into the engine.

Later edit:
How did you step down the voltage from 24 to 12/15/16V?

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

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Bercioiu,

Thanks for your reply. Yes we didn't found the exact data of my Motor on net. It a refurbished Motor.
Please see the post dated "Sat Dec 08, 2012 10:01 pm" by Mr Enamul for Motor specification.
We assume it is 5.2V and 1.5Amp.
Actually i don't want to add a high value like more than 1.0 Ohms resistor to limit current.
It will unnecessary emit heat and chances of failure is high in long run.
I will like to modify my Transformer as per the required voltage.
My Transformer is having one 0--12 v winding for drive the push pull Transistor Driver, From that rail
i have used a 5V regulator 7805 for my CPU power supply. The main Motor supply is having a separate
winding having taps of 0,7V,18v AC. I am using a AC VARIAC ( A variable Transformer) at input,
so i am getting my required voltage like 15V to 24V DC for Motor.
I think i could make you understand.
Please tell me about how the speed is controlled and what will be the frq of the drive?
Your kind answer will help me.

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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

Hi SKS,

I think you can concentrate on how to limit current in the motor as we have told. Speed control in stepper motor is not like dc motor. That can be easily done by adjusting delay. If you want to have external control option, I have to plan how you want that like smooth speed change or step change. I will modify the code as you mentioned in last post. I will post hopefully today.
Enamul
University of Nottingham
enamul4mm@gmail.com

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 »

You have right, in practice, we use smaller resistor, like you said, at the limit of the hot the motors... For example, my motors the required resistors are 10 ohms, but I put only 4 ohms and all motors are only slightly warm.. I reduced the resistor until I was satisfied with the torque of the motors.

L.E. Can you draw and post a complete schematic for the power supply and the transformer? Thank you!

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

Re: 3 Axis Stepper Control

Post by Enamul »

Hi,

Here is the program with speed control, start/stop and cw/ccw. Hope this helps.
Attachments
stepper_test2_opt2.fcf
(23.41 KiB) Downloaded 269 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
Contact:

Re: 3 Axis Stepper Control

Post by s.k.sahoo »

Dear Mr Enamul,

Thanks for the posted code.
But sorry, its not working, no out put from RB0 to RB3.
I have connected the potentiometer as advised by you at AN0 pin2 of 877A
I have also connected 4 LEDs at MOSFET output, nothing is showing.
Please help.

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 »

Try this, i made some changes, hope its o.k. now. In case you can not compile, i attach. the hex file for you
Attachments
stepper_test2_opt2_1_sks.hex
(2.95 KiB) Downloaded 201 times
stepper_test2_opt2_1_sks.fcf
(23.59 KiB) Downloaded 283 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
Contact:

Re: 3 Axis Stepper Control

Post by Enamul »

Hi SKS,

I have missed increment step command in the normal loop which bercioiu has added. so his version should work properly. Please let us know whether it works or not.
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply