Skip to content

Commit 650db22

Browse files
committed
Merge branch 'feature/AduinoExamples' into develop
2 parents 9488a5e + 5427e25 commit 650db22

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

libraries/ClearPathModeExamples/ClearPath-MC Series/FollowDigitalVelocity/FollowDigitalVelocity.ino

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,13 @@
2424
* for Follow Digital Velocity Command, Unipolar PWM Command mode (In MSP
2525
* select Mode>>Velocity>>Follow Digital Velocity Command, then with
2626
* "Unipolar PWM Command" selected hit the OK button).
27-
* 3. The ClearPath motor must be set to use the HLFB mode "ASG-Velocity"
28-
* through the MSP software (select Advanced>>High Level Feedback [Mode]...
29-
* then choose "All Systems Go (ASG) - Velocity" from the dropdown and hit
30-
* the OK button).
31-
* 4. The ClearPath must have a defined Max Speed configured through the MSP
27+
* 3. The ClearPath must have a defined Max Speed configured through the MSP
3228
* software (On the main MSP window fill in the "Max Speed (RPM)" box with
3329
* your desired maximum speed). Ensure the value of maxSpeed below matches
3430
* this Max Speed.
35-
* 5. Ensure the "Invert PWM Input" checkbox found on the MSP's main window is
31+
* 4. Ensure the "Invert PWM Input" checkbox found on the MSP's main window is
3632
* unchecked.
37-
* 6. Ensure the Input A filter in MSP is set to 20ms, (In MSP
33+
* 5. Ensure the Input A filter in MSP is set to 20ms, (In MSP
3834
* select Advanced>>Input A, B Filtering... then in the Settings box fill in
3935
* the textbox labeled "Input A Filter Time Constant (msec)" then hit the OK
4036
* button).
@@ -94,9 +90,10 @@ void setup() {
9490
motor.EnableRequest(true);
9591
Serial.println("Motor Enabled");
9692

97-
// Waits for HLFB to assert (waits for homing to complete if applicable)
98-
Serial.println("Waiting for HLFB...");
99-
while (motor.HlfbState() != MotorDriver::HLFB_ASSERTED) {
93+
// Waits for 5 seconds for motor to come up to speed
94+
Serial.println("Waiting for motor to come up to speed...");
95+
startTime = millis();
96+
while (millis() - startTime < timeout) {
10097
continue;
10198
}
10299
Serial.println("Motor Ready");
@@ -170,4 +167,4 @@ bool CommandVelocity(int commandedVelocity) {
170167
Serial.println("Move Done");
171168
return true;
172169
}
173-
//------------------------------------------------------------------------------
170+
//------------------------------------------------------------------------------

libraries/ClearPathModeExamples/ClearPath-MC Series/FollowDigitalVelocityWithVariableTorque/FollowDigitalVelocityWithVariableTorque.ino

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@
2323
* for Follow Digital Velocity Command, Bipolar PWM Command with Variable
2424
* Torque mode (In MSP select Mode>>Velocity>>Follow Digital Velocity
2525
* Command, then with "Bipolar PWM Command w/ Variable Torque")
26-
* 3. The ClearPath motor must be set to use the HLFB mode "ASG-Velocity"
27-
* through the MSP software (select Advanced>>High Level Feedback [Mode]...
28-
* then choose "All Systems Go (ASG) - Velocity" from the dropdown and hit
29-
* the OK button).
30-
* 4. The ClearPath must have a defined Max Speed configured through the MSP
26+
* 3. The ClearPath must have a defined Max Speed configured through the MSP
3127
* software (On the main MSP window fill in the "Max Speed (RPM)" box with
3228
* your desired maximum speed). Ensure the value of maxSpeed below matches
3329
* this Max Speed.
34-
* 5. Set the PWM Deadband in MSP to 2.
35-
* 6. In MSP, ensure the two checkboxes for "Invert Torque PWM Input" and
30+
* 4. Set the PWM Deadband in MSP to 2.
31+
* 5. In MSP, ensure the two checkboxes for "Invert Torque PWM Input" and
3632
* "Invert Speed PWM Input" are unchecked.
37-
* 7. A primary Torque Limit and Alternate Torque Limit must be defined using
33+
* 6. A primary Torque Limit and Alternate Torque Limit must be defined using
3834
* the Torque Limit setup window through the MSP software (To configure,
3935
* click the "Setup..." button found under the "Torque Limit" label. Then
4036
* fill in the textbox labeled "Alt Torque Limit (% of max)" and hit the
@@ -101,9 +97,10 @@ void setup() {
10197
motor.EnableRequest(true);
10298
Serial.println("Motor Enabled");
10399

104-
// Waits for HLFB to assert (waits for homing to complete if applicable)
105-
Serial.println("Waiting for HLFB...");
106-
while (motor.HlfbState() != MotorDriver::HLFB_ASSERTED) {
100+
// Waits for 5 seconds for motor to come up to speed
101+
Serial.println("Waiting for motor to come up to speed...");
102+
startTime = millis();
103+
while (millis() - startTime < timeout) {
107104
continue;
108105
}
109106
Serial.println("Motor Ready");
@@ -219,4 +216,4 @@ bool LimitTorque(double limit) {
219216

220217
return true;
221218
}
222-
//------------------------------------------------------------------------------
219+
//------------------------------------------------------------------------------

0 commit comments

Comments
 (0)