Notifications
Clear all

Stop Motor Smoothly

12 Posts
1 Users
0 Likes
2,951 Views
(@vik748)
Posts: 0
New Member Guest
 

Hi,
We are using a class 5 smart motor to drive a propellor on Autonomous Underwater Vehicles. I am communicating with the motor in Python via the serial port. I want my code to have a timeout such that when it doesn't receive and command velocities, it should tell the motor to decelerate to a stop and then freewheel. Ideally, I would like to be able to send the same command repeatedly while timed out.
I have tried many of the following in different combinations but have been unable to get the desired behavior.
a. MV ADT=100 VT=0 GrOFFrBRKRLSr : This makes the motor stop abruptly instead of decelerating slowly
b. DT=100 X WAIT=4000 OFF BRKRLSr : This make the motor decelerate to stop, but it doesn't free-wheel after stopping
c. DT=100 X TWAIT OFF BRKRLSr : This make the motor stop abruptly

 
Posted : 13/06/2019 10:53 am
(@mmeyer)
Posts: 0
New Member Guest
 

Hello,

"X" is the command to use if you desire a deceleration to a stop. The deceleration is defined by ADT or DT, but may appear as an abrupt stop depending on that value. I would not recommend using option a, as that immediately switches to a 0 velocity trajectory. I would guess that option b does not seem to be free wheeling because after stopping, it is programmed to wait 4 seconds before free wheeling. You can test if this is true. I recommend using BRKRLS OFF and making sure the motor is not in a fault state when you notice that it is not free wheeling.

 
Posted : 13/06/2019 11:33 am
(@vik748)
Posts: 0
New Member Guest
 

@mmeyer, lets say I am working with option b: DT=100 X WAIT=4000 OFF BRKRLSr
Lets say the motor is moving at 2000rpm, What would happen if I send the same message every 100milli secs?

 
Posted : 13/06/2019 11:38 am
(@mmeyer)
Posts: 0
New Member Guest
 

It would never reach the commands which tell it to release. If the motor was moving when it first received the command, I would guess that it comes to a stop and then holds that position actively. So you wouldn't be able to freewheel.

 
Posted : 13/06/2019 11:41 am
(@vik748)
Posts: 0
New Member Guest
 

Sounds like the wait in there would be problem some.
Is there any command you can think of which I can send at 10Hz continuously which would:
1. If motor is moving, start decelerating
2. If motor is decelerating continue decelerating
3. If stopped, release do a brake release.

 
Posted : 13/06/2019 11:48 am
(@mmeyer)
Posts: 0
New Member Guest
 

"X" would accomplish the first 2, and you may be able to enact what you wish with a simple "X OFF" as your 100ms interval repeated command, provided your motor does not have a hardware brake. Even just "OFF" would be sufficient if you're satisfied with that stopping speed.

 
Posted : 13/06/2019 12:03 pm
(@vik748)
Posts: 0
New Member Guest
 

We were using just OFF before, this whole issue came up because we want to do a controlled stop and free wheel when stopped.

 
Posted : 13/06/2019 12:14 pm
(@mmeyer)
Posts: 0
New Member Guest
 

X OFF will give you a controlled stop. Does you motor have an integrated brake?

 
Posted : 13/06/2019 12:17 pm
(@vik748)
Posts: 0
New Member Guest
 

We are using a SM17205D, I don't believe we have the optional brake on there.
When I do 'X OFF', the motor stops immediately without following the deceleration limit.

 
Posted : 13/06/2019 12:32 pm
(@mmeyer)
Posts: 0
New Member Guest
 

Removed

 
Posted : 13/06/2019 12:35 pm
(@mmeyer)
Posts: 0
New Member Guest
 

Allow me to clarify...

Since you are sending these commands individually, rather than programming them into the motor, TWAIT (as in option c) will not work. Instead, the motor bypasses this and goes straight to OFF, which is why you get a sudden stop. However, in option b, as I had previously mentioned, the wait command is too long and with repeated sending of commands, the OFF & BRKRLS are never enacted. It would probably be better to include a subroutine within the motor itself, and repeated call that subroutine. Something like:

C1
X TWAIT BRKRLS OFF
RETURN

where you continually issue a "GOSUB1" should get you the desired results. Otherwise, you would have to time the WAIT value to be the time of your acceleration, which I'm guessing is non-constant.

 
Posted : 13/06/2019 12:49 pm
(@vik748)
Posts: 0
New Member Guest
 

This might work, I'll give this a shot.

Thanks for your help.

 
Posted : 13/06/2019 12:55 pm
Share: