makerbase-mks / MKS-SERVO42C

MKS SERVO42C, an upgraded version of MKS SERVO42B, built-in Field-Oriented control algorithm, position/speed/ torque closed-loop, 4 Half bridge driver with 8 MOSFET, it makes the motor quieter, lower vibration and Lower calorific.
150 stars 34 forks source link

Motor Movement by UART stops on next Command #31

Open dcolcott opened 2 years ago

dcolcott commented 2 years ago

Hi There,

I've been developing a UART Serial driver on ESP32 / C++ for the Servo42C for a robotic project and found if you send a command to move the motor by a number of steps, this is cancelled by the next UART message regardless of if it is completed or not.

Example: Send a UART command to trigger 30 revolutions (200 pulses per rev x 16 uStepping x 30 = 96000 steps) of the motor at 20 RPM which is expected to take 10 seconds. Once the motor starts moving I want to enter a loop to send UART commands to read the encoder value to track the action and trigger a notification that the motor movement is complete and ready to start the next programmed movement.

However, as soon as the SERVO42 receives the proceeding UART command to read the encoder value, the motor stops without completing the full number of requested steps. This makes its it difficult to send a sequence of motor movements one after another. There is also a specific UART Motor Stop command suggesting that other commands should not stop the motor?

Can you provide advice on if this is expected and if so, how to trigger an extended motor movement and monitor or notify its completion via UART?

Thanks.

nikitenkoab commented 2 years ago

Hello, I have the same problem. dcolcott, do you have any solvign inthis case? Thanks.

foetusmachine commented 2 years ago

Same problem.

foetusmachine commented 2 years ago

Hi everyone here. Not sure if you'll get notified of this message, but I'll leave this comment here anyway.

The new manual that was uploaded a couple of weeks ago, now includes the proper command reference. Under the FD command reference, a new status return has been added. I can confirm this does not work with my V1.1 firmware, but the manual actually refers to V1.1.2.

Hoping this will be solved shortly and MKS will actually release the firmware for us to update our drivers. image

xuchengithub commented 1 year ago

Not sure if you'll get notified of this message, but I'll leave this comment here anyway. i have same issue, but i find use command to move motor use speed control,can get encode position ,so i think we maybe should wirite position controller by our server.

alexisrosa commented 1 year ago

I just opened an issue before reading this one with the same problem. As soon as I query for the shaft angle, motion is stopped.