View Full Version : Why are Limit Switches outlawed with PWM, but not CAN?
Can anyone explain the logic of <R55>- J to me?
If CAN-bus functionality is used, limit switch jumpers may be removed from a Jaguar speed controller and a custom limit switch circuit may be substituted (so that the cRIO-FRC may read the status of the limit switches).
I know that when using PWM to control the Victors, the Limit Switche inputs automatically stop the motors in either direction when the a switch is tripped (discovered by accident). This seems like a GREAT safety feature.
But these jaguar -connected switches are only permitted when using CAN.
The rule "looks" like it's permitting the use of limit switches with CAN ONLY to enable the cRIO to read them. Does this mean that when using CAN, the switches don't actually stop the motors automatically?
If they do stop the motors, it seems like permitting their use with PWM would also make sense.
Phil.
dyanoshak
08-02-2011, 10:39
When using Servo PWM or CAN to control a Jaguar, the Limit Switch inputs always stop their corresponding direction when the circuit it open.
It is my understanding* that the reasoning for this rule is that you cannot read the state of the limit switch inputs with the cRIO when using PWM. Not having the ability to know the state of the limit switches could potentially lead to undesired behavior.
When using CAN, the cRIO can request the state of the limit switches so it knows what is going on with a particular Jaguar.
*My understanding does not represent the intent of the GDC. So to get an official answer to this question, you should ask the GDC on the Q&A.
One reason that I haven't asked GDC yet is that I don't think they usually like "why" questions... If they opened the gates for these they would be flooded with questions.
For me... Limit switches have three usefull purposes:
1) To tell you when a motion is complete in autonomous:
2) To stop a heavy handed student from braking something because they couldn't tell what was hapenning on the robot in teleop.
3) They protect the hardware while still developing the software.
Your thoughts make perfect sense for 1), but if all we want to do is prevent accidents on manual motions (like in 2), or during S/W development (like in 3) being able to wire the limit switches directly into the Jaguar even when using PWM provides the best protection.
Since you have verified that the limts do work automatically in both control modes if makes me feel more justified in asking GDC the question.
Thanks
Phil.
When using Servo PWM or CAN to control a Jaguar, the Limit Switch inputs always stop their corresponding direction when the circuit it open.
It is my understanding* that the reasoning for this rule is that you cannot read the state of the limit switch inputs with the cRIO when using PWM. Not having the ability to know the state of the limit switches could potentially lead to undesired behavior.
When using CAN, the cRIO can request the state of the limit switches so it knows what is going on with a particular Jaguar.
*My understanding does not represent the intent of the GDC. So to get an official answer to this question, you should ask the GDC on the Q&A.
Al Skierkiewicz
08-02-2011, 11:11
Phil,
Under CAN the state of the limit switch must be read by the Crio and then a motor command is issued if the FMS is still allowing active motion. The limit switch in PWM mode controls the Jaguar directly, independent of the the Crio, and therefore, will continue to run the motor without interaction with FMS. Motion must stop under control of the FMS for either match play or safety disablement.
Phil,
Under CAN the state of the limit switch must be read by the Crio and then a motor command is issued if the FMS is still allowing active motion. The limit switch in PWM mode controls the Jaguar directly, independent of the the Crio, and therefore, will continue to run the motor without interaction with FMS. Motion must stop under control of the FMS for either match play or safety disablement.
The limit switch in PWM mode controls the Jaguar directly only in the sense that it can override a cRIO command and STOP the motor. The limit switch has authority only to stop the motor. It can't cause a motor to be powered if the cRIO isn't commanding power. If FMS shuts down the cRIO PWM outputs, the motor will stop regardless of the limit switch position.
Al Skierkiewicz
08-02-2011, 11:18
I think that is what I said.
Al,
That doesn't seem right.
When using PWM, the only action of the N/C limit switch is to STOP the currently commanded PWM action if the limit circuit goes open. If the limit circuit is closed, the normal PWM command is in effect. This PWM is still fully under cRIO and FMS control. All the normal watchdog, comms, FMS safety protocols are still in full effect.
We know this because the two Jag jumpers that are normally installed just act as limit switches that never go open.
How can connecting N/C switches to these (which can only STOP the motors) create safety issues?
Phil.
Phil,
Under CAN the state of the limit switch must be read by the Crio and then a motor command is issued if the FMS is still allowing active motion. The limit switch in PWM mode controls the Jaguar directly, independent of the the Crio, and therefore, will continue to run the motor without interaction with FMS. Motion must stop under control of the FMS for either match play or safety disablement.
3) They protect the hardware while still developing the software.
There's no rule preventing you from doing this to protect the hardware during software development. Just make sure you remove it after the software is developed and before showing up for competition.
Al Skierkiewicz
08-02-2011, 11:23
If motors are in motion due to the state of the limit switch(es), then the FMS cannot stop them.
Alan Anderson
08-02-2011, 11:26
If motors are in motion due to the state of the limit switch(es), then the FMS cannot stop them.
I do not believe this to be the case.
If motors are in motion due to the state of the limit switch(es), then the FMS cannot stop them.
I believe this is untrue. Can someone at TI please confirm.
dyanoshak
08-02-2011, 11:41
If motors are in motion due to the state of the limit switch(es), then the FMS cannot stop them.
That's not how it works. When a NC limit switch opens the circuit, the Jaguar shuts off the motor, regardless of the commands being sent to it.
When the limit switch closes the circuit (or the jumpers are in place), the Jaguar responds to commands. When the FMS sends a disable command, the cRIO shuts off the PWM signal going to the Jaguar. The Jaguar needs to see a signal every 100ms or else it shuts off and goes into a no-signal safe state. Therefore, when the cRIO shuts off PWM at the request of the FMS, the Jaguar shuts off within 100ms.
You can think of the same thing happening with CAN, however it is implemented differently.
I hope this clarifies things.
-David
Good Point.
There's no rule preventing you from doing this to protect the hardware during software development. Just make sure you remove it after the software is developed and before showing up for competition.
Al Skierkiewicz
08-02-2011, 11:59
Please remember that this rule was added when Jaguars were first introduced in 2009.
As a beta tester I don't remember having have CAN bus back in 2009, and I'm pretty sure direct connect Limit Switches were outlawed all together in 2010, regardless of the interface used.
So this is a new twist that seems only half baked.
Phil.
Please remember that this rule was added when Jaguars were first introduced in 2009.
Al Skierkiewicz
08-02-2011, 12:22
Phil,
The limit switch rule was in place in 2009 not CAN bus use.
From 2009 Inspection Checklist
Custom Circuits, Sensors and Additional Electronics - cannot be attached to the cRIO’s serial port or Ethernet port 2 (except for the Axis 206 camera), cannot attach to Jaguar CAN or limit switch ports,...
Alan Anderson
08-02-2011, 13:07
Phil,
The limit switch rule was in place in 2009 not CAN bus use.
From 2009 Inspection Checklist
Custom Circuits, Sensors and Additional Electronics - cannot be attached to the cRIO’s serial port or Ethernet port 2 (except for the Axis 206 camera), cannot attach to Jaguar CAN or limit switch ports,...
No wonder we're confused by what you're saying. That's not the rule we're talking about here. This year's <R55> J does permit limit switches when using CAN control.
Al Skierkiewicz
08-02-2011, 13:09
I thought that Phil was asking about limit switches when using the PWM inputs in his first post.
Allow me to restate my question now that we have a few more facts.
(I am having our team leader post this on the Q&A... but just let me clarify)
We've established that regardless of the control method you are using with the Jaguars (CAN or PWM), the Limit switch inputs perform the same control function... that is: they stop the motor running a specific direction if that limit switch circuit goes open-circuit.
This in no way compromises any safety/watchdog/loss-of-comms/FCS shutdown action. It actually adds a level of safety.
The only difference between the two interfaces is that CAN ALSO lets the cRIO read the state of the switches, in case it wants to take some other action (since the motor is already shut down)
So my question is: Why can we connect limit switches to the Jaguar if we are using CAN bus, but not if we are using PWM. The automatic limit control action is the same. Please let us use it!!!
Just because CAN can read the inputs, there is no requirment to do so, but having the automated limit switch is a COOL feature to provide a faster response AND it frees up DSC I/Os for other uses (my other reason for wanting this).
Phil.
I currently see no downside - safety or otherwise - in allowing direct limit switch use with the Jaguars in PWM mode. Particularly if they've already been allowed in CAN mode.
Is there something we're missing here?
I'm guessing it's similar reasoning that almost outlawed closed-loop control on the Jaguar entirely. It's not founded in anything technical or safety related.
-Joe
Al Skierkiewicz
09-02-2011, 07:49
We've established that regardless of the control method you are using with the Jaguars (CAN or PWM), the Limit switch inputs perform the same control function... that is: they stop the motor running a specific direction if that limit switch circuit goes open-circuit.
The only difference between the two interfaces is that CAN ALSO lets the cRIO read the state of the switches,
Phil,
I am not a programmer so tender my answer with that. It is my understanding (from inspector training) that in the CAN implementation, the state of the limit must be read, passed on the CAN bus to the Crio which then generates motor command. Under FMS the Crio is controlled and the limit switch based commands are then enabled or inhibited by the FMS command. It is for this (and others) reason that we went through several firmware revisions in that first year. As each revision was released, it was necessary to determine that any and all motion could be stopped by the FMS. If it could not, then another release was generated. The safety of the participants, volunteers and field are still the highest priority in making decisions about the control system.
Please ask the Q&A so everyone can be satisfied.
Alan Anderson
09-02-2011, 08:12
I am not a programmer so tender my answer with that. It is my understanding (from inspector training) that in the CAN implementation, the state of the limit must be read, passed on the CAN bus to the Crio which then generates motor command. Under FMS the Crio is controlled and the limit switch based commands are then enabled or inhibited by the FMS command.
I'm pretty sure your understanding is faulty. From everything I have seen in action and read in the available documentation, the limit switch action is entirely independent of any commands to the Jaguar, either by CAN or PWM, whether FMS is involved or not.
dyanoshak
09-02-2011, 09:39
Phil,
I am not a programmer so tender my answer with that. It is my understanding (from inspector training) that in the CAN implementation, the state of the limit must be read, passed on the CAN bus to the Crio which then generates motor command. Under FMS the Crio is controlled and the limit switch based commands are then enabled or inhibited by the FMS command.
The limit switch functionality is independent of commands; there is no way to override the limit switches in software.
There is a "Soft Limit" feature that uses the encoder or potentiometer to read the position, and stops the motors at a user defined position. However, motor movement will still be stopped by the hardware limit switch opening the circuit, even if it hasn't reached the soft limit yet.
When using CAN, it is entirely up to the user to read the limit switch states from the Jaguar. The cRIO does not issue motor commands based on the limit switch states. The cRIO issues standard commands and the Jaguar follows them to the best of its ability. If the cRIO is telling the Jaguar "move forward!" it will try to. If, however, the forward limit switch input is open-circuit, the Jaguar will not move forward, despite the cRIO continuing to send a forward command.
It is for this (and others) reason that we went through several firmware revisions in that first year. As each revision was released, it was necessary to determine that any and all motion could be stopped by the FMS. If it could not, then another release was generated.
The multiple Jaguar firmware updates last year were to fix bugs (a power-up bug, PID bugs, etc.), none of which had to do with the limit switches or the FMS. Actually, the FMS doesn't ever talk to a Jaguar; it tells the cRIO "Disable!", the cRIO stops sending motor commands, and the Jaguar times out.
-David
Phil,
Please ask the Q&A so everyone can be satisfied.
I have posted the question.
Whether everyone will be satisfied is a completely different issue :)
If nothing else, it will be interesting to hear the reasoning behind this rule.
Phil.
Al Skierkiewicz
09-02-2011, 14:20
David,
I was speaking of the updates in 2009 when this control system was first introduced.
Joe Ross
09-02-2011, 15:53
David,
I was speaking of the updates in 2009 when this control system was first introduced.
There were no jaguar firmware updates in 2009 because no team had the capability of loading them.
Al Skierkiewicz
09-02-2011, 17:55
OK,
There were Crio, driver's station and Lab View updates in 2009, parts of which addressed the inability to turn off Jaguars reliably at the end of a match. Not only was it not possible to update the Jaguar, there was no way to check it since CAN was not legal in 2009 nor was it legal to connect to the CAN bus connector on the Jaguar.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.