Notifications
Clear all

Tuning questions with my first motor

Forum 1
(@sberesfo)
Active Member

Hi, I am tuning for the first time. It is a 4 pole brushless DC motor with hall sensors. I am using the Solo HOW TO SETUP AND TUNE YOUR MOTORS USING SOLO MOTION TERMINAL LIKE A CHAMP! (CLOSED-LOOP GUIDE).

1. I connected the motor according to the data sheet. 2. I set the motor type to BLDC-PMSM and I adjusted the max current and also the number of poles. 3. I changed the piano switch to closed loop and also changed the command mode to Digital 4. When I click motor identification, the terminal changes the max current, the number of poles. Is it normal for the terminal to changes these 2 parameters?

With the control type to torque and the Speed/Torque Control Mode to "using hall sensors" I click the "Hall Sensors Calibration". The motor makes a couple of revolutions in large steps like a stepper motor.

I am unsure what to do next. Can we make the motor spin from the motion terminal or do we have to exit the motion terminal and test the motor in the normal fashion. 

Not sure what to do next,

Thank you!

Quote
Topic starter Posted : 07/04/2021 10:32 pm
Forum 3
(@milad)
Chief Member Moderator

Hi @sberesfo

Posted by: @sberesfo

Is it normal for the terminal to changes these 2 parameters?

Actually not, this shows something is not done correctly, so first of All make sure you are truly in Digital Mode, meaning that when you set Digital Mode, try to Read after and verify if you are truly in digital mode. pls do this for everything that you set, so after setting, make reading just to see if the parameter is really on SOLO or not.

Another Point is SOLO has a simple rule, if you are in Analogue Mode, everything that can be set with Analogue inputs will have priority over Digital inputs, like Motor type, Open or Closed-loop, Control mode of speed or torque ( all 3 set by Piano switch) or the Current Limit, Motor Direction, Speed or Torque references that are set by the user from 5 pin connector (Analogue Inputs), the same rule applies for Speed controller Kp and Ki that are set using two potentiometers on the board.

The only point is the Pin No#5 of the piano switch that puts SOLO into closed-loop is the only way to command SOLO to go into Closed-loop or Open-loop regardless of being in Analogue mode or Digital Mode.

So as long as you are in analog mode, analog inputs have priority over digital input, that's why if you want to command SOLO digitally ( using data packets through USB, UART or CAN), you need to make sure you are in Digital Mode firstly, to avoid confusion, then after that you can proceed with the rest ( Motor type selection, current limit, ...)

Posted by: @sberesfo

With the control type to torque and the Speed/Torque Control Mode to "using hall sensors" I click the "Hall Sensors Calibration". The motor makes a couple of revolutions in large steps like a stepper motor.

To set up properly your Hall sensors with SOLO I offer you to read this article we just published, it will guide you through how to properly set up your HALL sensors with SOLO and how to verify that, it will also show you how to calibrate your Motor and Hall Sensors automatically using "Hall sensor calibration".

https://www.solomotorcontrollers.com/hall-sensors-to-solo-for-controlling-speed-torque-brushless-motor/

Once you verify that the Hall Sensor and the Motor are properly connected to SOLO and well-calibrated, you need to Tune your Speed controller Kp and Ki gains in Motion terminal if you are in Digital Mode. Remember that Torque Controller is automatically tuned after Motor Identification. ( Both in Digital and Analogue Mode)

To learn about how to tune your speed controller in the Motion terminal in Digital Mode, you can have a look at the video below. This video explains position controlling with Quadrature Encoders which you might think how on earth it's related to your question, but actually the Methods are the same, so after Hall Sensor calibration (in the video encoder calibration), you need to proceed with Testing Torque loop, then Speed loop, in the middle of the video at 7:37 we explain how is the architecture of SOLO for that and it's the same for all the methods including sensorless methods. The only difference between this video and your application is now you need to select "Using Hall Sensors" as your "Speed/Torque Control Mode" in Motion Terminal, also remember that we don't offer at the moment Position controlling using Hall sensors, so the last loop meaning Position loop when you use hall sensors has no use.

