Page 5 sur 23

Re: Jedicut and Arduino over USB

Posté : ven. nov. 23, 2012 10:50 am
par Vincent
Hello,
Thank Martin for this explanations.
So the pins configuration in Jedicut's options will be always the same for all CNC interfaces.
It's the cable between arduino and CNC board witch will adapt controls bytes for differents CNC interfaces.

I think it's a good idea to add the "delayMicroseconds " parameter in comport.ini, to adapt delay for different board, instead of recompile the code every 30 seconds to test :p

Jerome, Ok for the photo, i'll do it.

Re: Jedicut and Arduino over USB

Posté : ven. nov. 23, 2012 11:43 am
par Vincent
In progress (:D

to match with axis assignment in Jedicut's manual control :

[pre]
Axis Jedicut pin mm2001
X1 3 (step)
8 (dir)
X2 9 (step)
2 (dir)
Y1 5 (step)
6 (dir)
Y2 7 (step)
4 (dir)
[/pre]

Re: Jedicut and Arduino over USB

Posté : ven. nov. 23, 2012 11:57 am
par Vincent
Jerome,
here's my cable.
adapt_USB_arduino_nano_mm2001.jpg adapt_USB_arduino_nano_mm2001.jpg Vu 5008 fois 82.83 Kio
(:D

Re: Jedicut and Arduino over USB

Posté : ven. nov. 23, 2012 1:12 pm
par MAES
Jerome,
i have a question to the heating-control.

When i write a 2-byte command from arduino to the USBserial.dll with include the value from the heating-pwm(0-100),
is it possible that you read this value in Jedicut?

Re: Jedicut and Arduino over USB

Posté : sam. nov. 24, 2012 8:31 am
par Jerome
Martin,

If I understand we can continue to affect dir and clock pin number in Jedicut ? For the others it depends on the CNC board and the cable.

Vincent,

Thanks for the photo ! I can't buy this arduino, it's in backorder :(

MAES,

Jedicut can read the heating value returned by arduino if you use the right function in your plugin ;)

Re: Jedicut and Arduino over USB

Posté : sam. nov. 24, 2012 10:46 am
par MAES
Jerome,

in the plugin i can not find the funktion who i can Jedicut tell the PWM-value.
Can you help me?

Manfred

Re: Jedicut and Arduino over USB

Posté : sam. nov. 24, 2012 1:25 pm
par Vincent
Manfred,
It's the "LireChauffeMachine()" function. When it's called by Jedicut , it return a decimal value ('double' type ) witch is the heat value calculated by the plug-in with the PMW signal heat built by the CNC board.

In the source code of USBSerial.dll, this function return always 'O' :

JEDICUTPLUGIN_API double LireChauffeMachine()
{
#ifdef DEBUG_OUTPUT
fprintf(fp,"LireChauffeMachine:\n" ) ;
#endif
return(0);
}

Re: Jedicut and Arduino over USB

Posté : sam. nov. 24, 2012 6:16 pm
par MAES
Vincent,

thank you, i have found it.
0-100% = a return-value 0.0-1.0.

Manfred

Re: Jedicut and Arduino over USB

Posté : sam. nov. 24, 2012 9:35 pm
par MAES
Here is the code for PWM to Jedicut.

From Arduino i send the PWM-Value in 2-bytes.
'H'and value.

changes in dll.

void checkInput()
{
int n;
char inBuf[2];

ReadFile(hCOM, &inBuf, 2, (LPDWORD)((void *)&n), NULL);
//if(n=1)
{
switch(inBuf[0])
{
case 'S': // stop transmission
mcBusy = true;
break;
case 'C': // continue transmission
mcBusy = false;
break;
case 'E': // Limit switch hit TODO
break;
case 'A': // Stop the complete cut TODO
break;
case 'H': // Stop the complete cut TODO
PWM_Value = inBuf[1];
break;
default:
break;
}
}
}


JEDICUTPLUGIN_API double LireChauffeMachine()
{
double PWM = 0.0;
PWM = (double)PWM_Value/100.0;
#ifdef DEBUG_OUTPUT
fprintf(fp,"LireChauffeMachine:\n");
#endif
return(PWM);
}
PWM_Value must global.

i have engineer code for a dsPic-controller,
so i can not send the code for the arduino.

Manfred

Re: Jedicut and Arduino over USB

Posté : dim. nov. 25, 2012 12:35 pm
par Vincent
Hi everybody !

The tests progress...But now, there's a problem with the motor's direction...It's almays the same ::o
Even the "invert" option cases are checked in Jedicut options, or in manual control with a negative/positive travel value...
Probably a problem with pin's direction assignment, but I have already re wire them to test, and nothing to do, no changes...

8-)