pushbuttondesign

View Original

Robotics Platform Project Strategy

Fully autonomous driving may still be a long way off but the technological advancements to date have been really impressive. ABS was the first electronic driving aid added in the 1980s and since then we have seen traction control, electronic differentials, active suspension, drive by wire, lane assist, automatic breaking, and advanced cruze control [1]. I have long been involved in building and racing 1/10th scale remote control cars and I converted all my nitro powered models to electric some years ago, enabled by the same technological advancements in batteries and brushless motors leveraged by full sized electric cars. Unfortunately, the electronic driving aids have not been implemented at scale and the perforance advantages afforded by the new electric power systems have highlighted how badly I drive.

To avoid having to practice, I thought it might be a fun real time control project to implement some of these electronic aids and an excuse to build a robotics platform for future projects I have in mind (virtual reality first person video over long distances would be fun). The first step was to select a hardware platform. All the existing cars I have are based on their full size counterparts with a motor passing power through a transmission, differentials, universal joints to all four wheels, with an ackerman steering layout at the front. Amazon's DeepRacer takes this layout and adds sensors and a computer for exactly this application[2]. However, I wanted something a little different. As you start looking outside the traditional vehicle layouts the options are endless, peristaltic locomotion anyone[3]? To make a decision, I set some constraints, deciding to optimise for robustness and low cost, having broken my existing RC cars plenty of times due to my poor driving and knowing that I could leverage the software to ditch the differentials and ackerman steering. I also wanted to be able to climb over obsticals while carrying a payload at a resionable speed. Translating these objectives into requirments I knew I wanted two motors driving each side of a four wheeled platform to reduce number of parts, particually complex steering linkages, and large, soft tyres would be used instead of suspension. While vehical size would be the biggest factor in obstical clearance, I would limit myself to 1/10 scale and put the biggest wheels possible in each corner to maxamise approach and departure angles, keeping the wheelbase short would maxamise breakover angle. Weight would be kept low to reduce roll, but high enough for good ground clearance and over the wheels to increase traction. This setup was in no small part inspired by the Sherp[4].