https://www.youtube.com/watch?v=LeQuX0OEh9w&ab_channel=SOLOMotorControllers

The last thing, you can also use SOLO with Hall sensors if you are in analog mode, so for that, you need to Calibrate firstly the Hall sensor and the Motor and then stay in Analogue mode, the Speed controller gains will be tuned using those blue potentiometers and the Speed/Torque references can come from PWM or Analogue voltages. The calibration is only necessary to be done 1 time ever, so as long as your Motor is the same, you won't need to repeat it, the values will be stored in the long-term memory of SOLO.

So pls read that article and then watch this video, I'm sure you will have a better idea of how things work, then pls share how is the experience is going on or if any issue you are facing during the process, we will remain available.

Regards
Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.

ReplyQuote
Posted : 08/04/2021 12:20 pm
Forum 1
(@sberesfo)
Active Member

Greetings @milad,

Thank you for the replies. Honestly, this is getting a little confusing. We certainly were in digital mode and we tried multiple times but when we press motor identification it changes the number of poles from 4 to 8 and it changes the Current Limit back to 32. We are not seeing any errors in the error register.

So now I am going to steal your idea and go back to basics and ask some questions.

  1. Is Motion Terminal able to determine if the hall wires and phase wires are properly paired? The pairing of these wires is important from my experience. Is this correct? In the absence of a data sheet can the pairing be determined in some other way for instance with a multi meter?
  2. While tuning, when does the data or parameters get saved or written to the actual controller board? If we are trying multiple times to tune the motor, is data being written to the board multiple times over and over? Would you please explain how that works?
  3. Are we able to set the maximum allowable speed during tuning so the end user can never exceed the set speed?
  4. How do you just get the motor to spin using Motion Terminal? There is a motor stop button but there is not a motor start button.
  5. So there are three control types, speed, torque, and position. Can you briefly explain the difference? What we are looking for is the motor to maintain a constant speed as torque changes.
  6. Can the controller be reset to the factory default settings using Motion Terminal?
  7. What are Ki and Kp? I understand that the two trimmer pots on the board act the same way as Ki and Kp in Motion terminal. Is this correct?

I will read the newly published article and watch the video over the weekend.

Thank you again!

Scott

 

ReplyQuote
Topic starter Posted : 10/04/2021 12:07 am
Forum 3
(@milad)
Chief Member Moderator

Hi @sberesfo,

Posted by: @sberesfo

we tried multiple times but when we press motor identification it changes the number of poles from 4 to 8 and it changes the Current Limit back to 32

Pls remember that if you just put a number in a field in Motion Terminal, it will not be set, you need to actually press the "SET" button or Press ENTER, after that, if the ACK. comes back from SOLO you will see the field will get GREEN, if it gets RED it means sth went wrong due to wrong range, or maybe lack of connection or etc..., so pls verify this.

Posted by: @sberesfo

Is Motion Terminal able to determine if the hall wires and phase wires are properly paired? The pairing of these wires is important from my experience. Is this correct? In the absence of a data sheet can the pairing be determined in some other way for instance with a multi meter?

Yes, if you take a look at the article I gave you, there, we explain exactly how to find the right pair for Hall sensor wirings as well as Motor wirings, and finally calibrating the Motor with the Hall sensors, basically, you need to see a specific Trend for the "Angle" as mentioned in the article.

https://www.solomotorcontrollers.com/hall-sensors-to-solo-for-controlling-speed-torque-brushless-motor/

Posted by: @sberesfo

While tuning, when does the data or parameters get saved or written to the actual controller board? If we are trying multiple times to tune the motor, is data being written to the board multiple times over and over? Would you please explain how that works?

This depends on the parameter, some parameters are volatile meaning that they will be forgotten after power recycle, but some parameters are saved in the long-term memory of SOLO and are remembered after power recycle. If you check the Command Table in the datasheet for Digital Control, in the WRITE table, the parameters that are saved in Memory are shown with "M", you can over-write the Memory saved parameters for Millions of times and it should be fine, obviously those parameters are mostly 1-time settings and they don't need to be changed dynamically ( like Motor Number of poles, Encoder lines, .... ).
The volatile parameters can be set dynamically and there will be no limit for read-write on them.

