Page 11 sur 23

Re: Jedicut and Arduino over USB

Posté : lun. avr. 01, 2013 4:04 pm
par Paul
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

Posté : mar. avr. 02, 2013 3:07 am
par MAES
Hallo Paul,

greetings to the Netherlands (my Wife is Netherlands).

The usbserial.dll must in Directory Jedicut.ll

The comport.ini Directory Jedicut

Manfred

Re: Jedicut and Arduino over USB

Posté : mar. avr. 02, 2013 3:41 pm
par Paul
Bedankt Manfred, ( subtitle: thanks Manfred),

I am waiting for my components to be deliverd bij the postman.
When everything is build to gether and working(or not working) than I'l be back. :-)

Kind regards,
Paul

Re: Jedicut and Arduino over USB

Posté : mar. avr. 02, 2013 10:36 pm
par zippyt
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

Posté : jeu. avr. 04, 2013 7:52 pm
par MAES
Hallo Nigel,

i think you must change the Step-Pin to the Direction-Pin.

Manfred

Re: Jedicut and Arduino over USB

Posté : ven. avr. 05, 2013 3:27 pm
par zippyt
Hi Manfred
I have now tried swapping the dir and step pins with no rotation at all.
I have had a look at the setup in mach3 that works and the dir and step are both active low so iam not sure if this is the problem.
many thanks
Nigel

Re: Jedicut and Arduino over USB

Posté : sam. avr. 06, 2013 3:05 pm
par MAES
Hallo Nigel,

show here : http://www.aeropassion.net/forums/read. ... 582,page=3

It is possible that the direction-impuls in arduino-code is to short.

I have make a serial-interface with a dsPic, so i must create new a code for them.

I have not arduino-ide.

Manfred

Re: Jedicut and Arduino over USB

Posté : lun. avr. 08, 2013 9:51 am
par zippyt
Hi Manfred

Thank you for your reply.
I do not really understand the required code change. Could you please give me an exmple of what part of the arduino code to change.
Many thanks.
Nigel

Re: Jedicut and Arduino over USB

Posté : lun. avr. 08, 2013 5:22 pm
par MAES
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

Re: Jedicut and Arduino over USB

Posté : jeu. avr. 11, 2013 7:15 pm
par zippyt
Hi Manfred
I have tried changing the delay as you suggested.
I still cant ge the motors to run in both directions i can only think that the arduino code is not compatable with the TB6560 controllers.
Do you have any other idears???
Thanks
Nigel