Given the lack of mechanical components, the motor was the key component the rest of the platform would be built around. This ended up being an interesting challenge similar to those I often face in my day job when conceptualising new approaches to problems and a good example of how the 'back of the fag packet' calculations can be used to make some strategic decisions fast in the early stages of a new project. The physics of dynamics and the properties of motors are well understood so simulation can be an effective tool for optomisation, but moving to prototyping earlier will highlight which other key strategic elements are important parameter space of what is feasable.

  1. Set the desired top speed and convert to SI liner velocity units.

    15mph / 2.237 = 6.7m/s

  2. Set the desired wheel diameter and calculate radius in meters.

    140mm / 2 / 1000 = 0.07m

  3. Convert liner velocity to angular velocity (radians per second) and express it as RPM by dividing by 2pi.

    ((6.7m/s / 0.07m) / 2 * pi) * 60 = 915rpm

  4. Calculate acceleration from desired top speed by setting desired time to reach the top speed as acceleration is change in velocity divided by change in time.

    6.7m/s / 3s = 2.23m/s^2

  5. Guessing the mass of the final vehicle the force required to achieve that acceleration can then be calculated.

    4kg * 4.46m/s^2 = 8.93N

  6. The above calculation assumes a flat surface with no friction, aerodynamic drag, rolling resistance, inertia force and perfect efficience of all components. For simplicities sake a single factor of 1.5 will be used to account for all of these.

    8.93N * 1.5 = 13.4N

  7. As gearing is being ignored, the torque required to generate that force can be simply calculated for the wheel radius using force * distance. This calculation ignores the fact that torque changes depending on motor speed, heat and other factors but this is enough for an initial estimate.

    13.4N * 0.07m = 0.9Nm

  8. The biggest factor affecting the torque requirement is the gradient of the surface. In this case the force required to hold the vehicle on the ramp can be calculated as gravitational force (mass multiplied by Earth's gravitational constant 9.8m/s^2) multiplied by sin(gradient angle in degrees), it should be noted that in this case this is the force to hold the vehicle in place rather than accelerate and no factor is added so this is an absolute minimum value. The torque required to produce this force was also calculated for this machine based on a 80 degree incline.

    4kg * 9.8m/s^2 * sin(80°) = 38.6N

    38.6N * 0.07m = 2.7Nm

  9. Enough information has now been provided to set a basic values for initial motor selection: >915rpm and >3Nm. Representatives of different types of motors can now be compared, only those with decent datasheets were considered.

    1. Stepper motors provide relatively high torque and cost effective precise control through steps provided by an open-loop drive circuit, but they tend to be slow. RPM may need to be roughly calculated by pulses per second / pulses per rotation (often set by the stepper motor driver). Torque is usually stated but can be multiplied by the number of motors in the vehicle, in this case I am assuming 2 motors (one for each side). This calculation ignores the inductance and other effects. An industrial example from Moon Industries[5] (motor $64 and driver $100 USD) achieved the following with two motors:

      2000rpm

      2.3Nm * 2 = 4.6Nm

    2. DC motors require encoders (in the order of 4000+ pulses per resolution resolution) or other sensors such as hall effect (in the order of 100 pulses per revolution resolution) and more complex close-loop control circuits to drive precisely and their speeds are typically greater than their torque. The shaft speed of these motors is often stated as Kv or rpm per volt and so must be multiplied by maximum intended voltage to get max rpm and torque values are often not given for non-industrial parts. Numbers for a selected industrial DC motor from Moon Industries[6] (motor $200 and driver $270 USD) with 5:1 gearing and two motors are given below.

      4000rpm / 4 = 1000rpm

      0.48Nm * 2 * 4 = 3.84Nm

    3. Servo motors are typically DC motors with encoders and gearboxes built-in to enable precision control and increase torque, though examples based on stepper motors also exist. An example from Moon Industries[7] (motor $150 and driver $250 USD) with 3:1 gearing and two motors is given below.

      3000rpm / 3 = 1000rpm

      0.52Nm * 2 * 3 = 3.12Nm

    4. Smart or intergrated motors are motors with an integrated electronic speed controller often on top of an encoder and gearbox making them very space efficient. As motor and ESC are paired by the manufacturer, the complexities of driving motors are garanteed to be correctly implemented and software control routines offered can be higher level making them easy to use. They can be based on stepper or DC motors, the JVL MIS231S[8] is based on a stepper and provides a space efficient package with the ESC intergrated ($400 USD for motor and driver). It offered a number of simple control optoions including step and direction, IP65 rating, gearboxes options and an encoder with 4096 pulses per revolution. The numbers achieved with a 2:1 gear ratio and two motors were:

      3000rpm / 2 = 1500rpm

      0.97Nm * 2 * 2 = 3.88Nm

It is clear that both DC and stepper motors can meet the requirements with the aid of only small ratio gearing. The stepper motor options are considerably cheaper than high torque, high precision DC systems due to their simplicity. Torque per dollar being higher, steppers were the only feasable solution that could be used without gearing. At torques greater than 3.5Nm, steppers get quite large and heavy and speeds top out around 3000 RPM. At high speeds with a heavy load, steps can be skipped which affects precision if no encoder is present. Adding an encoder negated the cost advantage of steppers somewhat. DC motors tend to have a greater range of possible performance values. While DC motors of a comparable size and cost are more limited in the torque they can produce, their higher speeds can be used to produce similar mechanical power (power in Watts is the product of torque in Nm and speed in m/s) so gearing can make DC motors usable. It is also obvious that industrial versions of either solution are very expensive.

No sutable low cost stepper solution was found but there are many low cost hobby grade brushless DC motors and ESCs. The problem with these solutions is they do not have performance data making part selection difficult. I did manage to find a source online that characterised a number[9] and built an open source closed loop speed controler that works with aftermarket encoders[10]. A system based on the D6374 and ODrive would cost $99 for the motor, $39 for the encoder and $159 for the driver which can drive 2 motors, acheving the lowest total system cost.

An even cheaper way to achieve the desired effect would be to use two hobby grade ESCs instead of the ODrive and rely on the hall effect sensors inside a sensored brushless DC motor. This would sacrafice some potential precision of control and require more, lower level software be written. The ODrive and industrial speed controllers all had a number of interface methords including Python librarys, serial, PWM, step/direction, CANBUS, and others. They were also able to offer higher level control methords such as position, velocity or torque control and even calling memorised routines. I decided it would be intresting to develope a good understanding of the neuances of motor control so the lower cost was the deciding factor. A system based on two Turnigy Aerodrive SK3s and ESCs should total $220 in motor and controler costs. Control would be best implemnted with an Arduino as I would be communicating via PWM. Good performance in the application should be achievable with this system, though many of the assumptions in the caculations above need to be revisted as the design evolves and more details are known and constraints set. Over the Christmas period I hope to put together the details of the mechanical design for the platform with a view to ordering parts and getting started on the software in 2021.

References

[1]http://news.bbc.co.uk/2/hi/uk_news/magazine/8510228.stm

[2]https://aws.amazon.com/deepracer/

[3]https://engineering.case.edu/groups/biorobots/continuous_wave_peristaltic_motion

[4]https://sherp.global/

[5]https://www.moonsindustries.com/p/nema-23-standard-hybrid-stepper-motors/ml23hsap4100-000004611110011250

[6]https://www.moonsindustries.com/p/s80-series-brushless-dc-motors/80bl200l2-000004611130000078

[7]https://www.moonsindustries.com/p/rs-series-step-servo-motors/am17rs3dma-000004696351001960

[8]https://www.jvl.dk/236/quickstep-integrated-stepper-motors

[9]https://docs.google.com/spreadsheets/d/12vzz7XVEK6YNIOqH0jAz51F5VUpc-lJEs3mmkWP1H4Y/edit?usp=sharing

[10]https://odriverobotics.com/