Fadal 4020 upgrade
Re: Fadal 4020 upgrade
Depends on the schematic you need a resistor connected accordingly.
Re: Fadal 4020 upgrade
Timers are implemented in the CNC control board to handle some more fast/frequent process without the Host computer.
If you need to run such a slow process, Software PLC procedure should work for you.
Something like this
Code: Select all
#define OUTPUT_OIL 15
main()
{ timer=0;
do{ timer++;
if (timer==20) // 10 times/sec * 2
{ portclr(OUTPUT_OIL); };
if (timer>3600) // 10 times/sec * 60 * 6
{
timer=0;
portset(OUTPUT_OIL);
};
}while(1);
exit(99);
};
Re: Fadal 4020 upgrade
Hey mate
Timer is working great... how are you going with the speed code..?
Thanks
Justin
Timer is working great... how are you going with the speed code..?
Thanks
Justin
Re: Fadal 4020 upgrade
questions:
1) What is maximum spindle speed? (maybe I missed it)
2) It's not clear about DAC output for different spindle gears
Normally spindle speed value is converted to DAC value range (12 bit 0...4095) to control 0-10V analogue output.
I think need to "cheat" and set RS485 communication in Spindle Tab,
then "Speed ratio (Modbus) set to "1"
In this case, there will be raw spindle speed value in "eparam" variable in PLC.
After that, we can use a simple expression to handle spindle gear
It should be added to M03 and SPN procedures.
But also need to decide how to handle DAC output. Obviously, something with dac should be added into this if-else
1) What is maximum spindle speed? (maybe I missed it)
2) It's not clear about DAC output for different spindle gears
Normally spindle speed value is converted to DAC value range (12 bit 0...4095) to control 0-10V analogue output.
I think need to "cheat" and set RS485 communication in Spindle Tab,
then "Speed ratio (Modbus) set to "1"
In this case, there will be raw spindle speed value in "eparam" variable in PLC.
After that, we can use a simple expression to handle spindle gear
Code: Select all
if (eparam<4999)
{ portset(OUTPUT_LOW_SPINDLE_SPEED);}
else
{ portclr(OUTPUT_LOW_SPINDLE_SPEED);};
But also need to decide how to handle DAC output. Obviously, something with dac should be added into this if-else
Re: Fadal 4020 upgrade
Hey mate
Thanks for that, I will enter that in and see how we go.
Max speed is 10,000 RPM.
I think I know what you are getting at with the DAC for the 2 spindle gears....
My thinking is that we can leave the DAC the same for both, the way I am thinking is the lets say the DAC is output 10V (max)
in low range spindle speed, we get 5000 RPM, but if we have 10V in high range spindle speed we get 10,000 RPM.
Does that make sense..?? or am I thinking about it wrong..I should really get some way of measuring the RPM... will see about getting a meter to measure it...update just ordered a meter.
What do you think...?
Thanks
Justin
Thanks for that, I will enter that in and see how we go.
Max speed is 10,000 RPM.
I think I know what you are getting at with the DAC for the 2 spindle gears....
My thinking is that we can leave the DAC the same for both, the way I am thinking is the lets say the DAC is output 10V (max)
in low range spindle speed, we get 5000 RPM, but if we have 10V in high range spindle speed we get 10,000 RPM.
Does that make sense..?? or am I thinking about it wrong..I should really get some way of measuring the RPM... will see about getting a meter to measure it...update just ordered a meter.
What do you think...?
Thanks
Justin
Re: Fadal 4020 upgrade
Hey mate, just measured the RPM of the spindle....on screen requested 1000rpm actual is 758... what do I need to tweek to correct it..?
ok just did some testing... in low range with the speed set at 10,000rpm I get a reading of around 2500rpm....DAC =10V
but in high range at 10,000rpm i get around 9800rpm....DAC=10V
so unless my meter is faulty... lt looks like the low range is only good for up to 2500rpm... so will have to switch to high range for anything over that.
thanks
Justin
ok just did some testing... in low range with the speed set at 10,000rpm I get a reading of around 2500rpm....DAC =10V
but in high range at 10,000rpm i get around 9800rpm....DAC=10V
so unless my meter is faulty... lt looks like the low range is only good for up to 2500rpm... so will have to switch to high range for anything over that.
thanks
Justin
Re: Fadal 4020 upgrade
Sorry for the delay
Here is Spindle configuration Tab description
Do you have "RS485/Modbus communication" selected?
I think It's better to set the checkbox to get "RAW" spindle speed value in the M03/SPN procedures.
As I remember I offered you to do so already.
In this case, it's easy to handle gears switching,
but need to adjust the DAC value inside the procedures. A few experiments will be needed.
I think it's good to edit SPN.plc procedure and test it by pressing Spindle speed increase/decrease.
SPN.plc source code is
Could you try this procedure?
Question: spindle gears can be switched on the fly? Or need to turn OFF before switching?
speed=eparam;
and
speed=eparam/2;
are very rough adjustment for DAC register.
There more accurate ratios will be needed for each gears range.
The PLCs do NOT accept floating point values, so mul/div style ratio will be needed
like-
speed=eparam*20/21; //a ratio is less than "1"
speed=eparam*21/20; //a ratio is more than "1"
Let me know if any question, waiting for test results.
Here is Spindle configuration Tab description
Do you have "RS485/Modbus communication" selected?
I think It's better to set the checkbox to get "RAW" spindle speed value in the M03/SPN procedures.
As I remember I offered you to do so already.
In this case, it's easy to handle gears switching,
but need to adjust the DAC value inside the procedures. A few experiments will be needed.
I think it's good to edit SPN.plc procedure and test it by pressing Spindle speed increase/decrease.
SPN.plc source code is
Code: Select all
#include pins.h
main()
{
//Change the Spindle State
gvarset(7371,eparam); timer=30;do{timer--;}while (timer>0); //30ms delay
if (eparam<4999)
{
portset(OUTPUT_LOW_SPINDLE_SPEED);
speed=eparam;
if (speed>4095){speed=4095;};
dac01=speed;
}
else
{
portclr(OUTPUT_LOW_SPINDLE_SPEED);
speed=eparam/2;
if (speed>4095){speed=4095;};
dac01=speed;
};
exit(99);
};
Question: spindle gears can be switched on the fly? Or need to turn OFF before switching?
speed=eparam;
and
speed=eparam/2;
are very rough adjustment for DAC register.
There more accurate ratios will be needed for each gears range.
The PLCs do NOT accept floating point values, so mul/div style ratio will be needed
like-
speed=eparam*20/21; //a ratio is less than "1"
speed=eparam*21/20; //a ratio is more than "1"
Let me know if any question, waiting for test results.
Re: Fadal 4020 upgrade
hey mate
I entered the code into SPN... but was saying syntax error line 19...
I sorted it out by closing the program down and restarting... that fixed it...
I have the RS ticked..... do i need to tick the 2 items in the " read register " section as per your pic..??
and spindle speed will have to be changed when the spindle is stopped
thanks
Justin
I entered the code into SPN... but was saying syntax error line 19...
I sorted it out by closing the program down and restarting... that fixed it...
I have the RS ticked..... do i need to tick the 2 items in the " read register " section as per your pic..??
and spindle speed will have to be changed when the spindle is stopped
thanks
Justin