Archive for March, 2010

Step measurements

Saturday, March 20th, 2010

I propped up the cart so it wouldn’t move and ran it at a variety of steady state PWM rates.  I collected the data and plotted the average current and speed versus PWM rate.  I plotted clockwise motion in white and counterclockwise motion in red.

Speed versus PWM cycle

Speed versus PWM cycle

The speed appears to be very linear versus the PWM cycle.  At low PWM values under 50, the motor does not move.  At 50, it jumps a little bit then is very linear from that point on.  For a given PWM cycle, the CCW speed is about 2% larger than the CW speed.  This explains the slight drift to the left when cycling the PWM sinusoidally.

Current versus PWM cycle

Current versus PWM cycle

The current ramps up somewhat linearly while the motor is not turning.  Once the motor starts turning, the current drops a little bit then increases very slowly.  This indicates the motor is overcoming friction and other forces to maintain a steady speed.  The interesting thing is that the CCW current is significantly larger than the CW current, by about 20%.  This explains the rapid drift to the right when cycling the current sinusoidally.

This causes problems when trying to control the cart using PID.  If I try to control the current, I need to somehow balance the left and right directions of travel.  Perhaps it could be accounted for by the controlling program, which would just boost the current in one direction.  I would also have to figure out the relationship while the cart is moving so that speed and acceleration are accounted for.

Another option would be controlling the PWM cycle directly.  The speed is almost perfectly linear to the PWM value.  Adding a factor of 2% to correct for direction would be easy.  The cart is so light relative to the amount of torque in the motor that it can accelerate almost instantly to the steady state speed that goes with the PWM.  I could limit the rate of change of the PWM cycle to prevent acceleration values that exceed the safe values.

I think I need to do further tests to figure this all out.  This was a good start, though.

Added spacer for carrier

Saturday, March 13th, 2010

After thinking about it for a while, I realized the force to move the cable carrier would be much lower if I added a spacer to the cart to increase the bend radius of the cable carrier.  With Bill’s help, I made a 1 1/2″ spacer from a piece of extruded aluminum.  I think the piece was a 1 1/2″ square cross section of 80/20 brand extruded aluminum framing material.  This stuff is very light and very strong.  We cut a 1 3/4″ inch piece of it, then drilled two holes 1 1/4″ apart for the existing bolts to pass through.  I added it between the T bar and the cross bar on the cart.  I had to remove the old cable ties at the ends of the cable carrier.  I also had to add a couple of sections to the cable carrier, which was a nuisance because I had to remove the cable connector at the end of my encoder cable (again!) so it would fit through the cable carrier.  The finished cart is shown below.  You can see the spacer directly behind the red encoder.  With the larger bend radius, the cable carrier moves very smoothly and the cart has no noticeable resistance due to the cable carrier anywhere along the track.  I believe this problem is solved!

Cable Carrier with Spacer

Cable Carrier with Spacer

Direction of motion matters

Saturday, March 6th, 2010

I experimented with a sinusoidal inputs to see how the system responds.  I started with a sinusoidal PWM, going full range in a 2 second cycle.  I discovered that the cart slowly traveled to the left while cycling.  At the time, I assumed it was due to the cable carrier.

My next test was using PID onboard the FPGA to control the current.  I used a sinusoidal current setpoint.  The cart cycled very nicely, but I discovered it traveled to the right while cycling and did it fairly quickly.  After about 10 cycles, it traveled the entire length of the rack.

To investigate further, I propped up the cart so it wouldn’t move while cycling.  I discovered that the travel had nothing to do with the cable carrier and the motor behaved almost exactly the same when it wasn’t moving the cart.  I figured out that the direction of travel is a significant variable that I will need to deal with.  It may end up being a simple proportional thing, where I use a multiplication factor to make both directions equal.

My plan is to collect a good amount of data while cycling the motor at different rates, then building a table that relates acceleration to speed and current.  I haven’t figured out exactly how I am going to do it yet, but I am working on it.  Once I have the table, I am hoping it will enlighten me on how to model the motor and cart.  If all else fails, the table could be used as the model.