This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Start moving loaded motor with force angle, using Lab5a

Other Parts Discussed in Thread: LAUNCHXL-F28069M, BOOSTXL-DRV8301

I am trying to figure out how to get a pretty heavily loaded (15lb wheel) moving, quietly. I am using Lab5a, since I can adjust Kp and Ki. Previously I was looking at lab 21, but turns out the motor is not salient. The motor is a very low inductance BLDC Scorpion S-4025-12. Attached is the user file. Power supply is a 30V battery. I am aware that I am asking the launchpad to do quite a bit more than it is rated for in terms of current, so I am only using it for shorter burst. We are working on a custom board that has hardware more appropriate for the load, its just gonna take a few more weeks and I need to flush out the software. ForceAngle flag is on. 

So.. with no load, the motor works great. But with the wheel attached:

Up to IqRef_A of 19, i get very little amp use, about 1.2amps, consistently throughout operation. The motor vibrates some, there is some noise but its reasonable, and over time, eventually spins the wheel. The movement becomes perfectly smooth and stable at about 100 - 150rmp. At IqRef_A 20, amp consumption suddenly jumps to 15 amp or higher, and the wheel does get going pretty quickly. The problem is, the motor is really loud and vibrates violently, until it hits over 250 rpm, at which point amp consumption decreases to about 4 amps and everything is smooth and quite. I am confused why IqRef_A of 20 behaves so differently from IqRef_A of 19. I though perhaps it was related to USER_IQ_FULL_SCALE_CURRENT_A (which happens to be 20.0),  but changing that value did not change this behavior. 

Incidentally, for both IqRef_A values, if I by hand slow the motor back down to below 100 rpm or so, the noise and vibrations returns, and in  the case of IqRef_A 20, consumption spikes back up to 15 and up. So for IqRef_A, going up the cut of is 250 rmp, but going down its 100rpm.

-what is happening between IqRef_A 19 and IqRef_A 20?

-what does the noise and vibration indicate? Does FAST not have the correct orientation of the motor and therefore sending bad PWM, until ~ 150rmp is reached? Or is this just the behavior of force angle, and 150rpm is where Force Angle and FAST are switching control? I played with with the value of USER_ZEROSPEEDLIMIT some, and reducing it all the way down to (0.01 / USER_IQ_FULL_SCALE_FREQ_Hz) did seem to change the switch point to 90rpm. But I cant get seem to get it any lower than that. 

-Since the battery power supply is 30V, and possibly I will use over 20 amps, should these variables all be changed to 30? USER_IQ_FULL_SCALE_VOLTAGE_V, USER_ADC_FULL_SCALE_VOLTAGE_V  , USER_IQ_FULL_SCALE_CURRENT_A

thanks

