• Mechanics

    Peter Wasilewski10/31/2019 at 13:46 3 comments

    ­Hi :)

    This time I’d like to tell you a bit more about the mechanical aspects of the robot. The most interesting parts of each quadruped are undoubtedly the actuators. As I mentioned earlier the idea came from a project by Paul Gould. I got interested in cycloidal drives as I could easily prototype them on my 3d printer. I decided to integrate the actuators completely in the robot’s structure in order to save some space. The leg construction assumes it can be milled from a 7mm plate of material (this dimension is dictated by the width of a single bearing). Moreover I decided to put all the motors (which are quite heavy in comparison to the rest of leg) as far as possible form the leg tip. In that way it is possible to minimize the leg inertia and thus make the leg more agile. Many quadruped designers also claim that when the leg inertias are low enough, it is possible to neglect them in the dynamical model of the robot.

    The shape of the cycloids was generated in the SolidWorks program using formulas found on the internet. Hole placement, the eccentricity of the cam (crankshaft?), outer pin count and diameter was computed using one of the online calculators. Knowing all the needed parameters the gearbox was 3d-printed and put together. Below You can see the 3d model of the leg. 

                                                        Figure 1. 3D model of a single leg

    Each actuator has two cycloids which are 180* rotated relatively to each other. This is to minimize the vibrations coming from non-axial movements. Each cycloid has a main bearing in the center and seven small bearings around it. The outer pins are just pins – no bearings there.

    The project looked fine on the computer, however, when I started to put it together I noticed a few problems:

    -The cycloids must be perfectly manufactured. When too large they tend to latch, when too small the gearbox runs smoothly but has a lot of backlash. Building first prototypes I used to grind the cycloids with a file in order to make them fit the desired space. This was quite time-consuming, however it worked. The gearbox ran smoothly and it would show only about 1-2 degrees of backlash.

    -Outer pin holder was very susceptible for any imperfections coming from the 3d printing process. A bit of extra material could twist the outer pins relatively to each other making the whole pattern irregular. Even when the cycloids were fine, this part would make the whole actuator latch at the same spot every rotation. -The last problem, which is still unresolved, is the connection between the thigh motor case and the rest of the leg. Currently, it relies mostly on one bearing and partially on the rods connecting the motor holder to the internal part of the thigh actuator. This can cause problems when the leg is being strained from the side.

    Figure 2. Section view of the leg. Red circle shows one of the screws holding the bearing to the motor case, whereas blue shows the dangerous spot where the leg rests mostly on one bearing.

    Thankfully my university owns a milling machine able to mill in aluminum. I decided to try milling a few cycloids and check how they do in this design. At first, the cycloids needed a few attempts in order to make them fit well. When adjusted the gearbox was operating without any latches but was a bit louder than the 3dprinted one.

                                                     Figure 3. milled cycloids

    In the end, all the cycloids were milled form PA4 aluminum. Rings for outer pins, previously 3d-printed, were now also milled form a material called metaplex. It is similar to plexi, but is more shock resistant and do not break that easily. 


    Read more »

  • Motor controllers

    Peter Wasilewski08/06/2019 at 10:55 0 comments

    Idea of control 

    Decided to build custom motor controller I was forced to learn about the technology used to control motors these days. My goal was to achieve high torque at very low rotational speeds. This assumption made me reject trapezoidal control as it is usually used to drive motors at high velocities, without any precision in positioning. Another considered type of control was sinusoidal – with appropriate PID control it was capable of driving the motor at really low speeds (limited by the resolution of the encoder). Reading about any other solutions I came across FOC ( Field Orientated Control). I’ve been reading about it for some time and eventually decided that it was the most sufficient way of driving the motor. The algorithm was dividing the current in two vectors – one responsible for field weakening (normal) and the other having direct impact on the torque (tangential). The goal was to bring the normal vector to 0 and control directly the torque using tangential component using PD control. In order to have feedback I had to read the phase currents with shunt resistors and then transform them into these two vectors. 

    Simulation and hardware

    I started with computer simulation in order to see if I get it all right. When the virtual motor starter rotating I was able to start designing the hardware. The schematic and 2-layer circuit was developed in Eagle and then manufactured in China by PCBway. 

    Main features of the controller: 
    -STM32f405RGT6 microcontroller 
    -DRV8323SRTAT MOSFET gate driver (SPI version)
    -3x double N-channel 
    -CAN controller 
    -12bit AS5145B encoder 
    -external connector for second encoder
    I guess the board itself looks fine, it could be smaller (smaller footprints of the components) however I am satisfied with the result for now. That how it presents: 

    The board is mounted on top of the motor with two screws and the wires are soldered to the board directly as well as the output of the temperature sensor. Magnetic encoder is soldered on a little board to make space for the magnet glued on top of the rotor.

    Testing and results

    The controller worked fine when I first tested it, however when it came to current measurements they were quite “wavy”. The blue line on the screenshot from STMStudio is average of three phase currents, which should stay at fixed level :

    It turned out I did not make separate Kelvin-connections for each shunt, and instead I just shorted the pins to the ground. Besides the measurement side of the controller was all a bit messed up and I had to fix it in order to make the return path as short as possible:

    When corrected, the average wasn’t floating that much (grey line is the average) :

    This modification turned out to lower the amplitude of the average current “waves” to an acceptable limit. The setup was ready for FOC algorithm with current feedback. The results were really promising. Below you can see two plots – first without current feedback (current in q axis vs torque) and the other with current feedback. As you can see the one with feedback is much more linear, thus it is possible to determine the torque constant.

    In the end some photos of fully soldered motor controllers for two legs:

    I think this is all for now, next I’ll post some details about mechanical aspects of the robot.