How to connect a stepper with 2 Coil?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

How to connect a stepper with 2 Coil?

Post by stefan.erni »

How to connect a stepper with 2 Coil?
Stepper.PNG
(14.05 KiB) Downloaded 11648 times

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: How to connect a stepper with 2 Coil?

Post by Benj »

Hello,

You need something like a dual H-Bridge driver to allow you to push and pull on all four stepper motor pins.

Something like this would do.
http://www.matrixtsl.com/webshop/e-bloc ... board.html

The datasheet shows you the schematic.
http://www.matrixtsl.com/resources/getr ... php?id=887

Something like an L298D would also do the job but as this is transistor based and not FET based you will loose more voltage in the driver IC itself and therefore the driver IC will be able to drive less current and will get hotter.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

I have for the 4 pins a driver.


stepper-driver.PNG
(24.43 KiB) Downloaded 11632 times
I use the pin B9,B8,B4,B3
the pin B9,B8 has a nice signal but the B4,B3 are always high.
If I use "output" for
B4,B3 and set them to low ,they are still always high.

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: How to connect a stepper with 2 Coil?

Post by Benj »

the pin B9,B8 has a nice signal but the B4,B3 are always high.
If I use "output" for
B4,B3 and set them to low ,they are still always high.
Ok what chip are you using and can you post a simple test program so we can have a look.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

The PIC32MX440F256H
I made a board with 4pcs 9Pol connector
The connector 1 is for stepper nr:1
pin B9,B8,B4,B3

The connector 2 is for stepper nr:2
pin E6,E7,F1,B12
I wrote a small program and the stepper 2 is moving 360deg and 360deg back
but the stepper 1 has a Problem with B4,B3. This pin are always high.

I hope it's possible to use "generic stepper" from matrix, because the simulation with the stepper and and my 3D parts is working nice and it's realy a big advantage from FC7.
Attachments
stepper_erni1-for-matrix.fcfx
(32.25 KiB) Downloaded 413 times

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: How to connect a stepper with 2 Coil?

Post by Benj »

Hello,

The B4 and B3 problem may already be fixed by applying the latest files from here.
http://www.matrixtsl.com/mmforums/viewt ... 63&t=18209

Hopefully once the pins are fixed then everything should then work as expected.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

I did the update, but still the same.
The RB4 is on the same pin as C1IN-/CN6
"AN4/C1IN-/CN6/RB4"
Is there a problem with "Comparator 1 Negative Input"?

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: How to connect a stepper with 2 Coil?

Post by Benj »

Yes the stepper motor generic should be able to do the same thing as you're doing in your program.

Please can you post an example where you are controlling the B3 and B4 pins. I can't see anything that would cause an issue but there may be something lurking in the code.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

I'm using now the stepper (nema8) Model from FC.
It's working on the connector 2 this is for stepper nr:2
pin E6,E7,F1,B12


The connector 1 is for stepper nr:1
pin B9,B8,B4,B3
is still not working because of B4,B3
I prepare now a software with 2 stepper and send it to you.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben
here is the Code


Stepper 1 is not working
Attachments
stepper_erni2-for-matrix.fcfx
(33.03 KiB) Downloaded 392 times

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: How to connect a stepper with 2 Coil?

Post by Benj »

Thanks I'm investigating now.

If you change your C code to the following does this help at all?

Code: Select all

DDPCON=0;
CM1CON=0;
CM2CON=0;

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

I insert the 3 line but still the same problem with the Pin B4,B3

regards

Stefan

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hmm in the Manual I found a part I dont understand. maybe You can help me.

How can I Usb "not enable" ?
USB-Enable.PNG
(43.13 KiB) Downloaded 4987 times

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: How to connect a stepper with 2 Coil?

Post by Benj »

I think to disable USB would be.

Code: Select all

U1CON = 0;
However this should be set to 0 automatically after a reset, unless the chip you're using has a USB bootloader which is not cleaning up after itself.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Thank You

I did not help.......

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

I think You are right
I found this in the manual and of corse I dont now to remove or turn off .......
"
Connect your device in bootloader mode to the computer (for PIC32-PINGUINO-MICRO hold
BUT and press RST after connected). Start the IDE from it's shortcut. .........
"
Attachments
PIC32-PINGUINO-MICRO-Revision-A.pdf
(748.41 KiB) Downloaded 284 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

I have further configured the inputs and outputs from the board. Also the input from the switch for the bootloader and some more. Now it works.
thank you for the friendly help.

regards

Stefan

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: How to connect a stepper with 2 Coil?

Post by Benj »

Great glad you've got it working now.

Do you know if the problem was related to the hardware or the bootloader?

If Bootloader related what commands did you have to use to get the pins working correctly?

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: How to connect a stepper with 2 Coil?

Post by stefan.erni »

Hi Ben

Now it's clear, it was a problem in the hardware I did. It was never a problem of FC. Sorry.

Stefan

Post Reply