Fadal 4020 upgrade

mycnc
Posts: 358
Joined: Thu May 10, 2018 2:42 pm

Re: Fadal 4020 upgrade

Post by mycnc » Sun Jan 06, 2019 12:43 am

euroflo wrote:
Sun Jan 06, 2019 12:05 am
DAC value..??? dont know. I will have to have a look at his and see if I can come up with a reading
I suppose there should be some low voltage on DAC to get low speed rotation.
But what value? I suppose you can find the value by experiments.

Yes, end of Tool change description is not really clear for me (about turret retract), so M602 should be fixed.

There is M610 procedure from previous ATC profile, it has to be fixed, but the idea should work

Code: Select all

#include pins.h
#include vars.h

main()
{

tool_current=gvarget(5400);
tool_next=gvarget(5409);

portclr(output_atc_cw);		//turn on tollchanger rotation CW
portclr(output_atc_ccw);	//turn off tollchanger rotation CCW


tool_current=eparam&0xff;	//current tool in the low byte
tool_next=(eparam>>8)&0xff;	//next tool in the hig byte


direction=1;

steps=tool_next-tool_current;


if (steps==0)
{
  exit(99);
};

if (steps<0)		//if steps is negative, switch rotation in CCW and get abs(steps)
{
 direction*=(0-1);
 steps=0-steps;
};


if (steps>5)		//if long way - try opposite direction
{
 direction*=(0-1);
 steps=10-steps;
};


if (steps==0)
{
  exit(99);
};


//read input before we turn-ON motor
sensor_prev=portget(sensor_atc_position);
sens0=sensor_prev;


if (direction<0)
{
  portset(output_atc_ccw);		//turn on tollchanger rotation CCW
};

if(direction>0)
{
  portset(output_atc_cw);		//turn on tollchanger rotation CW
};


tool_count=0;

do
{

 sensor_current=portget(sensor_atc_position);

 if (sensor_current==sensor_prev)
 {
  tool_count=0;
 };
 
 if (sensor_current!=sensor_prev)
 {
  tool_count++;
  if (tool_count>5)
  {
   if (sensor_prev==0)	//positive edge;
   {
    steps--;
   };
   sensor_prev=sensor_current;
   edge_count=0;
  };
 };


}while(steps!=0);



portclr(output_atc_ccw);
portclr(output_atc_cw);

exit(99);	//normal exit 

};

mycnc
Posts: 358
Joined: Thu May 10, 2018 2:42 pm

Re: Fadal 4020 upgrade

Post by mycnc » Sun Jan 06, 2019 12:45 am

How many tools in the ATC?
Need to know to find a short way (CW or CCW)

I plan to make a few fixes and put a complete profile tomorrow.

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Sun Jan 06, 2019 1:02 am

Hi mate
21 tools on the ATC

mycnc
Posts: 358
Joined: Thu May 10, 2018 2:42 pm

Re: Fadal 4020 upgrade

Post by mycnc » Sun Jan 06, 2019 3:12 am

euroflo wrote:
Sun Jan 06, 2019 1:02 am
Hi mate
21 tools on the ATC
It will be something like this in the M610

Code: Select all

if (steps>10)		//if long way - try opposite direction
{
 direction*=(0-1);
 steps=21-steps;
};
How is your play with the screen colours?

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Sun Jan 06, 2019 4:46 am

still playing around
Attachments
screen playing.JPG
playing with the screen

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Tue Jan 08, 2019 2:25 am

hey mate, have changed some pins around to hopefully make it a little easier

output 11 on= high range
output 11 off=low range
output 15=DAC disconnect
output 5 = drawbar

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Tue Jan 08, 2019 11:46 pm

Hey mate found a little bug in the software.
I went to turn the pop-up message off, and since then I get an little grey block in the middle of the screen...( see pic)
thanks
Justin
Attachments
IMG_20190109_093953.jpg
screen

mycnc
Posts: 358
Joined: Thu May 10, 2018 2:42 pm

Re: Fadal 4020 upgrade

Post by mycnc » Wed Jan 09, 2019 4:59 am

I suppose popup message is from HOMING_HANDLER.plc

Here is description of the procedure and at the end of the article you can find how to disable it.

Attached is a complete profile to start testing.
However, I can see a few another fixes should be done.

There are pins defined for the ATC procedure

Code: Select all

#define OUTPUT_CCW_TURRET			8
#define OUTPUT_CW_TURRET			9
#define OUTPUT_CCW_SPINDLE			13
#define OUTPUT_SPINDLE					14
#define OUTPUT_HIGH_SPINDLE		11
#define OUTPUT_LOCK_SPINDLE_ORIENTATION		4
#define OUTPUT_TURRET_EXTEND1			6
#define OUTPUT_TURRET_EXTEND2			2
#define OUTPUT_DRAWBAR_LOCK			5
#define OUTPUT_DAC_DISCONNECT			15

#define INPUT_SPINDLE_POSITION			4
#define INPUT_TURRET_TOOL					3
#define INPUT_TURRET_HOME					1

Input 2 is mentioned in the source, but not in the definition. What is it?
Some pins renamed, a few added. Need to fix/add LEDs on the screen accordingly.
Attachments
FADAL4020_2019-0108_2354.tar.bz2
(55.92 KiB) Downloaded 8 times

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Thu Jan 10, 2019 12:07 am

Hey mate
Made a few changes and works great... :D

Now the next problems

1... timers.... I want to adjust the timer for a longer period...

I have a lube system that need to turn on for 2 secs.... then off for 6 mins

2 ... speed.... we need the M03 to see if the speed is over 5000rpm... is so engage high range OUTPUT 11 ON.... 4999rpm...OUTPUT 11 OFF

thanks
Justin

euroflo
Posts: 23
Joined: Wed Dec 19, 2018 8:23 pm

Re: Fadal 4020 upgrade

Post by euroflo » Thu Jan 10, 2019 4:48 am

another Q for you... the probe and tool setter came with a little resistor .... whats that for..?
Attachments
IMG_20190110_144352.jpg

Post Reply