Posted by: @sberesfo

Are we able to set the maximum allowable speed during tuning so the end user can never exceed the set speed?

This is, for now, available only in Position Controlling mode, in the future, we will consider this for Torque and Speed mode.

Posted by: @sberesfo

How do you just get the motor to spin using Motion Terminal? There is a motor stop button but there is not a motor start button.

By giving a Setpoint or a reference ( Torque / Speed / Position reference), the Set Point can be sent using Analog voltages or PWM pulses if you are in analog mode, as well as data packets if you are in digital Mode, so there is no need to say Motor Start, if the Reference point is anything greater than zero, the Motor will start spinning to reach to the goal. For example, if you are in Speed Mode, and you have already tuned the Speed controller Kp and Ki, by just putting a reference speed in "Speed Reference [RPM]" in Motion Terminal ( in digital Mode) , the Motor should start to spin to reach to the desired speed that you set. However, what "Motor Stop" does is sending a Zero reference or set point to SOLO to force the Motor to reach ZERO Torque/Speed.

for this pls watch the video, there I show how to test Torque, Speed loops ( the method is indeferent for Encoders or Hall sensor )

https://www.youtube.com/watch?v=LeQuX0OEh9w&ab_channel=SOLOMotorControllers

Posted by: @sberesfo

So there are three control types, speed, torque, and position. Can you briefly explain the difference? What we are looking for is the motor to maintain a constant speed as torque changes.

sure, so basically talking about Brushless Motors, we have 3 control loops that are coming one after the other:

  1. Torque Loop: This is the closest controller to the motor and the fastest one, it will only control the Torque of the Motor regardless of the Speed, The Speed depends on how much Load you have on the shaft of the Motor, so the difference between the Motor's Torque and Load Torque will define the final Speed ( this is not the controller that you should use in your specific application, but you need to tune it, by just pressing Motor Identification, and it will be automatically tuned)
  2. Speed Loop: The Speed loop comes after the Torque Loop, it's slower than the Torque controller (at least around 10X) and it basically tries to fix the Speed on Desired value, so this is the control type you should use for your application, this controller will keep the speed fix regardless of the load variation and it will adjust the torque accordiningly. You might ask why the Speed controller comes after the Torque controller, this is a huge topic, but to simplify it drastically I would say for the fact that an Electrical Motor is a Torque Generation machine, even the Speed is controlled finally by controlling the Torque, so the speed controller when it tries to command, it commands to Torque Controller to increase or decrease the Torque on the Motor to stabilize the motor on a specific Speed that it desires! 

    For SOLO, both in Analogue or Digital Mode, you need to tune Speed controller Ki and Speed controller Kp first ( in analog Mode using those two blue potentiometers, in digital Mode by setting them directly ) and then you can send a speed reference, so SOLO will try to reach to that speed.

  3. Position Loop: this is the last loop coming behind the speed loop, it basically tries to set the exact position of the Motor on a specific value, so to make this loop functional, you need to make sure the Torque and Speed loop are firstly tuned and ready, then you can do the Position Controlling.

To learn more about this architecture, you can have a look at Minute 7:36 till 10:00 of the Video: https://www.youtube.com/watch?v=LeQuX0OEh9w&ab_channel=SOLOMotorControllers

Posted by: @sberesfo

Can the controller be reset to the factory default settings using Motion Terminal?

Yes, there is a button For that named "Reset Factory". After Reset Factory you need to recycle the power, and then all the settings will go back to default

Posted by: @sberesfo

What are Ki and Kp? I understand that the two trimmer pots on the board act the same way as Ki and Kp in Motion terminal. Is this correct?

Yes, these two are useful when you are in Analogue Mode, and you want to tune the Speed controller, in simple language:

