Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d94341e1c0 | |||
| df7a15eeb2 | |||
| 5165923595 |
+10
-4
@@ -532,9 +532,9 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
|
||||
|
||||
} else {
|
||||
|
||||
// If we wait for a handshake, but the motor was moving in its last poll
|
||||
// cycle and has reached its target, it is not moving. Otherwise it is
|
||||
// considered moving, even if we're still waiting for the handshake.
|
||||
// If the motor hasn't moved after being enabled, we cannot trust
|
||||
// targetReached. Hence, the targetReachedUninitialized flag guards
|
||||
// against invalid detection of the "moving" status.
|
||||
if (pMasterMacsA_->targetReachedUninitialized) {
|
||||
*moving = false;
|
||||
} else {
|
||||
@@ -545,7 +545,13 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
|
||||
}
|
||||
}
|
||||
|
||||
if (targetReached()) {
|
||||
// If the motor is not switched on, the targetReached bit is set to
|
||||
// true. targetReachedUninitialized is set to true in the enable
|
||||
// function, which is in a separate thread than doPoll. Therefore,
|
||||
// doPoll can reset targetReachedUninitialized, which then can lead to
|
||||
// a false "moving" status. Therefore, we only trust targetReached if
|
||||
// the motor is switched on.
|
||||
if (targetReached() && switchedOn()) {
|
||||
pMasterMacsA_->targetReachedUninitialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ the next value can be typed in. Type 'quit' to close the prompt.
|
||||
if __name__ == "__main__":
|
||||
from sys import argv
|
||||
|
||||
if "-h" or "--help" in argv:
|
||||
if "-h" in argv or "--help" in argv:
|
||||
print(help)
|
||||
|
||||
if len(argv) == 1:
|
||||
|
||||
@@ -18,7 +18,7 @@ from decodeCommon import interactive, decode, print_decoded
|
||||
interpretation = [
|
||||
("Not ready to be switched on", "Ready to be switched on"), # Bit 0
|
||||
("Not switched on", "Switched on"), # Bit 1
|
||||
("Disabled", "Enabled"), # Bit 2
|
||||
("Operation disabled (no current)", "Operation enabled (current)"), # Bit 2
|
||||
("Ok", "Fault condition set"), # Bit 3
|
||||
("Motor supply voltage absent ", "Motor supply voltage present"), # Bit 4
|
||||
("Motor performs quick stop", "Ok"), # Bit 5
|
||||
@@ -68,7 +68,7 @@ the next value can be typed in. Type 'quit' to close the prompt.
|
||||
if __name__ == "__main__":
|
||||
from sys import argv
|
||||
|
||||
if "-h" or "--help" in argv:
|
||||
if "-h" in argv or "--help" in argv:
|
||||
print(help)
|
||||
|
||||
if len(argv) == 1:
|
||||
|
||||
Reference in New Issue
Block a user