PathPilot Lathe with 6 place turret

More
9 years 6 months ago #90784 by brianTruck
Copied a new timing delay into PP rtlib,now timing delay works.

Turret needs to stay on a little longer to get past lock. Here is a video.





Brian

Please Log in to join the conversation.

More
9 years 6 months ago #90791 by andypugh

brianTruck wrote: Copied a new timing delay into PP rtlib,now timing delay works.

Turret needs to stay on a little longer to get past lock


would waiting for the index to go false be more reliable than a delay?

Please Log in to join the conversation.

More
9 years 6 months ago #90792 by brianTruck
Yes that would be the best way. I'm also really having a hard time getting the opto sensor's perfectly aligned. So it would be great if it would look for the first transition ,keep track of all transitions and not make a decision on what tool it saw until the last opto goes false.
I'll have to study the oracchanger code to see how to tweak it.


Brian

Please Log in to join the conversation.

More
9 years 6 months ago #90794 by brianTruck
I'm thinking something like this might work.

If (opto1 or opto2 or opto3)
-- if(opto1 = 1 and set1 = 0)
---- set1 =1;
-- if(opto2 =1 and set2 = 0)
---- set2 =1;
-- if(opto3 = 1 and set3 = 0)
--- set3 =1;
else
---- Break;

#decode set 1,2,3 to see what tool

I had to add minus lines to hold "if" hierarchy.

Brian

Please Log in to join the conversation.

More
9 years 6 months ago #90799 by andypugh
Generally this sort of thing would be done as a state machine:
Code:
switch (state){ case 0: Waiting for action if (toolchange) { motor=forwards state = 1 case 1: Waiting for the right tool if (tool inputs == toolnumber && index){ state = 2 case 2: Waiting for overshoot if (index == 0){ state = 3 timer = 300000 motor = reverse case 3: Fixed-time reverse if (timer -= fperiod < 0){ tool_changed = TRUE motor = stopped state = 0

Please Log in to join the conversation.

More
9 years 6 months ago #90837 by brianTruck
Andy,
The oracchanger changer code I'm using is written as a state machine. I just need a little code to compensate for the slight variation in opto timing. Honestly It probably exists in all gray scale tool changers to some degree. The testing I've done tells me that after seeing the first opto that a half of rotation of the stepper will result in all of the opto's being inline.

Brian

Please Log in to join the conversation.

More
9 years 6 months ago #90838 by andypugh

brianTruck wrote: Andy,
The oracchanger changer code I'm using is written as a state machine.


I thought it probably was, but was too lazy to check.

You should probably add your refinements as extra states rather than as conditions within states. It's easier to analyse when you can see the state in Halscope,

Please Log in to join the conversation.

More
9 years 6 months ago #91221 by brianTruck
I've tried customizing the oracchanger code to look for opto disc and not to make a tool decision until the opto was clear. This is about the 50th version and the turret quits turning as soon as it gets into the look at opto's while loop.

Brian

Attachment not found

Please Log in to join the conversation.

More
9 years 6 months ago #91228 by andypugh
I would expect _everything_ to quit in the while loop.

You can't do a wait-loop in a realtime component. If the wait it longer than 1mS then the entire servo thread will come to a halt.

You need to enter a specific state of the state-machine that checks the condition and then runs to completion either setting a new state or not doing so.

Please Log in to join the conversation.

More
9 years 6 months ago #91241 by brianTruck
Andy,
I have tried this code ,but it never see's the tool and the turret keeps turning. I know that PathPilot is reading the opto's because I "wired" them to the spindle encoder leds on the status screen. I can watch the leds change as each tools passes by. They are normally on and shut off when opening in disk passes by.


Attachment not found



Thanks'
Brian

Please Log in to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum