Rotary tool changer

Moderators: TomKerekes, dynomotion

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Rotary tool changer

Post by Mateusz » Thu Jun 06, 2019 9:37 pm

Dear All,

I'm struggling to implement a rotary tool changer to modified HURCO BMC50. I'm doing tool change first time with basic knowledge of C lang.
Not sure how I can make of use existing LIbrary :?

There are few signal to shuffle around:
- Vertical valve + lower / upper position sesnors
- Horizontal valve + Extended / Retracted Sesnors
- Index sensor
- Carousel home sensor indicating 20th - last tool.
- and tool clamp / unclamp signals set.


I'll be grateful for support,

Regards
Mateusz

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Rotary tool changer

Post by TomKerekes » Fri Jun 07, 2019 3:40 pm

Hi Mateusz,

The first step would be to come up with a detailed flow chart or pseudo code sequence for exactly what has to happen.

Also create a bit list for all the inputs and outputs and what their polarities are.

Is there a rotation axis?

You might test and prove out the sequence manually by toggling bits and observing inputs on the KMotion | Digital IO Screen.

See a code example here.
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Rotary tool changer

Post by Mateusz » Mon Jun 10, 2019 3:29 pm

Hello Tom,

Thank you for replay,
I've created flow chart see attached files + Functional drawing of the rotary unit itself. I think all information are clear. Below required logic on this setup.

#define Cyl_UP 49 // Coil of Vertical cylinder to move UPwards
#define Cyl_DN 50 // Coil of Vertical Cylinder to move Downwards
#define Cyl_EXT 52 // Coil of Horizontal Cylinder to move magazin towards spindle
#define Cyl_RET 51 // Coil of Horizontal Cylinder to move magazine backwards
#define Sens_UP 1036 // Cylinder sensor UP position - logic 1
#define Sens_DN 1037 // Cylinder sensor DN position - logic 1
#define Sens_EXT 1039 // Cylinder sensor EXTENDED position - logic 1
#define Sens_RET 1038 // Cylinder sensor RETRACTED position - logic 1

#define Rotate_ON 53 // Hi state cause to rotate magazine CW
#define Rotate_CCW 54 // Hi state cause to rotate magazine CCW
#define 0_position 1034 // Magazine zero position indicates 20th last position of tool holder
#define INDEX 1035 // Sensor to INDEX rotary unit. One pulse = One Tool Position, LO state indicates Stop / Lock position

#define CLAMP_Cyl 48 // Cylinder to clamp / unclamp Tool. HI - unclamp
#define CLAMP_Pos 1040 // Tool clamped - HI
#define UNCLAMP_Pos 142 // Tool unclamped - HI
#define C_Button 1041 // Manual tool load / unload Push Button

#define Spin_0 149 // HI state orients SPINDLE to 0 Position
#define Orient_Rdy 1032 // HI state indicates SPINDLE 0 position reached

#define Tool_Change_pos xxx.xx // Tool change position for Z axis Cnt's or mm's

Machine is now running with MPG, Servo Spindle + some extra buttons and POt's for FRO and SSO. Toolchange is to tricky for me at the moment.

Thanks Mateusz
Attachments
ROTARY Tool change _ FLow chart.pdf
(29.92 KiB) Downloaded 139 times
Drawing.pdf
(23.98 KiB) Downloaded 168 times

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Rotary tool changer

Post by TomKerekes » Mon Jun 10, 2019 9:55 pm

Hi Mateusz,

That's a great start. But you left out a lot of details.

Create a more detailed flowchart on how to rotate the turret one index position CW and CCW.

Then create a flowchart to home the turret to position 20 using the above.

Then create a flowchart to move the turret from the current position to the desired position.

Include checking for timeout errors assuming you have.a start time in seconds and a current time in seconds.
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Rotary tool changer

Post by Mateusz » Tue Jun 11, 2019 9:34 pm

Hi Tom,

As requested, Please see attached flow charts. I tried to make chart to allow turret move to destination point in the shortest distance / time, not sure of this one it will gonna work correctly.

Thanks
Mateusz
Attachments
Turret flow charts.pdf
(41.59 KiB) Downloaded 152 times

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Rotary tool changer

Post by TomKerekes » Wed Jun 12, 2019 12:21 am

Hi Mateusz,

No sorry. Those flow charts don't make sense.

You can't have a box with an operation like SetBit have two exits. Only one exit is allowed.

All "if" statements must have two exits. One for true and one for false.

You can't do things like:
Counter = n
When n hasn't ever been defined.

Please research flowcharts. Basically a human should be able to follow your flowchart without ever guessing what to do.
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Rotary tool changer

Post by TomKerekes » Wed Jun 12, 2019 4:39 am

This looks looks like a good reference that might help.
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Rotary tool changer

Post by Mateusz » Wed Jun 12, 2019 11:21 am

Hello Tom,

Yes it wasn't good :( but good think is to become better in charts :D - new version attached. I still wonder about the files setup.
Do I'm thinking right ?:
- I think file ServiceToolChangeTable.c would be the most appropriated to co carry out modifications for my needs.
- after mods this file has to run all the time in the KFLOP under any spare thread ? or can be called once when tool change is required directly from M6 command ?
- file SetLastTo1.c Could you please explain me when and how to use it ?
- is there any extra file required to setup to make this tool change happen ?

Shame I can not test it this week. My machine is very far away and there will be no much time to waste on trial and error methodology next time.
I have to collect as much information I need.

Thanks
Mateusz
Attachments
Turret flow charts.odg
(14.95 KiB) Downloaded 129 times

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Rotary tool changer

Post by TomKerekes » Thu Jun 13, 2019 9:17 am

Hi Mateusz,

Much better, but still many errors and missing parts.

Flowcharts should not have any 'while' commands. Instead use 'if' commands that form loops. In some of your loops you will need 2 'if' conditions. For example one to check if the index is present and one to check if the current time - starting time is > 2 seconds

I don't know how your index pulse works. How wide it is or how quickly your turret stops or how much switch bouncing there is. There will likely be a problem where when you go to rotate one index the old index will still be present or bouncing and you will not move the correct amount. You may need logic to wait until the old index goes away for some time before checking for the new index.

I don't follow your logic on which way to turn to the next tool. It seems wrong. Did you try simple examples? I would compute the difference between the new and last first. Then decide if shorter to go the other way. Also if you simply add 20 to the LAST_TOOL then it could be an invalid number like 35 for the next time.

Please wait until you understand exactly what needs to be performed before trying to code it for KFLOP. Everything needs to be broken down into simple steps any human or machine could do that only involves: setting/clearing bits, reading bits, comparing values, reading/saving current time, and arithmetic. But I would use Linear4ToolHolders Rev 1.c as a basis.

I would configure M6 to load and execute the program in an unused Thread, wait until completed, and then sync since axes might have been moved. It should not need to run continuously.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Rotary tool changer

Post by Mateusz » Thu Jun 13, 2019 10:29 pm

Tom,

I'll get back to this topic in few days, I'm running out my time. Once I'll collect all information and fix the charts, I will present them to you.

Thanks

Post Reply