3554.user.h7651.user_j1.h

  • you're using 30V battery with the Launchpad? Really shouldn't do that. it's rated for 24V.
    and you shouldn't request more amps than 1/2 of the USER_ADC_FULL_SCALE_CURRENT_A

    a few things
    - in your user.h you have the limit set to 1.0 Hz, this is much too low for this motor. You see it has issues below 100 RPM (11.33 Hz). I'd start with using forceangle until 12.0 Hz

    #define USER_ZEROSPEEDLIMIT (12.0 / USER_IQ_FULL_SCALE_FREQ_Hz)
    and BTW, I bet your motor is higher frequency than the800 Hz you have set for the FULL_SCALE_FREQ

    next, if using 5a and commanding a current of 19a you are setting a step function into the current reference. it may help to start up in speed mode to a couple hundred RPMs, and then move into torque mode. Would be interested to test the differences between using 5a and 5b. In 5b you need to tune your speed loops/ Typically for these motors 5x to 10x lower than the default Kp and Ki values is a good start.

    It is very difficult to produce full torque with these types of motors from zero speed, especially smoothly, but you should be able to reliably start-up with a decent amount of torque.

    "-Since the battery power supply is 30V, and possibly I will use over 20 amps, should these variables all be changed to 30? USER_IQ_FULL_SCALE_VOLTAGE_V, USER_ADC_FULL_SCALE_VOLTAGE_V , USER_IQ_FULL_SCALE_CURRENT_A"
    You shouldn't use 30V or use a motor that can pull 30A.
  • Thanks for fast feedback. Ok, ok, i am switching to a variable power supply and using 24V and 20amp limit. For USER_IQ_FULL_SCALE_FREQ_Hz, according to:
    www.scorpionsystem.com/.../S-4025-12
    the drive frequency for the motor is 8khz. But the maximum value I can put in USER_IQ_FULL_SCALE_FREQ_Hz is about 1450. Above that I get an error.

    if(USER_VOLTAGE_FILTER_POLE_Hz < (USER_IQ_FULL_SCALE_FREQ_Hz / 4.0))
    {
    USER_setErrorCode(pUserParams, USER_ErrorCode_voltageFilterPole_Hz_Low);
    }

    Is USER_VOLTAGE_FILTER_POLE_Hz something I can change to avoid the error? 

    or WAIT, is the division by 4 here  based on the pole count? because this motor has 14 poles.

  • it's not 8 KHz, it's 440 RPM /volt. @ 24 Volt that's 10560 RPM = 1232 Hz. I'd use 1300.0 for max frequency
  • AH ok got it. will test it out
  • unfortunately, no noticeable improvements yet in getting a more controlled start up. Quick questions, though. I am looking at ch14 of spruhj1f.pdf, 14.1.1.5 Tune Voltage Feedback Circuit. What is the correct jumper setting on the launchpad, given 24V? Just in case I had this wrong all along. I had all open, except 3 and 7. Also does USER_VOLTAGE_FILTER_POLE_Hz then need to be adjusted?
  • which Launchpad are you using?
    not sure what you are talking about regarding voltage feedback circuits and jumpers. the voltage feedback circuits are fixed, and the pole created in that circuit are used in user.h for USER_VOLTAGE_FILTER_POLE_Hz , so no you don't change this value if using standard hardware.

    are you using speed control lab yet or still trying torque control only?
  • it is the, LAUNCHXL-F28069M, with the BOOSTXL-DRV8301 rev B. So really i'm just double checking if my jumper settings were correct.

    I've been playing with the speed mode too, and it behaves a little nicer. Still makes loud noise but at least the amp consumption doesn't jump strangely like i described above between IqRef_A of 19 and 20. But I haven't played with it that much yet so I will report later today. thanks
  • But its very counterintuitive. Why do you recommend using speed mode to start the motor?
  • the other option is to put a ramp controller between the throttle command and the input to the Iq_Ref_A.
    You don't want step commands into the current controller

    another option would be to limit the Vs/Vq/Vd output. I know some e-Bike and hobby motor applications like to just do Vq control directly.
  • Sorry, you lost me there. Are you talking about this variable? USER_MAX_VS_MAG_PU. Or is there a lab that would help me understand the method you are talking about?

    By the way I havent touched InstaSpin Motion at all, but would you recommend I delve into that? I see that lab 5c looks at system inertia. However, the end goal is to power a skateboard, so inertia will be fairly variable.
  • USER_MAX_VS_MAG_PU is a limit to Vs. proj_lab10 uses gMotorVars.OverModulation to change this variable between 1.0 and 1.333, but you can also set it lower to limit the voltage output to your system.

    no, we don't have a lab that shows Vq control, you would have to do this on your own.

    in your skateboard are you trying to control a single motor, or two motors in // ?

    both will be tough sensorless, the // is extremely challenging. for a single motor it can be done, but you won't be able to apply full torque smoothly at start. for this type of application I would suggest hall sensors or an encoder.

    InstaSPIN-MOTION isn't useful in a torque only control system.
  • Well the dream is to eventually have two motors, though I am aware that the code for that does not exist yet and may not be available for a long time. So we are fine with getting by with just the one motor, at least for the current prototype. Unfortunately encoders aren't an option, due to limitations of the physical design of the board.

    So then, since you recommended using speed mode to start, and switch to torque mode later, is the Motion system's knowledge of some system inertia helpful in that regard?

    Can you point me in any direction about the Vq control? maybe a code example, or a chapter in one of the spruh pdfs.

    It's really not so much lack of torque that I am stuck at, but the amount of unpleasant noise. Granted I assume the noise points to serious inefficiency.
  • "So then, since you recommended using speed mode to start, and switch to torque mode later, is the Motion system's knowledge of some system inertia helpful in that regard?"
    knowledge of inertia can certainly help you tune and control the speed a bit better, but it isn't absolutely necessary.

    in your application you don't want someone to turn the throttle full and have the skateboard jump ahead. you need to regulate the torque command to increase at a slower rate. this can be done through a speed controller or by putting a ramp function in front of the Iq_Ref_A.

    "Can you point me in any direction about the Vq control? maybe a code example, or a chapter in one of the spruh pdfs. "
    This isn't documented. As I mentioned you can control the Vs max limit through the code in proj_lab10. If you want to command Vq directly you would have to update CTRL so that the Vq reference is not getting supplied by the Iq PI controller, but by your controlled throttle input.

    "It's really not so much lack of torque that I am stuck at, but the amount of unpleasant noise. Granted I assume the noise points to serious inefficiency."

    what kind of noise?
    when you start-up sensorless your rotor flux position is unknown, so you are simply creating a stator flux and sweeping it around at a rate of USER_FORCE_ANGLE_FREQ_Hz before transitioning to FAST when the frequency estimated is >= the "1.0 Hz" set by #define USER_ZEROSPEEDLIMIT (1.0 / USER_IQ_FULL_SCALE_FREQ_Hz)
  • Oh I see what you're saying now about regulating torque. This is a snipit I wrote earlier and abandoned but this is along the lines of what you mean right?
    if (gMotorVars.Speed_krpm < gMotorVars.SpeedRef_krpm) // keep increasing torque if speed is less than target
    {
    gMotorVars.IqRef_A = gMotorVars.IqRef_A + _IQ(0.005); // this value needs to be refined but it's the change per full software loop
    }

    else if (gMotorVars.Speed_krpm >gMotorVars.SpeedRef_krpm) // keep reducing torque if speed is greater than target
    {
    gMotorVars.IqRef_A = gMotorVars.IqRef_A - _IQ(0.005);
    }

    Cause of noise:
    -It might be force angle. Is there a simple flag i can watch in the expressions to know whether or not FAST or force angle is in control?
    -but I experience noise starting up even without force angle on, so perhaps it is just the way the wheel is attached to the motor. I'd say there are 2 or 3 degrees of motion. this is not a problem at lower torque setting or higher speeds, but at the higher torques and low speeds, maybe the motor is vibrating or even bouncing violently between these degrees. Would you expect this to be a problem? I figure almost any mechanical system will have some cw/ccw give.

    by the way, with force angle off, once running i can slow down the motor all the way to 10 rpm.
  • " Is there a simple flag i can watch in the expressions to know whether or not FAST or force angle is in control?"
    EST_getForceAngleStatus(EST_Handle handle)

    "but I experience noise starting up even without force angle on, so perhaps it is just the way the wheel is attached to the motor"
    it's the sound of the rotor interacting with a non aligned stator. yes, it will happen with both.

    "Would you expect this to be a problem?"
    - I think it would be a significant problem for a user of your machine. it's not a desirable effect, correct? unfortunately it will be difficult to improve using software sensors. The IPD_HFI algorithm can sometimes be useful, but the motor must have very high saliency (which diminishes as current is pushed through the stator).

    "by the way, with force angle off, once running i can slow down the motor all the way to 10 rpm."
    - sure, but with how much load?
  • Thanks, the force angle flag watch is very useful.

    "sure, but with how much load?" yeah that was only the case for speed loop with the wheel but no additional load. in torque mode, i could only slow down to 80rpm.

    tried to implement regulated torque with this code:
    if (gMotorVars.Speed_krpm < gMotorVars.SpeedRef_krpm) // keep increasing torque if speed is less than target
    {
    gMotorVars.IqRef_A = gMotorVars.IqRef_A + _IQ(0.001); // this value needs to be refined but it's the change per full software loop
    }

    else if (gMotorVars.Speed_krpm > gMotorVars.SpeedRef_krpm) // keep reducing torque if speed is greater than target
    {
    gMotorVars.IqRef_A = gMotorVars.IqRef_A - _IQ(0.001);
    }

    But I see now that using gMotorVars.Speed_krpm for the loop is problematic as this value is generated with a big delay. In a no load or fly wheel situation, when I input target speed, the torque always overshoots. so if I target 2krpm, when the motor finally has enough torque to get going at all, it will way overshoot and hit 4krpm or higher actual speed, and then start to slow down. But since gMotorVars.Speed_krpm is updated so slowly, IqRef_A reaches zero and so the motor stops. and the pattern then repeats. There must be a better value I can look at then gMotorVars.Speed_krpm. what would that be? thanks