Page 1 of 1

BLDC motor isn't reading back the correct velocity

Posted: Wed Sep 30, 2020 8:18 am
by jack1202

I'm working on a project with a number of phidgets that requires some PID control on a BLDC motor.

Firstly, on the motor controller page on the phidgets website, it states that there is PID control built in to the controller for position control, but doesn't mention if this is also available for velocity control in the hardware? It doesn't seem like this is working as the motor isn't matching the velocity that I set it to or attempt to speed up when it is physically restricted. (I'm measuring with a laser tachometer)

As the motor isn't running at the intended speed, I'm adding PID control through LabVIEW itself. To do this, I need to be able to read in the velocity of the motor which I'm doing with the BLDCMotorGetVelocity VI. However, when I read the value from this VI it's not in line with the tachometer. Additionally, if I restrict the movement of the motor by increasing the load on the motor I can see the motor speed lower significantly both by eye and with the tachometer but the value I read back from BLDCMotorGetVelocity does not change at all. Why is this value not changing when the motor speed changes?

To confirm that my code is not at fault, I have added BLDCMotorGetVelocity to the BLDC Motor Example VI within the while loop and have the same issue when I restrict the motor speed; the read back value does not change. I also tried the BLDCMotor VelocityChangeEvent Example VI which uses events to try and measure the motor speed but this also shows exactly the same problem.

Therefore, I have two problems:
1. When I set the motor velocity and restrict the motors movement it does not attempt to increase its power to get back to the correct speed, so the built-in PID control of the phidgets is not working.
2. When I restrict the movement of the motor I can see it become slower, but both methods of reading the motors velocity do not reflect the lower velocity.

Does anyone have some insight into what I'm missing here?

Thanks ever so much for your time,


Re: BLDC motor isn't reading back the correct velocity

Posted: Wed Sep 30, 2020 10:15 am
by jdecoux
None of our motor controllers have PID velocity control built-in. Given the extremely coarse position feedback from the hall-effect sensors on BLDC motors, it is unlikely the DCC1100 ever will. There is not enough resolution to give a truly accurate measure of velocity built-in to the controller.

The velocity limit you set in the MotorPositionController API is more of an upper limit on velocity, rather than something the motor controller will try to rigidly follow.

The basis of how out MotorPositionController API works can be found here:

If the motor falls too far behind the target motion profile, it will speed up catch up to the position it thinks it should be at, but no direct velocity control is implemented.

If you are running the BLDCMotor API, the Velocity you set and get back from the API are a 0-1 scale of the power to the motor, rather than a specific real-world velocity.

In order to know the motor's real-world speed with a DCC1100, you will need an external sensor, such as a rotary encoder.

Re: BLDC motor isn't reading back the correct velocity

Posted: Wed Sep 30, 2020 11:03 am
by jack1202

Thanks for the swift reply!

That all makes sense; seems I had a misunderstanding of the controllers capabilities.

I am using the API and understand the scaling which I'm implementing for the 0-1 range, but to confirm:

The velocity which I read when I call the _getVelocity() DLL is the upper limit target velocity which I've set, rather than a measured value? If this is true, what is the difference between this and the _getTargetVelocity() function?



Re: BLDC motor isn't reading back the correct velocity

Posted: Thu Oct 01, 2020 10:32 am
by jdecoux
When using the BLDCMotor API, the the BLDC motor controller has an Acceleration parameter that will ramp the motor's Velocity (aka duty cycle) from the current Velocity to the TargetVelocity. After the acceleration period, we expect Velocity to match TargetVelocity.

You will get the motor's current Velocity (duty cycle) using getVelocity, and you will get the target it is accelerating towards by using getTargetVelocity.