- Forum
- Roboteq Motor Controllers
- Controller Configuration & Operation
- How to clear Motor Command after Closed Loop Position Mode reaches target
How to clear Motor Command after Closed Loop Position Mode reaches target
2 years 10 months ago - 2 years 10 months ago #29535258
by PDP
Hi Folks;
I have an SBLM2360T and am exploring how I can switch Control Modes from Open to Closed Loop Speed, back to Open, etc. I am starting with Open Loop -> Closed Loop Position -> Open Loop.
I've noticed that when issuing a series of commands like the following that the motor "hiccups"
!ROM 1 0 ' Set Channel 1 to Open Loop Mode
!CB 1 0 ' Set Brushless Counter to 0`
!ROM 1 1 ' Set Channel 1 to Closed Loop Position Mode (from DS402 documentation)
!P 1 1500 ' Tell Channel 1 to move to position 1500
?M 1 ' Read the motor command. Note: it is 1500
?CB 1 ' After arriving at Position, check the brushless counter. Note: it is typically 1506 or slo
!CB 1 0 ' Reset the Brushless Counter to 0. Note: this causes the motor to "hiccup"
!P 1 0 ' Now that the counter has been reset, tell the motor to go to that position. After this, the Motor Command is 0
!ROM 1 0 ' Set the motor back into Open Loop Mode. Note: This will sometimes cause the motor to spin to full acceleration, or jump
An example of this is here: youtu.be/o_1dPyuASV4
As an interesting note; if one does not set the Brushless Counter to 0 and the Position to 0, the motor command remains 1500. Then when one sets the control mode to "Open Loop", the motor drives right up to 150% (which it can't, so it's at 100%)
An example of that is here: youtu.be/n_FIE61NaxI
I charted some of this behavior in the attached Chart Log.
I feel that I'm missing something fundamental. The MCU is able to go to an absolute position and then a series of relative positions. When it arrives at the target position and "DR" (Destination Reached) flag is 1 (true), there is continued power to the motor as if the Loop Error correction is still active. I would like to be able to stop the motor and put it into an electronic brake at that point. Furthermore, and I'm testing some beta firmware, I would like to run as speed for a while and then switch to position mode for more accurate positioning.
I am feeling that that I am not fully understanding the organizing principles behind the MCU's different control modes and would greatly, greatly appreciate some pointers.
Thanks so very much,
pdp
I have an SBLM2360T and am exploring how I can switch Control Modes from Open to Closed Loop Speed, back to Open, etc. I am starting with Open Loop -> Closed Loop Position -> Open Loop.
I've noticed that when issuing a series of commands like the following that the motor "hiccups"
!ROM 1 0 ' Set Channel 1 to Open Loop Mode
!CB 1 0 ' Set Brushless Counter to 0`
!ROM 1 1 ' Set Channel 1 to Closed Loop Position Mode (from DS402 documentation)
!P 1 1500 ' Tell Channel 1 to move to position 1500
?M 1 ' Read the motor command. Note: it is 1500
?CB 1 ' After arriving at Position, check the brushless counter. Note: it is typically 1506 or slo
!CB 1 0 ' Reset the Brushless Counter to 0. Note: this causes the motor to "hiccup"
!P 1 0 ' Now that the counter has been reset, tell the motor to go to that position. After this, the Motor Command is 0
!ROM 1 0 ' Set the motor back into Open Loop Mode. Note: This will sometimes cause the motor to spin to full acceleration, or jump
An example of this is here: youtu.be/o_1dPyuASV4
As an interesting note; if one does not set the Brushless Counter to 0 and the Position to 0, the motor command remains 1500. Then when one sets the control mode to "Open Loop", the motor drives right up to 150% (which it can't, so it's at 100%)
An example of that is here: youtu.be/n_FIE61NaxI
I charted some of this behavior in the attached Chart Log.
I feel that I'm missing something fundamental. The MCU is able to go to an absolute position and then a series of relative positions. When it arrives at the target position and "DR" (Destination Reached) flag is 1 (true), there is continued power to the motor as if the Loop Error correction is still active. I would like to be able to stop the motor and put it into an electronic brake at that point. Furthermore, and I'm testing some beta firmware, I would like to run as speed for a while and then switch to position mode for more accurate positioning.
I am feeling that that I am not fully understanding the organizing principles behind the MCU's different control modes and would greatly, greatly appreciate some pointers.
Thanks so very much,
pdp
Attachments:
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 49
- Thank you received: 4
2 years 10 months ago #29535264
by Athanasios
Replied by Athanasios on topic How to clear Motor Command after Closed Loop Position Mode reaches target
Hi pdp
what is the beta firmware you are using? which date?
"As an interesting note; if one does not set the Brushless Counter to 0 and the Position to 0, the motor command remains 1500. Then when one sets the control mode to "Open Loop", the motor drives right up to 150% (which it can't, so it's at 100%)"
yes this is the way it is implemented.
"When it arrives at the target position and "DR" (Destination Reached) flag is 1 (true), there is continued power to the motor as if the Loop Error correction is still active."
Yes there is always a small error to correct. when the target is reached then the controller tries to keep this position.
You can apply emergency stop if you want to float the FETs
what is the beta firmware you are using? which date?
"As an interesting note; if one does not set the Brushless Counter to 0 and the Position to 0, the motor command remains 1500. Then when one sets the control mode to "Open Loop", the motor drives right up to 150% (which it can't, so it's at 100%)"
yes this is the way it is implemented.
"When it arrives at the target position and "DR" (Destination Reached) flag is 1 (true), there is continued power to the motor as if the Loop Error correction is still active."
Yes there is always a small error to correct. when the target is reached then the controller tries to keep this position.
You can apply emergency stop if you want to float the FETs
Please Log in or Create an account to join the conversation.
2 years 10 months ago #29535266
by PDP
Replied by PDP on topic How to clear Motor Command after Closed Loop Position Mode reaches target
Hi Athanasios;
This is with v2.01 11/14/2019. I was working on getting a baseline on one of the controllers while working with the beta firmware on another.
Is there an assumed sequence or usage pattern that I am missing? Is the usage pattern of switching between Closed Loop Mode -- Closed Loop Speed Mode to Closed Loop Count Position Mode -- a supported pattern? Or is the intent to stay in a mode, say Closed Loop Count Position Mode, for the duration of operation until one has reached a "home" position where the motor command resolves to 0?
"Yes there is always a small error to correct. when the target is reached then the controller tries to keep this position.You can apply emergency stop if you want to float the FETs"
This make sense, which is why it seemed reasonable to use Closed Loop Count Position mode to go to a position target and then reset to Open Loop Mode; to keep the battery from draining.
This led me to try a series of Position commands: In Closed Loop Count Position mode, go to count 1500, then 2500, then 5000. After each position was reached, the Motor Command was the last position command: 1500, 2500, 5000, respectively. Switching to Open Loop Mode at this point would drive the motor to 500%, which is not desirable since the motor is "at the desired position". I tried applying emergency stop and then turning that off (using the feature in Roborun+). This does not clear the Motor Command.
I am assuming there is an expected use case for these Closed Loop modes that I am not understanding. Is there documentation or reference implementation to which I can refer?
Thanks again for your time and assistance,
pdp
This is with v2.01 11/14/2019. I was working on getting a baseline on one of the controllers while working with the beta firmware on another.
Is there an assumed sequence or usage pattern that I am missing? Is the usage pattern of switching between Closed Loop Mode -- Closed Loop Speed Mode to Closed Loop Count Position Mode -- a supported pattern? Or is the intent to stay in a mode, say Closed Loop Count Position Mode, for the duration of operation until one has reached a "home" position where the motor command resolves to 0?
"Yes there is always a small error to correct. when the target is reached then the controller tries to keep this position.You can apply emergency stop if you want to float the FETs"
This make sense, which is why it seemed reasonable to use Closed Loop Count Position mode to go to a position target and then reset to Open Loop Mode; to keep the battery from draining.
This led me to try a series of Position commands: In Closed Loop Count Position mode, go to count 1500, then 2500, then 5000. After each position was reached, the Motor Command was the last position command: 1500, 2500, 5000, respectively. Switching to Open Loop Mode at this point would drive the motor to 500%, which is not desirable since the motor is "at the desired position". I tried applying emergency stop and then turning that off (using the feature in Roborun+). This does not clear the Motor Command.
I am assuming there is an expected use case for these Closed Loop modes that I am not understanding. Is there documentation or reference implementation to which I can refer?
Thanks again for your time and assistance,
pdp
Please Log in or Create an account to join the conversation.
Moderators: tonysantoni
- Forum
- Roboteq Motor Controllers
- Controller Configuration & Operation
- How to clear Motor Command after Closed Loop Position Mode reaches target
Time to create page: 0.060 seconds