6 axis wire edm

Moderators: TomKerekes, dynomotion

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

6 axis wire edm

Post by Rasta » Sun Sep 20, 2020 9:09 am

Hi;
Im making a 6 axis wire edm machine with 4 axis interpolating , and because im using a Kflop and Kanalog , I cant use JP7 in
Kflop to drive my Step and Dir stepper motor drives, so Im using JP5 for 4 axis , and after seen a post in CNC forum , I wired my other 2 axis step and direction to JP7 ,as follows ,
axis 0 step pin 12
axis 0 dir pin 13
axis 1 step pin 14
axis 1 dir pin 15
The reason I don't use pin 16 is because Im using a flat 16pin cable with a 16 pin IDC to connect to the Kflop and a IDC DB 15 , connector to connect to
the control box, and I left the pin 16 out
also Im using the 5 v pin and ground pin on Jp4 to power the level converter for the step and direction signals.
also im using the 3.3v on pin3 on jp4 to go to a N.O. Emergency stop,common with the other side going to pin 5 of Jp4
The reason why I did not use JP6 is because I want to limit all these signals to one cable source , as this machine produces a lot of electrical noise
All the home and limit switches and pump switches and anciliary equipment will go to the Kanalog board

Can you please point me the way to implement this in the Kmotion control ?
thank you
Mariano

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: 6 axis wire edm

Post by TomKerekes » Sun Sep 20, 2020 4:23 pm

Hi Rasta,

I'm sorry I don't understand the question. Did you mean to say JP6 pins 12, 13, 14, 15? That wouldn't work. KFLOP only has Step/Dir on JP6 pins 13, 14, 15, 16. Why not leave out pin 2? Anther option might be to apply 5V also to the KFLOP 12V. Then leave out pin 1. 12V is not needed by KFLOP but is just routed to all the connectors.
Regards,

Tom Kerekes
Dynomotion, Inc.

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Wed Sep 23, 2020 1:59 am

Hi Tom; thank you for the reply
I mean to use JP4 , pins 12,13,14,and 15 , can they be used for the step and dir purpose? or Im limited to use pins 13,14,15,16 on jp4.. ? on the emergency stop matter, can I use a connection from JP4 pin 3 (3.3V) to a N.O. common connection in a emergency stop switch, with the other side of the switch wired to pin 5 IO,16. can it be done? do I need a pullup resistor?
Yes I could have left out pin 2, instead of pin16, but wouldn't it make the wiring of the IDC cable more complicated?
The removal of the 12v from the JR1 connector and bridge it to 5 V ,and use pin 2 as a 5v supply is a very good idea ,thank you
Thank you Tom , you are a great help.
regards
Mariano

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Wed Sep 23, 2020 4:56 am

hi Tom ;
I modified and pasted the following code from one of your posts please let us if its correct
//this is when Estop is wired to pin n5 of jp4 IO bit16

Code: Select all

#include "KMotionDef.h"

// Watches for EStop Input and disables Axes when detected

main()
{
for (;;) //loop forever
{
WaitNextTimeSlice();

// if ESTOP present disable any enabled Axis ??
#define ESTOP_BIT 16
if (ReadBit(ESTOP_BIT))
{
if (ch0->Enable) DisableAxis(0); // axis still enabled? - Disable it
if (ch1->Enable) DisableAxis(1); // axis still enabled? - Disable it
if (ch2->Enable) DisableAxis(2); // axis still enabled? - Disable it
if (ch3->Enable) DisableAxis(3); // axis still enabled? - Disable it
if (ch4->Enable) DisableAxis(4); // axis still enabled? - Disable it
if (ch5->Enable) DisableAxis(5); // axis still enabled? - Disable it

}


}
}

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Wed Sep 23, 2020 5:37 am

or du you think that I should include channel 6 and 7 ? even if I have only 6 axis that will make sure that all are turned off
regards
Mariano

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: 6 axis wire edm

Post by TomKerekes » Wed Sep 23, 2020 5:09 pm

I mean to use JP4 , pins 12,13,14,and 15 , can they be used for the step and dir purpose? or Im limited to use pins 13,14,15,16 on jp4.. ?
only pins 13,14,15,16 can be used

on the emergency stop matter, can I use a connection from JP4 pin 3 (3.3V) to a N.O. common connection in a emergency stop switch, with the other side of the switch wired to pin 5 IO,16. can it be done? do I need a pullup resistor?
That should work. No pull up resistor should be needed. Your switch will connect it to 3.3V. It has a pull down resistor.

The EStop Code looks reasonable. If Axis 6 and 7 are never enabled there should be no need to disable them.
Regards,

Tom Kerekes
Dynomotion, Inc.

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Thu Sep 24, 2020 8:00 am

Hi Tom;
I got nthe emergency stop pin working ( no small means for my very limited c programing ability) thanks for your help,
now Im trying to multiplex the step and dir generators to jp4 and 6 ,
but this program give me a compiling error,
can you please tell me what im doing wrong?
#include "KMotionDef.h"

main()


{


{

// FPGA(STEP_PULSE_LENGTH_ADD)=32; // set the pulse time to ~ 2µs
FPGA(STEP_PULSE_LENGTH_ADD)=32 + 0x40; // set the pulse time to ~ 2µs and multiplex to JP4 and JP6
// FPGA(STEP_PULSE_LENGTH_ADD)=32 + 0x80; // set the pulse time to ~ 2µs and pulse the Step High
// FPGA(STEP_PULSE_LENGTH_ADD)=32 + 0x40 + 0x80; // set the pulse time to ~ 2µs, mux to JP4 and JP6, and pulse the Step High


}


}

}

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Thu Sep 24, 2020 8:08 am

this is the error
c:\Kmotion435b\C Programs\step and dir mux from jp7 to jp4&6.c:23:declaration expected
regards
Mariano

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: 6 axis wire edm

Post by TomKerekes » Thu Sep 24, 2020 5:22 pm

Hi Mariano,

You have extra and miss matched curly brackets. Think of them as begin/ends. They should match. See this.

Please indent your statements properly and post it using the code tag </> in order to make your code easily readable.
Regards,

Tom Kerekes
Dynomotion, Inc.

Rasta
Posts: 31
Joined: Fri Mar 08, 2019 8:24 pm

Re: 6 axis wire edm

Post by Rasta » Fri Sep 25, 2020 7:18 am

Big thanks Tom;
Can you please tell me if its possible to put multiple threads in a single button using #include?
for example a program called say Start.c
#include "KMotionDef.h"
main()
{
#include "Emergency Stop.c"
#include "Jp7 to Jp4 & 6 mux.c"

}

Post Reply