Issues w/ 4EncoderMotor
-
Hello,
I am struggling to get the 4EncodorMotor running. I'm working w/ UiFlow2. I'm pasting screenshots + Python snippets below:
1/ In normal mode, the motor speed is low fluctuates a lot. It accelerates. Then decelerates. Then decelerates more, etc. The pattern seems random to me.
encoder4_motor_0 = Encoder4MotorModule(address=0x24) encoder4_motor_0.set_all_motors_mode(0x00) encoder4_motor_0.set_motor_pwm_dutycycle(0x01, 50)
2/ For speed mode. For a value of 50, the motor turns smooth. If I increase it, nothing happens. If I decrease it, it does the pattern: stopped; then shock/move a bit; then stop again; then shock again; etc.
i = 50 encoder4_motor_0 = Encoder4MotorModule(address=0x24) encoder4_motor_0.set_all_motors_mode(0x02) encoder4_motor_0.set_speed_point_value(0x01, i)
Initially I connected only the motor pins; I thought that maybe it (either the firmware or the lib) has a "adjust after feedback" algorithm. And because the lack of the feedback => malfunction. Actually seeing that the "speed" and "position" mode have functions to control PID - in these cases feedback is mandatory.
But then I connected the encoder, and I see the same behavior. The encoder works correctly; tested with:print(encoder4_motor_0.get_motor_encoder_value(0x01))
It updates correctly both when I turn by hand, and when the motor turns (badly, cf. above).
I mention that I have a worm gear motor like this:
I tested it w/ the lab PSU, suplying variable voltage. It runs smooth. So I exclude a malfunction of the motor.
Any hints?
Thanks!