Page 1 of 1

roboclaw python library speed control

Posted: Mon Oct 26, 2020 3:44 pm
by hmahdi
Hello,

I would like to use the built-in PID speed controller. I am using the function:

Code: Select all

SpeedM1M2 #(also tried SpeedM1)
If I feed a value of 0, it's all good; the motors don't move. If I feed it 1 or higher, it goes to max speed!!!!!
I initially thought it was my code but then I tried it in a super simple program and it did the same thing.

I might just implement my own PID and use the encoder feedback/pwm commands but I would love to know if I did something wrong.

Re: roboclaw python library speed control

Posted: Tue Nov 03, 2020 8:40 am
by Basicmicro Support
Before you use velocity or position control you have to tune the motor settings using Motion studio. If it doesnt work in Motion Studio it is not going to work in python.

Re: roboclaw python library speed control

Posted: Mon Nov 09, 2020 2:49 pm
by hmahdi
Thanks for your reply and sorry for my delayed response. I tried to tune it in motionstudio but it crashes as soon as I click on tune. I found git issue where it said I have to make sure the logic battery is at 5, and I did by adding a 5V source but it still crashes.
Is there anyways to fix it?

Re: roboclaw python library speed control

Posted: Tue Nov 17, 2020 6:57 pm
by Basicmicro Support
It crashes if your motor is large enough to cause USB to drop out. In this case you have to fall back to manually tuning or get a better USB cable. One with a ferrite choke or adding a USB isolation adapter will usually help this kind of problem.