Heller's Omni Robot

Omni Robot


Below first images of my new project for an omni-directional robot.








Some rough specs:
  • 3 Nema 14 Stepper Motors
  • 1 Beaglebone Green
  • 3 Pololu DRV8834 Stepper Motor Drivers (see below selection advice)
  • 6 SR-04 ultrasonic rangefinder

Currently in the process of writing code


Selection of the Stepper Motor Driver (micro stepping)

After purchasing Pololu's DRV8824 stepper driver, I found these are not the best suited drivers for driving the stepper motors when selecting the micro stepping mode. The observed failure was that the stepper motors seems to miss steps on regular intervals. After measuring the stepper motor output with a multimeter, I found the problem was within the supper motor driver (courtesy of Pololu for making the graph in this post). 




Finally deduced the issue to the decay mode used in combination with the required output. 

Theory goes like this (see the spec sheet of the driver used for explanation of some of the variables): 

I came up with the following. The motor can be modelled as an L/R network with a resistor and inductance in series, in which the resistance is both the motor resistance Rmotor and Rds(on). In general, the formula for such an L/R network given a step response input voltage is given by:

    Vstep(t) = Vdifferential * (1-exp(-(R/L)*t))

Where Vdifferential is the differential voltage, which equals the motor voltage Vmot in initial state.

When the voltage is removed again, the voltage across the L/R network is given by:

    Vdecay(t') = Vdifferential * exp(-(R/L)*t')

So both are essentially exponentials with time constant R/L and amplitude given by the voltage differential. For the first PWM with duty cycle given by the blank time Tblank, the voltage across the stepper motor is:

    V1 = Vmot * ( 1 - exp(-(R/L)*Tblank))

Then using slow decay, the voltage decays to:

    V2 = V1 * exp(-(R/L)*Toff)

If this voltage is not decayed to zero volt, e.g. when Toff is too small, we end up with a residual voltage. With the next PWM cycle, voltage is again increase by approximately the value of V1, and the residual voltage is approximately twice the residual voltage of the first PWM cycle. This voltage increase continues until equilibrium state is reached. 
An estimate of this can be calculated by linearising both exponential functions around the voltage in this equilibrium state. This equilibrium state is when the voltage increase due to Tblank is equal to the voltage decrease of Toff. Both are given by the linearisation of the first to formulae:

    Vincrease(t) ~ (Vmot - Veq) * (R/L) * t

    Vdecrease(t) ~ Veq * (R/L) * t

In equilibrium state Vincrease(Tblank) equals Vdecrease(Toff):

    (Vmot - Veq) * (R/L) * Tblank = Veq * (R/L) * Toff

or

    Veq = Vmot * Tblank / (Toff + Tblank)

So the equilibrium state depends on the motor voltage, and the ratio between Toff and Tblank, and is independant of R/L. The DRV8824 has a minimum duty cycle (Tblank) of 3.65 microseconds. Given the PWM frequency of 50kHz (or 20 microseconds period), the remaining time (Toff) the motor voltage is switched off is then 16.3 microseconds. The minimum motor voltage is 8.2V for this driver, which results in a minimum voltage of:

    Veq = 8.2 * 3.65 / 20 = 1.49V

That's 18% of Vmot. It's also possible to simulate this behaviour using the first two formulae, giving the graph below:




Within about 6 msecs, this equilibrium state is reached. The conclusion that can be drawn here is that the driver with the supplied motor voltage to the stepper motor driver, will not be able to drive voltages below 18% of this motor supply voltage. When micro stepping is required, the Slow Decay Mode of this driver prevents stepping smoothly because of this. As suggested, the DRV8834 is a much better choice. 

How to Compile your C code for the PRU

Step 1: download the C compiler from http://software-dl.ti.com/codegen/non-esd/downloads/download.htm#PRU
(and get the ARM version, and download to the Beaglebone). This is a script including a binary file that needs executable rights and sudo to execute. This will install the compiler in /the/directory/you/want:

sudo ./ti_cgt_pru_2.1.2_armlinuxa8hf_busybox_installer.sh --prefix /the/directory/you/want

Step 2: download the pru-software-support-package and unpack it

Step 3: compile the package, by first declaring the variable PRU_CGT with the path used in step 1 and appending the /bin directory
export PRU_CGT=/the/directory/you/want/usr/
cd into the pru-software-support-package directory you extracted in Step 2
make

Every example should compile fine now.

No comments:

Post a Comment