>>>Pi Wars 2020<<<
1OrangeBot Motor Swap
By design, OrangeBot was meant to be powered by four DC motors and have a top speed of 20 [Km/h]. Supply shortages meant that the only motors available were capable of either 10 [Km/h] or 30 [Km/h].30 [Km/h] motors were ordered and installed, but during the design stage, the torque needed to turn with a four wheeled platform was not accounted for. This caused two severe problems:
- Torque was insufficient to turn
- Motor gain was too high
1.1Torque
In order to turn a platform with four fixed wheels, a torque is required to make the wheels slide on the terrain sideways. It was impossible to solve this issue even with overvolting the 12 [V] DC motors, and it was impossible to source new slower stronger motors in time for the competition. The scope for the platform was reduced, and OrangeBot is now equipped with two DC Motors and one pivot wheel.While this allows OrangeBot to turn, the torque was further halved, impeding acceleration and climbing performance.
1.2Motor Gain
The motor had too much gain in terms of [mm/s/V]. PWM controls were unusable, and the PID controller had an impossible job.Encoders were upgraded from low count magnetic to high count optical, giving the PID a better chance. After months of work, a two loop PID controller with integral speed reference running at 2 [KHz] and consuming all available computational power on the microcontroller was finally able to suppress ringing and instability and achieve a controllable platform even under the effect of the large inertia.
The motors were highly stressed by continuous fine motion inversion, but the performance were Pi-Wars grade.
2Motor Swap
With additional time, it became possible to just source motors better tuned to the task.
Illustration 1 - Motor Stats
Original
MotorsThe original motors have a speed gain of 613.9 [mm/s/V], a force gain of 14.04 [g/A] and an encoder scale of 15.79 [cnt/mm] thanks to the high resolution replacement quadrature optical encoders.
Replacement Motors
The replacement motors have a gain of 185 [mm/s/V], a force gain of 28.18 [g/A] and an encoder scale of 0.9639 [cnt/mm].
Note that with the original motors, the torque is low enough that the drag significantly affect top speed. With a drag of 0.001, top speed is about 32 [Km/h]; With a drag of 0.02 top speed lowers to 15 [Km/h].
2.1Uninstall Motors
Uninstall old motors:- Remove wheels by unscrewing them from the Hub
- Remove Hub
- Disconnect the power and the encoder wiring from the Main
Motor Board
- Unscrew the motor from the motor bracket
Illustration 2 - Uninstall Motors
2.2Uninstall Motor Brackets
The replacement motors are longer. Motor Brackets have to be uninstalled and new holes have to be made to fix them to the structure.
Illustration 3 - Interaxis
Interaxis with the original motors was 190 [mm].The interaxis with the replacement motors is still compatible with Pi-Wars specifications, but is getting dangerously close to the 225 [mm] limit.
2.3Re-Install Motor Brackets
New holes are made for the M3 bolts that hold the motor brackets in place.
Illustration 4 - Re-install motor brackets
Due to overlap between old and new holes, the interaxis is not
optimal, and could be reduced from 220 [mm] to 210 [mm]. Doing so
would require redoing the Base Plate upon which the platform is built
upon.A task for the future might be to cut new plates using a laser plotter, but for now focus is on achieving the target performance. Optimization of workable if sub-optimal features will be left for later.
2.4Install Replacement Motors
Installing the motor is straightforward. The power wiring of the motors were replaced with higher gauge prior the installation, the encoder wirings was cut to size in this step.
Illustration 5 - Install Replacement Motors
2.5Solder connectors
Power wirings are soldered with a tip. Encoder wirings are soldered with an L 2.54 [mm] pin strip.Main Motor Board
Illustration 6 - Solder motor and encoder
connectors
2.6Assembly
Assembly the hubs, wheels and the platform back together.
Illustration 7- OrangeBot Undercarriage
3Testing and Calibration
3.1Power Test
The platform powers up without problems
Illustration 8- OrangeBot Powered
3.2PWM Remote Control Test
Test PWM controls. Thanks to the reduced speed and increased torque, OrangeBot now controls just fine in PWM mode, with the only drawback of not going in a straight line.
Video 1- OrangeBot PWM Remote Controls
3.3PID Calibration and PID Remote Control Test
A quick calibration of the PID through the remote controls was enough to get good closed loop performance and have the platform move in a straight line.
Illustration 9- PID Calibration
Video 2- Position PID Calibration
4Conclusions
The replacement motors have more torque and less speed, allowing OrangeBot to be stronger and more precise.There are other design decisions and mistakes made to achieve the deadline of 2020-03-29. With the deadline moved to 2021-03, many of those decisions can be revisited, to achieve an higher quality design.