NeuronRobotics / mribot-issues

0 stars 0 forks source link

Motor stutter with simple P controller #15

Closed madhephaestus closed 9 years ago

madhephaestus commented 9 years ago

When the p controller is running from a far away position for the setpoint there seems to be a stutter. The printouts from the axis shows a inverted value during the stutter.

Tested is a loop that sends the p controller from 10000 to -10000, waiting long enough for it to settle, and no shudders are visible or audible.

acamilo commented 9 years ago

setpoints changed to 100000 +-

madhephaestus commented 9 years ago

How is this coming?

acamilo commented 9 years ago

problem is in the data. Sometimes the whole word is shifted to the left by 1 byte. like the peripheral missed a clock edge from the master. this problem exists in the SPI Slave module on the card and occurs on average once in few hundred thousand read/writes. its only noticeable when you set a large set-point and the motor is traveling for 10-20 seconds or more.

Tried to get LVDS working in XPS. Gave up, posted to xilinx forum.

noticed oscilator was 100mhz not 50mhz which means the SPI peripheral on the card was running way to fast (pll boost to 200mhz for more oversampling. was at 400mhz due to this error) i fixed this and will test soon.

acamilo commented 9 years ago
  1. osc was wrong. max this can go is 217mhz. its running at 200.
  2. waveforms looked ugly, cleaned them up by using 75 ohm termination on both sides
  3. SPI peripheral was incorrectly configured.

reliability test passing. testing code now.

acamilo commented 9 years ago

odd.. DAC got kicked into funny mode which required a card reset to recover from.

acamilo commented 9 years ago

fixed.

acamilo commented 9 years ago

dac gets into a mode where it won't update.

acamilo commented 9 years ago
  1. we don't need 75 ohm termination. this does nothing. removed it.
  2. Modified DAC so it runs at a lower clock rate and only updates once per packet
  3. Motor controller has a minimum speed below which it won't move. worse still, if you try to run it that slow it locks up and once you crank speed back up it doesn't move and will only recover if you de-assert cw and ccw pins. i added a minimum veloity check to the setCardVelocity function.
acamilo commented 9 years ago

also, cleaned up wiring on test hardware.