MESA 5i23 7i44 7i49 7i37 8i20
- kenny
- Offline
- Senior Member
- Posts: 56
- Thank you received: 0
Motor at X axis is moved and turn, but totally chaotic...
Hal oscilloscope is very, very powerfull tool.
My problem was: not linked signal "pid.0.enable" from E-stop section. Then PID section was not enabled (not worked) and motors was not turn. Easy.
Yesterday I was "optimizing" parameters PID and resolver section on axis X, but not succes.
Is there any procedure to setting comutate motors, parametrize resolver and basic setting PID? (step by step)
I dont need fine tuning, I need basic + - starting parameters.
I have HW digitally signal generator, oscilloscope, power supply in my workroom (swamp)
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
Is there any procedure to setting comutate motors, parametrize resolver and basic setting PID? (step by step)
I dont need fine tuning, I need basic + - starting parameters.
The first thing to do it to get the motor turning smoothly in one direction and at the same speed in the other direction.
To do this disconnect the PID from the 8i20.current pin. Then set this pin to various values from the command line.
Only when the motor turns smoothly, and at the same speed in both directions, can you start the PID tuning.
The resolver module gives very good velocity data, so checking that 0.2 amps and -0.2 amps gives the same speed is fairly easy.
Please Log in or Create an account to join the conversation.
- kenny
- Offline
- Senior Member
- Posts: 56
- Thank you received: 0
These components was working OK, but previous owner destroyed HDD with EMC2...
Facts:
1) I have ten poles BLDC motor TGN3-0205 ( www.tgdrives.cz/en/servomotors/tgn-series/tgn3/ )
2) This motor have multi-pole resolver.
3) PID I was switch OFF and dont use it temporarily.
These parameters are alright for my HW?
setp bldc.0.scale -559240
setp bldc.0.poles 10
setp bldc.0.lead-angle 0
setp bldc.0.encoder-offset 0
And where parameters I must tuned?
Thank You.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
Do you understand how commutation is meant to work on a brushless motor?Ok, but still I dont understand how I make correct comutation on the BLDC servo.
These parameters are alright for my HW?
setp bldc.0.scale -559240
setp bldc.0.poles 10
setp bldc.0.lead-angle 0
setp bldc.0.encoder-offset 0
I have no way to know what is right for your motor. I think that as your motor and resolver have the same number of poles you probably want to use
setp bldc.0.scale 1677216 (or -1677216)
setp bldc.0.poles 2
setp bldc.0.lead-angle 0
setp bldc.0.encoder-offset (adjust to suit)
In any case you want bldc.rotor-angle to go from 0 to 1 ten times per rev. Once that part is working then it comes down to positive or negative scale and encoder offset.
Please Log in or Create an account to join the conversation.
- kenny
- Offline
- Senior Member
- Posts: 56
- Thank you received: 0
My motor have one pole resolver.
One turn shaft is one sin (cos) wave on the output resolver.
Zero point settings from TG-drives manufacturer:
W phase to +
V phase to -
U phase no connect
Then resolver is in zero position.
How can I this informations correctly implement to my HAL?
Thank
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
Last information from TG-drives manufacturer:
My motor have one pole resolver.
That doesn't fit with the earlier statement:
variable: hm2_5i23.0.resolver.00.angle is changed value between 0 an 1 every change mag. pole of motor (10 per rev.)
variable: hm2_5i23.0.8i20.0.0.angle is changed value between 0 and 1 every one turn shaft of motor
The resolver.angle comes directly from the resolver driver, independent of any scaling factors.
If that is the case then you should use 16777216 or -16777216 as the bldc.scale and 10 as the pole count.
Zero point settings from TG-drives manufacturer:
W phase to +
V phase to -
U phase no connect
Then resolver is in zero position.
Mesa assumes that zero is with U +, V - , W -.
U | V | W | Angle | Offset |
+ | - | - | 0 | 0 |
+ | 0 | - | 30 | 1398101 |
+ | + | - | 60 | 2796202 |
0 | + | - | 90 | 4194304 |
- | + | - | 120 | 5592405 |
- | + | 0 | 150 | 6990506 |
- | + | + | 180 | 8388608 |
- | 0 | + | 210 | 9786709 |
- | - | + | 240 | 11184810 |
0 | - | + | 270 | 12582912 |
+ | - | + | 300 | 13981013 |
+ | - | 0 | 330 | 15379114 |
So, looking at the difference I would expect the required encoder offset to be 12582912, -12582912, 4194304 or -4194304. (some of these are equivalent)
Please Log in or Create an account to join the conversation.
- kenny
- Offline
- Senior Member
- Posts: 56
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
If you feel like it you could check this with a current-limited PSU and halmeter.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
Looking at the code on line 627 of the bldc component:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6222c928c61a38c#l679
It is apparent that the offset is subtracted before the "poles" calculation.
This means that it would be correct if you measured the offset. (ie, rotate the motor by hand to rawcounts=0, then energise U+ V- W- and note the new rawcounts) but that the table above needs to be divided by 5 for a 10-pole motor.
It might be simplest to measure the offset, really. Though be aware that I am not sure whether to use the number returned by the test, or its negative.
This is a more complete table, and I think it finally explains to me the -950000 offset that my motors need to move, it seems to hint that the 6-pole motors have resolvers aligned to U-V+W-.
U | V | W | Angle | 2-pole | 4-pole | 6-pole | 8-pole | 10-pole | 12-pole |
+ | - | - | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
+ | 0 | - | 30 | 1398101 | 699050 | 233016 | 58254 | 11650 | 1941 |
+ | + | - | 60 | 2796202 | 1398101 | 466033 | 116508 | 23301 | 3883 |
0 | + | - | 90 | 4194304 | 2097152 | 699050 | 174762 | 34952 | 5825 |
- | + | - | 120 | 5592405 | 2796202 | 932067 | 233016 | 46603 | 7767 |
- | + | 0 | 150 | 6990506 | 3495253 | 1165084 | 291271 | 58254 | 9709 |
- | + | + | 180 | 8388608 | 4194304 | 1398101 | 349525 | 69905 | 11650 |
- | 0 | + | 210 | 9786709 | 4893354 | 1631118 | 407779 | 81555 | 13592 |
- | - | + | 240 | 11184810 | 5592405 | 1864135 | 466033 | 93206 | 15534 |
0 | - | + | 270 | 12582912 | 6291456 | 2097152 | 524288 | 104857 | 17476 |
+ | - | + | 300 | 13981013 | 6990506 | 2330168 | 582542 | 116508 | 19418 |
+ | - | 0 | 330 | 15379114 | 7689557 | 2563185 | 640796 | 128159 | 21359 |
Please Log in or Create an account to join the conversation.
- kenny
- Offline
- Senior Member
- Posts: 56
- Thank you received: 0
Last night I won the battle with BLDC servo. Because I understand cca 1% of the EMC2.
Motor now turn precise and smoothly. juhuuuu
Very, very thank You Andy
setp bldc.0.scale 16777216
setp bldc.0.poles 10
setp bldc.0.lead-angle 0
setp bldc.0.encoder-offset 12582912
PGAIN = 60
IGAIN = 30
DGAIN = 0.25
DEADBAND = 0
FF0 = 0
FF1 = 0
FF2 = 0
BIAS = 0
Questions:
My motors have nominal current is: 3A and maximal current is 12,7A
Where is it set?
And where is set max. (limit) speed for each axis?
Thank you
The last battle started now. I linked hw signals eg. limit, ref, e-stop etc...
Please Log in or Create an account to join the conversation.