I am working on a project where the motor controller needs to be rewritten because it's not behaving properly (the motor is vibrating too much and tuning its parameters is close to impossible). The person responsible for the controller is not able to work on it so I am left to fix the problem.

To be noted: In feedforward the motor works perfectly fine.

We are using a modified 3 phase BLDC motor with a custom power drive with 6 MOSFET's driven by a DVR8301. The PWM generation code-side works fine (FF works). The feedback loop is broken, however.

For the encoder we are using a RM08 encoder by Renishaw. It's a 12 bit absolute magnetic encoder.

My question is what the fastest way is to get this motor controlled with a closed loop. I want to use a velocity control.

The motor is controlled using a Zynq SoC with code written in C++ running at 20kHz interrupts. However, I have everything hooked up to a speedgoat over EtherCAT so I can read and write data at 10kHz over simulink real time as well. If I can get a working principle in Simulink I can translate that to code easily.

Below I have attached a schematic of the inputs and outputs. Motor Controller

The PWM is calculated based on the magnitude. The angle is what we are using in the feedforward controller. We increment the angle by 0.9 units and subtract 360 from it if it gets over that value (to prevent overflow).

My idea was to use a simple p-gain controller where the velocity setpoint is by how much the angle is being incremented and the output of the system would be the magnitude. The magnitude will have to increase to accommodate load on the motor, hence the velocity controller.

So in conclusion, I would appreciate some guidance on how to create this motor controller

  • \$\begingroup\$ I'm assuming feedforward is one direction of travel... what's the other direction called?.. oh and did it ever work in both directions? You might need different parameters for the revers direction.. not a complete re-working. \$\endgroup\$ – Spoon May 22 '16 at 15:53
  • \$\begingroup\$ @Spoon feedforward is an open loop system where I just manually set the magnitude and indefinitely increment the angle. I need to control the magnitude based on the angle increment the controller receives. Unless someone has a better way of doing it. \$\endgroup\$ – Ortix92 May 22 '16 at 21:17
  • \$\begingroup\$ As you said, since feed-forward mode works, the problem is in the loop. More information please: Does your loop contain an integral (Ki) and differential (Kd) term? (I'm sure that it has a Kp term). Is the vibration only when stopped? Is it a high frequency vibration? (typically caused by too much Kp or too little Kd). Or a low frequency vibration? (caused by too much Ki). How long does it take for the firmware to calculate the feedback velocity from the absolute position? (critical for closed-loop stability). \$\endgroup\$ – Mark May 23 '16 at 0:17
  • \$\begingroup\$ Does robotics.stackexchange.com/questions/167/… help ? \$\endgroup\$ – Spoon May 23 '16 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.