News:

  • October 14, 2025, 10:01:39 AM

Login with username, password and session length

Author Topic: Questions about Axis Controls  (Read 4792 times)

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Questions about Axis Controls
« on: October 09, 2017, 04:02:31 PM »
So, I'm revising my project trying to make it a little more streamlined. My question is about homing. So I have Stage 0 set to take care of all the homing of the two axis I have. So on FirstScan, it does the setup of the axis. Then, it proceeds to S0, where it uses the success bits of the average to look at the current position of the axis. If the home prox is made up, it will zero the position value of the axis, and then proceed to the next stage, which sets an offset between the axis, and then moves the system into the last stage, where it's in RUN. If on that pulse from the setups completing, the home position prox is not made up, it will start the home axis command. Once the axis have homed, they proceed to the offset stage, and then to the run stage when that is complete. My question is, by doing this all at once, will the "AlreadyHome" bits trigger the AXHOME on the very first scan, or am I overthinking this?


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Questions about Axis Controls
« Reply #1 on: October 09, 2017, 04:37:21 PM »
Not sure I'd do it this way. I think I would create a program block for each axis...PrepCarriage and PrepStacker...that would sequence through everything required to get things ready on that axis. Stage 0 would do the AXCONFIG, Stage 1 AXSETPROP, Stage 2 AXHOME, etc, and I would use the axis instruction's internal stage sequencing to move from stage to stage. By doing it this way, you really can't mess anything up. From the supervisor level code just RUN PrepXXX and wait until PrepXXX.Done is true before moving on. You should be fine to run both at the same time.

I'm certain it is possible to make work with less, but in my experience this is the stuff that creates frustrations when it works 9 times out of 10 and the machine just seems flaky. By spelling it out the way I described you eliminate some of that.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Questions about Axis Controls
« Reply #2 on: October 09, 2017, 05:21:11 PM »
Not sure I'd do it this way. I think I would create a program block for each axis...PrepCarriage and PrepStacker...that would sequence through everything required to get things ready on that axis. Stage 0 would do the AXCONFIG, Stage 1 AXSETPROP, Stage 2 AXHOME, etc, and I would use the axis instruction's internal stage sequencing to move from stage to stage. By doing it this way, you really can't mess anything up. From the supervisor level code just RUN PrepXXX and wait until PrepXXX.Done is true before moving on. You should be fine to run both at the same time.

I'm certain it is possible to make work with less, but in my experience this is the stuff that creates frustrations when it works 9 times out of 10 and the machine just seems flaky. By spelling it out the way I described you eliminate some of that.

Yeah, I was looking at stages, but I couldn't do both in a single stage, and I just wasn't thinking about doing them in separate code blocks. That's why you're the brains of the outfit.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Questions about Axis Controls
« Reply #3 on: October 09, 2017, 05:44:44 PM »
Nah, not so smart. Just bumped my shins enough that I stick to doing things a way that I'm sure will work.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Questions about Axis Controls
« Reply #4 on: October 09, 2017, 05:46:27 PM »
Nah, not so smart. Just bumped my shins enough that I stick to doing things a way that I'm sure will work.

Ok, just one question, does the Program.Done bit go active every time the program completes, or only once the final stage goes active? Like, if I have 4 stages, Program.Done will only become true when Program.S4 is true?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Questions about Axis Controls
« Reply #5 on: October 09, 2017, 06:02:23 PM »
.Done will be false immediately following RUN, and will become true after the program block is finished. It stays true until RUN again. Program blocks finish by calling EXIT or HALT. I generally jump to a final stage and call EXIT there.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Questions about Axis Controls
« Reply #6 on: October 09, 2017, 06:05:13 PM »
.Done will be false immediately following RUN, and will become true after the program block is finished. It stays true until RUN again. Program blocks finish by calling EXIT or HALT. I generally jump to a final stage and call EXIT there.
Ok, I was just a little fuzzy on what "finished" meant.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Questions about Axis Controls
« Reply #7 on: October 10, 2017, 04:58:26 PM »
Thanks again, BobO. I finished up the program, and it makes things so much cleaner. Works like a charm. Now just to fire the machine up and find out what the operators can break that I didn't think of.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Questions about Axis Controls
« Reply #8 on: October 10, 2017, 07:20:38 PM »
Thanks again, BobO. I finished up the program, and it makes things so much cleaner. Works like a charm. Now just to fire the machine up and find out what the operators can break that I didn't think of.

Glad to hear it! Love to hear that stuff!
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

jetskiracer

  • Newbie
  • *
  • Posts: 3
Re: Questions about Axis Controls
« Reply #9 on: October 12, 2017, 11:06:10 AM »
Could you post your finished program? I am setting up a 2 drive system and would be very interested how your program changed. Thanks.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Questions about Axis Controls
« Reply #10 on: October 13, 2017, 12:26:24 PM »
Here is my program.

In the Main Program, it sets a bunch of things to 0 at the start. It starts the Program for the adjustable offset between the axis. Then it goes to Stage 0. This calls two programs. These are for each axis. The Programs Configure the axis, then it checks to see if the axis is already in the home position. If the axis is home, it sets the current position to 0 and proceeds to exit. If not, it jogs the axis to the home position and moves to the next portion.

There is a little difference in travel between my two axis. The Carriage has a lot more travel (before hitting physical stops) than the Stacker does. I set the prox switches on the physical limits. After going home, the Carriage needs to move in order to align itself with the Stacker. This moves a number of pulses to get aligned. Then the program exits. When the programs both complete, the Main program moves to $Main.S1, where the "RUN" portion of the program is located. This looks at an analog ultrasonic sensor (looking at very clear thin film, often as thin as .00001"). It takes that input, and guides with the film as it moves. It compares the output to the setpoint, and then runs both axis together to keep the carriage and stacker aligned with the edge of the film. If the machine is ever estopped, it jumps back to $Main.S0 which will realign the axis before allowing it to run.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Questions about Axis Controls
« Reply #11 on: October 13, 2017, 12:47:05 PM »
What you're doing is $Main:S0 is great. Perfect way to do that. You can use this technique to build layers upon layers of asynchronous programs and it works beautifully. You can also do the same thing with ENTASK on one shot task blocks, which is a great for multiscan operations (loops, sorts, etc).
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO