Re: Jedicut and Arduino over USB

41
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

45
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 ;)
Jerome

Re: Jedicut and Arduino over USB

47
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

49
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

50
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-)
`); }); })(jQuery, window, document, phpbb);