Re: Jedicut and Arduino over USB

101
Hi All.

I'am paul from the Netherlands and going to build a lowcost cnc foam cutter.Oh yes and a totall noob and newbie with a big interest in this subject..its a nice hobby.

I ordered just an arduino uno(chinese one on ebay) and a 4 axis tb6560 stepper driver board(red one) after reading this thread.

I have the following question. I downloaded the usbserial.dll, comport.ini and the fcifmdlcnc.ino.
The usbsereral.dll will be saved in de dir of jedicut and fcifmdlcnc.ino is programmed in to the arduino. Where will the file comport.ini have his place?

I also saw a lot of other files(usbseriall.ccp, usbseriall.def....etc.. will those be needed to or are this fore building the sreiall.dll?

regards,
Paul

Re: Jedicut and Arduino over USB

104
HI
I have followed this thread with great intrest.
I have built the hardware.I have single tb6560 steppers. the problem iam having is when using the arduino interface i only have movement in one direction.
On selecting forward the motors run correctly on selecting reverse the motors move very erattically with no real rotation.
As a foot note the stepper motors and drivers work without fault when operated with Mach3 through the LPT port.
Can any one offer any advice.
Nigel

Re: Jedicut and Arduino over USB

109
Hi Nigel,

i think, the problem is here:

/**********************************************************************************/
void handleCommand()
{

byte val = cmdArray[arrayIdxRead+1]; // The command parameter value
switch(cmdArray[arrayIdxRead])
{
case 'A': // All Motors on/off
if(val == '1') {digitalWrite(12, HIGH);}
else {digitalWrite(12, LOW);}
break;
case 'H': // Wire Heat
if(val > 0) {digitalWrite(3, LOW);}
else {digitalWrite(3, HIGH);}
break;
case 'M': // Motor step Command
sendMotorCmd(val);
sendMotorCmd(val); // send it a second time, because of timing problems with the mdlcnc
//delayMicroseconds(5); here you take a delay, you can test it with 50ySek or higher
sendMotorCmd(0); // and turn motors off, falling edge of pulse
// here is the problem, you must show, that only the "Step" goes low
break;
case 'F': // Change the timer frequency, the time between two steps
if(val>127) val =127; // restrict from 0 to 127 corresponds to 1kHz to 0.5kHz
val = 127-val;
initTimerCount = val;
break;
}


void sendMotorCmd(byte cmd)
{
PORTB = (PORTB & 0xF0) | (cmd & 0x0f);
PORTD = (PORTD & 0x0F) | (cmd & 0xf0);
}

A another way is, to change the code.

You can take its so:
call the funktion "void handleCommand(val)" only one time.

I don't no the Arduino-code!

//Pin... = Portpins, Val. = bit for Step or Dir

Pin X1-Step = Val.7
Pin X1-Dir = Val.6

Pin Y1-Step = Val.5
Pin Y1-Dir = Val.4

Pin X2-Step = Val.3
Pin X2-Dir = Val.2

Pin Y2-Step = Val.1
Pin Y2-Di r = Val.0

in funktion "void handleCommand()", you can write it so:

if(Val.7==1)
{
Pin X1-Step =1;
}
else
{
Pin X1-Step =1;
}

make this for all pin's, step and dir.
after this, make the delay

delayMicroseconds(50);

now make pin-step low
Pin X1-Step =0;
Pin X2-Step =0;
Pin Y1-Step =0;
Pin Y2-Step =0;

Manfred
`); }); })(jQuery, window, document, phpbb);