Kp : defines for you how fast your motor should react and reach the speed you asked, so if you increase this value, your motor will be more reactive, but too much of this gain might make vibrations, so you need to tune it enough. Also, another effect of this gain will be how “harshly” the controller ( here SOLO ) should react to the variation of the load on the shaft of the motor to keep the speed constant

Ki: defines how good your motor during the time should reach the goal, so by increasing this value your motor might reach the goal slower but more consistent. Also by increasing this gain too much your motor might get unstable. So you need to tune this similar to Kp with patience and accuracy.

Posted by: @sberesfo

I will read the newly published article and watch the video over the weekend.

 

Great, feel free to ask anything here, I will remain available.

Regards
Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.

ReplyQuote
Posted : 11/04/2021 3:56 pm
Forum 1
(@sberesfo)
Active Member

Hello@milad

I want to report to you my progress. 

1. The values were changing back because I was not pressing the "set" button when I change the current limit and number of poles. Now I understand about the set buttons.

2. Next I read the article about properly connecting the hall and phase wires. I was having trouble reading the performance chart when i spun the motor shaft both CW and CCW by hand. My chart was not as clear as the one in the article. But for this motor i am tuning, I have the data sheet which clearly tells me which hall wires are paired to the corresponding phase wires. To be sure, I ran the hall sensor calibration to make sure the offset value was exactly the same for CW and CCW. So I was doing good so far.

3. Next i went to the 7:36 mark on the video and I tried to check the torque loop of my motor. I tried to enter several values into the Torque Reference_Iq [A] field but I was unable to get the motor to spin. With some of the values, the motor vibrated but the shaft would not spin. 

4. Now I have more questions for you.

Q1. The video does not tell me how to choose the switching frequency. The motors inductance @ 1Khz is listed as 0.165 millihenries. The motor inductance listed on the terminal is 0.0002365 henrys and the listed PWM Frequency [kHz]* is 17.241. Does this have any relevance for why the motor will not work in the torque loop test?

Q2. Is the Encoder Lines* field relevant for Hall sensor motors?

Q3. Is there a general "rule of thumb" for choosing the starting value of Ki and Kp fields?

I will wait for your reply before I play with the speed tuning. 

Thank you, Scott

 

ReplyQuote
Topic starter Posted : 14/04/2021 9:08 pm
Forum 3
(@milad)
Chief Member Moderator

Hi @sberesfo ,

Posted by: @sberesfo

1. The values were changing back because I was not pressing the "set" button when I change the current limit and number of poles. Now I understand about the set buttons.

Great.

Posted by: @sberesfo

2. Next I read the article about properly connecting the hall and phase wires. I was having trouble reading the performance chart when i spun the motor shaft both CW and CCW by hand. My chart was not as clear as the one in the article. But for this motor i am tuning, I have the data sheet which clearly tells me which hall wires are paired to the corresponding phase wires. To be sure, I ran the hall sensor calibration to make sure the offset value was exactly the same for CW and CCW. So I was doing good so far.

Regarding the charts in that article, what is important is the trend of those plots, meaning that, since you are turning the motor manually, you might see some strange shapes with steps, which is fine, but what matters is this:

** When you turn the Motor manually in CCW while the shaft is facing you, you should see the "Angle" is ramping up (stepping up) from a minimum value to a maximum value and then suddenly drops to the minimum value again, and for CW direction the trend is reversed, so you should see from a maximum value it ramps down ( steps down) to a minimum value and then suddenly jumps back up to the maximum value again like a cycle.

This is the universal way of verifying if the order of the wiring of the Hall sensors are correct or not, and what matters here, is what SOLO sees as the feedback from the hall sensors and it might be different from the datasheet, so pls avoid relying on the datasheets as a lot of times the interpretation between companies are different.

This part of the calibration needs to be done and verified before moving to the next section which is finding the right order of wirings of the motor.

Posted by: @sberesfo

3. Next i went to the 7:36 mark on the video and I tried to check the torque loop of my motor. I tried to enter several values into the Torque Reference_Iq [A] field but I was unable to get the motor to spin. With some of the values, the motor vibrated but the shaft would not spin. 

