I was not active in this project for a while, first because it was actually made for the Hack a day prize 2017 and I had not won anything ( -> therefore no more log's) and second because I had problems with the speed:
Actually it's nice if a robot can go fast. But for most tasks and especially for programming new it needs low speeds. Exactly that went very badly. With a lot of finesse, it was possible to adjust the controller so that it just barely started, but once the initial friction was overcome, it quickly built up speed. In addition, the initial friction is very dependent on the ground and thus cannot be fixed with absolute.
I tried different P and PID controllers. The encoder with the magnets and the Hall elements has quite large tolerances around 20%and vary around 5% with speed.
Since these are inherent variations in the system, they can be reduced to less than 10% using a correlation function, but then the tolerances of the 3D printed mechanics become noticeable and cannot be further eliminated:
These large variations, combined with the few pulses (only one pulse every 28mm of travel), mean that in practice no useful results can be achieved with a controller. Thus I lost interest in the 4WD robot platform.
In the Corona time one has (unfortunately) again much more time. In the process, I came across an optical AI sensor and thought that this would be the optimal platform for the sensor, so I tried again - and succeeded.
The ESP-IDF offers MCPWM for the motor control. For the use also with the Arduino IDE there are quite a few examples. Mostly implemented with Joao Lopes ESP32MotorControl library, which I also use. Exactly with this, however, slow driving for robots is prevented. Basically the motor control works with a PWM signal. I.e. at slow speeds one pole of the motor is set to HIGH for a short time and then taken back to LOW, while the other pole is always at LOW. At higher speeds, the duration of the HIGH signal is simply extended accordingly. This creates a freewheel while both poles are at LOW and the robot becomes much too fast. Correct would be to brake the momentum of the motor during the inactive. This is achieved with most H-bridges by setting both poles to HIGH. I changed the ESP32MotorControl library accordingly and can now control the speed from very, very slow to full speed very accurately.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.