Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Limit Switches
#1
Hi there,

After a careful RTFM, it's still not clear for me.

Question1: is miniE capable of differentiating "Near Switch" from "Far Switch" ?

Question2: if above answer is YES, is miniE capable of driving the dolly back and forth in a loop? That is, instead of stopping the motor, to reverse it's direction. It would be cool because you can leave the rig running and take travel time-lapses till the card is full.


My current setup does not differentiate between the switches. They are connected in serial configuration, as if it were only one switch. I'm wondering how miniE will react to this.



all the best
Alex
Reply
#2
Hello Alex,

(04-21-2013, 12:44 AM)alexella Wrote: Question1: is miniE capable of differentiating "Near Switch" from "Far Switch" ?

No, this capability is not implemented. The limit switches are in (in the current version) designed to protect the system and nothing more. So the system just stops if one or both of the switches are triggered.

(04-21-2013, 12:44 AM)alexella Wrote: Question2: if above answer is YES, is miniE capable of driving the dolly back and forth in a loop? That is, instead of stopping the motor, to reverse it's direction. It would be cool because you can leave the rig running and take travel time-lapses till the card is full. My current setup does not differentiate between the switches. They are connected in serial configuration, as if it were only one switch. I'm wondering how miniE will react to this.

The next version will support keyframes, which I think is a better way to set-up such a loop-move of the dolly. This way one can implement a little bit more intelligence into the set-up.

Best regards,
Airic
Reply
#3
Aha, so from electrical point of view, there's no need (currently) to have two separate ports for the limit switches. They can just be connected in paralel.
Indeed, it meets future requirements :-)


Yet, I have (another) problem to tackle: I noticed that at below 2000 steps, the dolly does stop at the limit switch but the reverse si to small to "reset" the switch hence the rig is "frozen". The only solution is to force the dolly just a little so that the Limit Switch breaks off and then the dolly can move.

Workaround1 (red-neck style): add another "kill switch" to the whole setup so that Limit Switches can be ignored even if they are "on".

Workaround2: software solution. Make the motor reverse a specific number of steps regarding the current steps setup.

Probably, while digging, I'll start with Workaround1 :-)

all the best
Alex
Reply
#4
...but solution 2 should be easier and faster to be implemented. I should be basically a one- or two-liner. I'll look into the code later and post a solution.

Airic
Reply
#5
Hello,

I am wondering why your system freezes when the limit switches are triggered. In my code there is the functionality which moves the motor backwards exactly one cycle when a limit switch is triggered.

The function limit_switch_event() in the file mE_code should look like this for the functionality you want:

Code:
// =============================================
void limit_switch_event() {
  
  // ...stop the program
  stop_program();    
        
  // print a message! ("A limit switch was triggered!" 3 sec)
  print_message(93, 94, 3);
  
  // move back just a little bit (one cycle distance)
  // first flip the direction bit:
  motor_status = motor_status ^ bit(3);
  // then prepare the motor values
  prepare_motor_values();
  // ...and finally move the motor
  doMotorPhase(false);
  
}
Reply
#6
Hello Airic

Thanks for the reply.

First of all, I have FW version 1.1.
The code inside looks a little bit different than the one you showed in the previous message.

Code:
void limit_switch_event() {
  
  // ...stop the program
  stop_program();    
        
  // print a message! ("A limit switch was triggered!" 3 sec)
  print_message(93, 94, 3);
  
  // move back one cycle distance!
  // therefore turn around the direction
  if (motor_status & B00001000) {
    bitClear(motor_status, 3);  
  } else {
    motor_status |= B00001000;
  }
  
  // prepare
    prepare_motor_values();
  // move
    doMotorPhase(false);

  
}


Second, I've just reloaded your original firmware + my delay(200) change in the focusing section that should have nothing to do with the motor part.

I've done also a small movie for clarifications.
My conclusion is: at Limit Switch on, the (atleast mine) stepper motor reverses not with one cycle but with the number of steps from the current program. Hence, if the number of steps is big enough, it will be able to deactivate the limit switch after reversal. If the number of steps is small, it will reverse but at the Limit Switch test they will be still closed so it will switch again then it will stop.

Possible Solution: make reversal a fixed number of steps and not one cycle. (cycle = number of steps of the current setting)

Or...I don't know what else to think about....



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)