Imagining that you have successfully verified the trend of the "Angle" signal and the Hall sensors are correctly connected, Now in the second step you need to verify the Motor wirings order follow as below:

  1. Connect the Motor to ABC outputs of SOLO in arbitrary order for the first time, record the wires connected to SOLO
  2. select a propper Motor type in Motion terminal ( BLDC-PMSM or BLDC-PMSM ultrafast)
  3. make sure the Number of POLEs for your motor is set correctly ( No# of Poles = 2 * No# of pole pairs )
  4. Make sure Pin No#5 of SOLO is down (you are in a closed-loop) and the Motor is identified
  5. Run the "Hall sensor calibration"
  6. The motor must turn in a Clockwise direction for a couple of seconds and then it stops ( if the motor runs in CCW direction during calibration, you can immediately discard this motor wiring order and check the next one)
  7. after the calibration is done, check the torque loop and the motor should move smoothly in both directions, if this is not true or you only see vibrations, it means you need to change the order of your Motor's wiring to SOLO, so Firstly turn OFF SOLO for safety reasons, try a new order of wirings, and record it, then repeat from step 5 above after turning back SOLO ON. Basically, you will have 6 orders of wirings from SOLO to your Motor to be tested.

So as you see above, every time you change the Motor's wiring, you need to run the "Hall Sensor calibration" newly. 

We made this calibration having in mind that there is no datasheet or anything available from the Motor so SOLO should be able to manage virtually any brushless motor with the same method. once you calibrate and find the right order of wirings for the Hall sensors and the motor, it will be the same for all the motors from that model number, even the calibration values should be very near or the same, so if you have productions, you don't need to run these steps for every single motor, and you just need to tune it properly for 1 motor and use it for all the rest from the same family or model number.

 

Posted by: @sberesfo

Q1. The video does not tell me how to choose the switching frequency. The motors inductance @ 1Khz is listed as 0.165 millihenries. The motor inductance listed on the terminal is 0.0002365 henrys and the listed PWM Frequency [kHz]* is 17.241. Does this have any relevance for why the motor will not work in the torque loop test?

selection of PWM or in another word output switching frequency is a deep topic, but it mainly depends on the inductance of your motor, normally for motors with inductance lower than 150uH you need to select PWM frequencies above 45kHz, and for high inductance motors with values above 400uH to some mili henry the switching frequency below 20kHz should be better. For the Moment you can leave that untouched, or if you want you can put a value like 30kHz and see how the behavior changes. but the main issue with the fact that your motor doesn't turn I suspect that is the wrong order of motor's wirings to ABC outputs of SOLO ( if the Halls are connected properly)

The inductance that SOLO identifies is with an injection of relatively high current (a couple of amps) with high frequency (20kHz) into the motor, so it's more like the real operating condition, however, the measurement with RLC meters are done as you mentioned with 1kHz and low current ( in mili amps range), and as you might now, both current and frequency can play a role in saturation of the stator core and cause the value to be different than low current low-frequency operations, that's why you see a slight difference between what SOLO measures vs what the datasheet says.

Posted by: @sberesfo

. Is the Encoder Lines* field relevant for Hall sensor motors?

No, that's only for applications using Quadrature Incremental Encoders.

Posted by: @sberesfo

Q3. Is there a general "rule of thumb" for choosing the starting value of Ki and Kp fields?

Yes, always start with small values, less than 1.0  😊 , normally the Kp gains are much bigger than Ki gains in the range of 10x or more, so for your tests, you can start by putting the Speed controller Kp gains sth around 0.08 and the ki for 0.002 or near this, and see if the speed controlling is good or not, then you can increase a little bit the Kp and see how the situation evolves, for current controller gains ( Torque controller) for now you can rely on what SOLO identifies automatically for you.

so pls continue as I mentioned and let us know how is the progress. 

Regards
Milad

 

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.

ReplyQuote
Posted : 15/04/2021 8:13 am
Share: