Author Topic: Brushed DC motor closed loop speed control  (Read 4248 times)

0 Members and 3 Guests are viewing this topic.

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #50 on: June 21, 2024, 03:41:06 pm »
By now the switch-off of the mosfet has improved a lot. It has been reduced from 6us to 1.5us. It is still high, but it is not going to cause worrying heating of the mosfet.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #51 on: June 22, 2024, 10:20:13 am »
With the back-emf control the motor rotates precisely at the reference speed, even at speeds below 1% of the nominal speed.

I post also the program used with Arduino (with PID control not well tuned).

I am not using current measurement, nor do I need to.


Code: [Select]
const int PIN_PWM = 10;
const int PIN_CURRENT = A0;
const int PIN_EMF = A1;
const int PWM_MAX = 2000;

volatile int motor_speed;
volatile int motor_voltage;
volatile char timer1_compb;

int emf;
int error = 0;
int error_old = 0;
int PID_control = 0;
int PID_proportional = 0;
int PID_derivative = 0;
int PID_integral = 0;
int PID_kp = 100;
int PID_kd = PID_kp / 2;
int PID_ki = PID_kp / 2;

void setup() {
  pinMode(PIN_PWM, OUTPUT);
  timer1_setup();
}

void loop() {
   motor_voltage = 100;
   motor_speed = 10;
   
   while(1) {
      delay(18);

      for(timer1_compb = 0; timer1_compb == 0;); // Wait for end of PWM pulse
      DDRB &= ~(1 << (PIN_PWM-8));   // Set PIN PWM as input
      delayMicroseconds(1500);      // Wait disipate motor current
      emf = analogRead(PIN_EMF);    // Read back-emf voltage

      // PID
      error = motor_speed - emf;
      PID_proportional = PID_kp * error;
      PID_derivative = PID_kd * (error - error_old);
      PID_integral += PID_ki * error;
      if (PID_integral < -PWM_MAX)
         PID_integral = -PWM_MAX;
      if (PID_integral > PWM_MAX*16)
         PID_integral = PWM_MAX*16;
      motor_voltage = (PID_proportional + PID_integral + PID_derivative)/16;
      if (motor_voltage < 0)
         motor_voltage = 0;
      if (motor_voltage >= PWM_MAX)
         motor_voltage = PWM_MAX-1;
      error_old = error;
         
      OCR1B = motor_voltage;
     
      // Activate timer1 PWM
      timer1_setup();
   }
}


void timer1_setup(void) {
  // Fast PWM top at OCR2A
  TCCR1A = bit (WGM10) | bit (WGM11) | bit (COM1B1); // fast PWM, clear OC1B on compare
  TCCR1B = bit (WGM12) | bit (WGM13) | 0b010;   // fast PWM, prescaler = 4
  TIMSK1 |= 0b00000100;       // Set OCIE1B to 1 -> compare match
  OCR1A = PWM_MAX - 1;
  TCNT1 = OCR1A - 1;
  DDRB |= (1 << (PIN_PWM-8));  // Set PIN PWM as output
}


ISR(TIMER1_COMPB_vect) {
   timer1_compb = 1;  // End of PWM positive Pulse
}
« Last Edit: June 22, 2024, 10:28:13 am by Picuino »
 
The following users thanked this post: pardo-bsso

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #52 on: June 22, 2024, 06:18:57 pm »
With a program that displays various internal values, the operation of the controller can be better checked better:

Code: [Select]
const int PIN_PWM = 10;
const int PIN_CURRENT = A0;
const int PIN_EMF = A1;
const int PWM_MAX = 2000;

volatile int motor_speed;
volatile int motor_voltage;
volatile char timer1_compb;

int emf;
int error = 0;
int error_old = 0;
int PID_control = 0;
int PID_proportional = 0;
int PID_derivative = 0;
int PID_integral = 0;
int PID_kp = 10;
int PID_ki = 5;
int PID_kd = 10;

void setup() {
  Serial.begin(115200);
  pinMode(PIN_PWM, OUTPUT);
  timer1_setup();
}

void loop() {
  motor_voltage = 100;
  motor_speed = 30;

  while (1) {
    Serial.print(emf);
    Serial.print("\t");
    Serial.print(PID_proportional);
    Serial.print("\t");
    Serial.print(PID_integral);
    Serial.print("\t");
    Serial.print(PID_derivative);
    Serial.println();
    delay(10);

    for (timer1_compb = 0; timer1_compb == 0;); // Wait for end of PWM pulse
    DDRB &= ~(1 << (PIN_PWM - 8)); // Set PIN PWM as input
    delayMicroseconds(1500);      // Wait disipate motor current
    emf = analogRead(PIN_EMF);    // Read back-emf voltage

    // PID
    error = motor_speed - emf;
    PID_proportional = PID_kp * error;
    PID_derivative = PID_kd * (error - error_old);
    PID_integral += PID_ki * error;
    if (PID_integral < -PWM_MAX * 8)
      PID_integral = -PWM_MAX * 8;
    if (PID_integral > PWM_MAX * 8)
      PID_integral = PWM_MAX * 8;
    motor_voltage = (PID_proportional + PID_integral + PID_derivative) / 8;
    if (motor_voltage < 0)
      motor_voltage = 0;
    if (motor_voltage >= PWM_MAX)
      motor_voltage = PWM_MAX - 1;
    error_old = error;

    OCR1B = motor_voltage;

    // Activate timer1 PWM
    timer1_setup();
  }
}


void timer1_setup(void) {
  // Fast PWM top at OCR2A
  TCCR1A = bit (WGM10) | bit (WGM11) | bit (COM1B1); // fast PWM, clear OC1B on compare
  TCCR1B = bit (WGM12) | bit (WGM13) | 0b010;   // fast PWM, prescaler = 4
  TIMSK1 |= 0b00000100;       // Set OCIE1B to 1 -> compare match
  OCR1A = PWM_MAX - 1;
  TCNT1 = OCR1A - 1;
  DDRB |= (1 << (PIN_PWM - 8)); // Set PIN PWM as output
}


ISR(TIMER1_COMPB_vect) {
  timer1_compb = 1;  // End of PWM positive Pulse
}

I have checked that there is a small speed error. The more the motor shaft is braked, the faster it turns.  It should be compensated so that higher values of the integral component reduce the measured back-emf value a little. Since I don't have any actual shaft speed meter or any method to accurately brake the shaft, I leave that job to someone else who wants to make further progress on the subject.

The conclusion I have reached is that back-emf control of speed is superior to current compensation control.

It remains to be checked how the two controls behave acting simultaneously, because at low revolutions the back-emf control has a certain oscillation that it would be desirable to eliminate and possibly it can be achieved with a combined control.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3552
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #53 on: June 24, 2024, 04:24:30 pm »
Oscillations are likely due to a not very well adjusted PID controller. I don't know how much experience you have with those, but they can be finicky to learn to set them up properly. Another possibility is that you simply do not have enough resolution to measure the back EMF properly at low speed. I guess it's not going to be (much) better when using both algorithms.

It is useful to measure the motor current. You can use it for overload protection (also note that short overloads (up to about 200% or 300% of the nominal motor current) can be acceptable, but the motor will overheat over time. With a uC you can keep track of the motor current, and extrapolate motor temperature (with temperature decay when current is lower) These will be rough estimates, but you can get a lot more torque out of your motor for short durations, compared with a hard cut off with the comparator as soon as the motor current exceeds a limit.

For your software...
I don't like "arduino programming". One thing that looks suspicious is to call timer1_setup() repeatedly inside your while loop. And why have a while(1) loop at all? The silly arduino thing already does this in the loop() function.

I am also not sure whether your detection of the end of the PWM pulse works, and why are you switching the PWM pin to input?

Also very arduino are software delay loops. Any ISR's during such a delay will increase the delay, and this will have an influence on the timing of the PID loops. The I and D parts of a PID are timing sensitive, and timing variation will decrease it's accuracy.

You have measured mosfet switch time (as long as the thing does not get too hot then it's OK) so I assume you have an oscilloscope. You can use an arduino pin, set it to an output, set it when an ADC conversion starts, and clear it again when it finishes. This lets you verify the sampling with the back EMF voltage so you can see whether you are measuring a stable back EMF voltage. It's a simple but useful debugging trick.

I started programming long before arduino, and would use another approach.
1. Have a timer tick ISR that starts an ADC conversion.
2. When ADC conversion is complete, run the PID loop and start a single PWM pulse.

This guarantees consistent timing for an accurate PID loop, and it leaves your main loop completely free to do regular tasks such as handling user I/O. It is more work to set up, as you need to know more details about your microcontroller, but once set up properly the software is not much more complex.
« Last Edit: June 24, 2024, 04:31:10 pm by Doctorandus_P »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3552
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #54 on: June 24, 2024, 05:10:54 pm »
Another Idea:

You can add another voltage "divider" to measure the back EMF, but in this case use a resistor, and either a zener to GND or a skottky diode to Vcc. This gives you a 5x higher resolution to measure low back EMF and may improve PID accuracy for low RPM.

And another thing I forgot to ask:
How low can you go now with your RPM in comparison to your other methods? How far are you from your desired goal?
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #55 on: June 24, 2024, 06:06:43 pm »
Oscillations are likely due to a not very well adjusted PID controller. I don't know how much experience you have with those, but they can be finicky to learn to set them up properly. Another possibility is that you simply do not have enough resolution to measure the back EMF properly at low speed. I guess it's not going to be (much) better when using both algorithms.

I am not sure what the oscillations are due to. The PID I think is fine tuned. I will try to post the results returned by the microcontroller to see if they show anything I am not seeing.



I don't like "arduino programming". One thing that looks suspicious is to call timer1_setup() repeatedly inside your while loop. And why have a while(1) loop at all? The silly arduino thing already does this in the loop() function.
True, but I'm used to creating my own while(1) which usually takes much less time to cycle than the Arduino's loop().


I am also not sure whether your detection of the end of the PWM pulse works, and why are you switching the PWM pin to input?
The interruption starts just when the PWM pulse ends. The interrupt sets a variable which is then sampled by polling in the main loop.

Once the PWM pulse ends, it waits for the motor current to reduce to zero and the back-emf voltage is measured. The PWM duty cycle is recalculated and then Timer1 is reset to start another PWM pulse at this exact moment.


Also very arduino are software delay loops. Any ISR's during such a delay will increase the delay, and this will have an influence on the timing of the PID loops. The I and D parts of a PID are timing sensitive, and timing variation will decrease it's accuracy.
Yes, it is true. I just hope the times don't vary too much from cycle to cycle. The error cannot be very large (I estimate that there can be a maximum error of 5%).


You have measured mosfet switch time (as long as the thing does not get too hot then it's OK) so I assume you have an oscilloscope. You can use an arduino pin, set it to an output, set it when an ADC conversion starts, and clear it again when it finishes. This lets you verify the sampling with the back EMF voltage so you can see whether you are measuring a stable back EMF voltage. It's a simple but useful debugging trick.
I am going to try it.

I started programming long before arduino, and would use another approach.
1. Have a timer tick ISR that starts an ADC conversion.
2. When ADC conversion is complete, run the PID loop and start a single PWM pulse.

This guarantees consistent timing for an accurate PID loop, and it leaves your main loop completely free to do regular tasks such as handling user I/O. It is more work to set up, as you need to know more details about your microcontroller, but once set up properly the software is not much more complex.
For now I was just testing the ability to control the motor with a simple program.
« Last Edit: June 24, 2024, 06:08:39 pm by Picuino »
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #56 on: June 24, 2024, 06:16:35 pm »
How low can you go now with your RPM in comparison to your other methods? How far are you from your desired goal?

My goal (actually Martinn's) was to achieve a speed of 1% of nominal with stability.
In a 24-volt motor, which typically has about 12-18 volts back-emf at rated operation, that means maintaining a back-emf voltage of about 150mV.
After the voltage divider this voltage become 27mV, about 5-6 ADC points with ADC reference voltage at 5V.
(If I lower the ADC reference voltage to 1.1 volts, then that would be about 25 ADC points).
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #57 on: June 24, 2024, 06:47:20 pm »
New program more verbose. Cycle time = 10ms:

Code: [Select]
const int PIN_PWM = 10;
const int PIN_CURRENT = A0;
const int PIN_EMF = A1;
const int PWM_MAX = 2000;
const int PWM_SCALE = 4;

volatile int motor_speed;
volatile int motor_voltage;
volatile char timer1_compb;

int emf;
int error = 0;
int error_old = 0;
int PID_control = 0;
int PID_proportional = 0;
int PID_derivative = 0;
int PID_integral = 0;
int PID_kp = 25;
int PID_ki = 10;
int PID_kd = 10;

void setup() {
  Serial.begin(115200);
  pinMode(PIN_PWM, OUTPUT);
  timer1_setup();
}

void loop() {
  motor_voltage = 100;
  motor_speed = 5;

  Serial.print("emf\tP\tI\tD\tmillis\n");
  while (1) {
    Serial.print(emf);
    Serial.print("\t");
    Serial.print(PID_proportional);
    Serial.print("\t");
    Serial.print(PID_integral);
    Serial.print("\t");
    Serial.print(PID_derivative);
    Serial.print("\t");
    Serial.print(millis());
    Serial.println();
    delay(7);

    for (timer1_compb = 0; timer1_compb == 0;); // Wait for end of PWM pulse
    DDRB &= ~(1 << (PIN_PWM - 8)); // Set PIN PWM as input
    delayMicroseconds(1500);      // Wait disipate motor current
    emf = analogRead(PIN_EMF);    // Read back-emf voltage

    // PID
    error = motor_speed - emf;
    PID_proportional = PID_kp * error;
    PID_derivative = PID_kd * (error - error_old);
    PID_integral += PID_ki * error;
    if (PID_integral < -PWM_MAX * PWM_SCALE)
      PID_integral = -PWM_MAX * PWM_SCALE;
    if (PID_integral > PWM_MAX * PWM_SCALE)
      PID_integral = PWM_MAX * PWM_SCALE;
    motor_voltage = (PID_proportional + PID_integral + PID_derivative) / PWM_SCALE;
    if (motor_voltage < 0)
      motor_voltage = 0;
    if (motor_voltage >= PWM_MAX)
      motor_voltage = PWM_MAX - 1;
    error_old = error;

    OCR1B = motor_voltage;

    // Activate timer1 PWM
    timer1_setup();
  }
}


void timer1_setup(void) {
  // Fast PWM top at OCR2A
  TCCR1A = bit (WGM10) | bit (WGM11) | bit (COM1B1); // fast PWM, clear OC1B on compare
  TCCR1B = bit (WGM12) | bit (WGM13) | 0b010;   // fast PWM, prescaler = 4
  TIMSK1 |= 0b00000100;       // Set OCIE1B to 1 -> compare match
  OCR1A = PWM_MAX - 1;
  TCNT1 = OCR1A - 1;
  DDRB |= (1 << (PIN_PWM - 8)); // Set PIN PWM as output
}


ISR(TIMER1_COMPB_vect) {
  timer1_compb = 1;  // End of PWM positive Pulse
}



Output of the program incrementing the brake from nothing to high brake:
Code: [Select]
emf P I D millis
0 0 0 0 0
0 125 50 50 33
0 125 100 0 43
0 125 150 0 53
0 125 200 0 62
0 125 250 0 71
0 125 300 0 81
2 75 330 -20 91
1 100 370 10 101
1 100 410 0 110
0 125 460 10 120
0 125 510 0 130
1 100 550 -10 140
4 25 560 -30 149
8 -75 530 -40 159
10 -125 480 -20 168
7 -50 460 30 179
9 -100 420 -20 188
13 -200 340 -40 198
14 -225 250 -10 207
8 -75 220 60 217
5 0 220 30 227
0 125 270 50 236
1 100 310 -10 246
0 125 360 10 256
0 125 410 0 266
0 125 460 0 275
2 75 490 -20 285
5 0 490 -30 294
8 -75 460 -30 304
10 -125 410 -20 314
8 -75 380 20 323
11 -150 320 -30 333
14 -225 230 -30 343
9 -100 190 50 353
4 25 200 50 362
2 75 230 20 371
1 100 270 10 381
0 125 320 10 391
0 125 370 0 401
0 125 420 0 410
0 125 470 0 420
2 75 500 -20 430
4 25 510 -20 440
8 -75 480 -40 449
10 -125 430 -20 459
8 -75 400 20 468
10 -125 350 -20 479
14 -225 260 -40 488
13 -200 180 10 497
7 -50 160 60 507
2 75 190 50 517
1 100 230 10 527
0 125 280 10 536
0 125 330 0 546
0 125 380 0 556
0 125 430 0 565
2 75 460 -20 575
5 0 460 -30 584
8 -75 430 -30 594
10 -125 380 -20 604
8 -75 350 20 614
11 -150 290 -30 623
13 -200 210 -20 633
8 -75 180 50 643
4 25 190 40 652
3 50 210 10 662
0 125 260 30 671
0 125 310 0 681
0 125 360 0 691
0 125 410 0 701
0 125 460 0 710
0 125 510 0 720
3 50 530 -30 730
6 -25 520 -30 740
10 -125 470 -40 749
10 -125 420 0 759
7 -50 400 30 769
11 -150 340 -40 779
15 -250 240 -40 788
11 -150 180 40 797
6 -25 170 50 807
1 100 210 50 817
0 125 260 10 827
0 125 310 0 836
0 125 360 0 845
0 125 410 0 856
0 125 460 0 865
2 75 490 -20 875
2 75 520 0 884
8 -75 490 -60 894
9 -100 450 -10 904
10 -125 400 -10 914
9 -100 360 10 923
14 -225 270 -50 933
11 -150 210 30 943
4 25 220 70 952
3 50 240 10 962
0 125 290 30 971
0 125 340 0 982
0 125 390 0 991
0 125 440 0 1001
1 100 480 -10 1010
2 75 510 -10 1020
6 -25 500 -40 1030
10 -125 450 -40 1040
9 -100 410 10 1049
7 -50 390 20 1058
11 -150 330 -40 1069
15 -250 230 -40 1078
11 -150 170 40 1088
5 0 170 60 1097
2 75 200 30 1107
0 125 250 20 1117
1 100 290 -10 1127
0 125 340 10 1136
0 125 390 0 1145
1 100 430 -10 1156
4 25 440 -30 1165
7 -50 420 -30 1175
8 -75 390 -10 1184
9 -100 350 -10 1195
7 -50 330 20 1204
12 -175 260 -50 1214
12 -175 190 0 1223
7 -50 170 50 1232
3 50 190 40 1243
2 75 220 10 1252
0 125 270 20 1262
0 125 320 0 1271
0 125 370 0 1282
0 125 420 0 1291
0 125 470 0 1301
3 50 490 -30 1310
5 0 490 -20 1319
10 -125 440 -50 1330
8 -75 410 20 1339
8 -75 380 0 1349
9 -100 340 -10 1358
14 -225 250 -50 1369
12 -175 180 20 1378
6 -25 170 60 1388
3 50 190 30 1397
0 125 240 30 1406
0 125 290 0 1417
0 125 340 0 1426
0 125 390 0 1436
0 125 440 0 1445
2 75 470 -20 1456
3 50 490 -10 1465
10 -125 440 -70 1475
9 -100 400 10 1484
9 -100 360 0 1495
9 -100 320 0 1504
13 -200 240 -40 1514
10 -125 190 30 1523
4 25 200 60 1532
2 75 230 20 1543
0 125 280 20 1552
1 100 320 -10 1562
0 125 370 10 1571
0 125 420 0 1582
0 125 470 0 1591
0 125 520 0 1600
1 100 560 -10 1610
5 0 560 -40 1619
8 -75 530 -30 1630
10 -125 480 -20 1639
7 -50 460 30 1649
10 -125 410 -30 1658
14 -225 320 -40 1669
13 -200 240 10 1678
6 -25 230 70 1688
4 25 240 20 1697
0 125 290 40 1707
0 125 340 0 1717
0 125 390 0 1726
0 125 440 0 1736
1 100 480 -10 1745
4 25 490 -30 1756
6 -25 480 -20 1765
9 -100 440 -30 1775
8 -75 410 10 1784
8 -75 380 0 1795
12 -175 310 -40 1804
12 -175 240 0 1814
5 0 240 70 1823
4 25 250 10 1832
2 75 280 20 1843
0 125 330 20 1852
0 125 380 0 1862
0 125 430 0 1871
0 125 480 0 1882
1 100 520 -10 1891
2 75 550 -10 1901
8 -75 520 -60 1910
10 -125 470 -20 1921
8 -75 440 20 1930
7 -50 420 10 1939
14 -225 330 -70 1949
13 -200 250 10 1958
7 -50 230 60 1969
4 25 240 30 1978
1 100 280 30 1988
0 125 330 10 1997
0 125 380 0 2007
0 125 430 0 2017
0 125 480 0 2026
3 50 500 -30 2036
4 25 510 -10 2045
10 -125 460 -60 2056
7 -50 440 30 2065
9 -100 400 -20 2075
9 -100 360 0 2084
12 -175 290 -30 2095
7 -50 270 50 2104
3 50 290 40 2113
3 50 310 0 2123
0 125 360 30 2132
0 125 410 0 2143
0 125 460 0 2152
0 125 510 0 2162
0 125 560 0 2171
0 125 610 0 2182
5 0 610 -50 2191
9 -100 570 -40 2201
10 -125 520 -10 2210
7 -50 500 30 2221
10 -125 450 -30 2230
14 -225 360 -40 2240
10 -125 310 40 2249
6 -25 300 40 2258
3 50 320 30 2269
1 100 360 20 2278
0 125 410 10 2288
0 125 460 0 2297
0 125 510 0 2308
0 125 560 0 2317
0 125 610 0 2327
6 -25 600 -60 2336
6 -25 590 0 2347
10 -125 540 -40 2356
7 -50 520 30 2366
12 -175 450 -50 2375
11 -150 390 10 2385
7 -50 370 40 2395
4 25 380 30 2404
3 50 400 10 2414
1 100 440 20 2423
0 125 490 10 2434
0 125 540 0 2443
0 125 590 0 2453
2 75 620 -20 2462
5 0 620 -30 2472
11 -150 560 -60 2482
7 -50 540 40 2492
8 -75 510 -10 2501
9 -100 470 -10 2511
13 -200 390 -40 2521
8 -75 360 50 2530
6 -25 350 20 2540
3 50 370 30 2549
0 125 420 30 2560
1 100 460 -10 2569
0 125 510 10 2579
0 125 560 0 2588
6 -25 550 -60 2598
6 -25 540 0 2608
8 -75 510 -20 2618
6 -25 500 20 2627
8 -75 470 -20 2637
12 -175 400 -40 2647
7 -50 380 50 2657
5 0 380 20 2666
4 25 390 10 2675
0 125 440 40 2685
1 100 480 -10 2695
0 125 530 10 2705
0 125 580 0 2714
0 125 630 0 2724
4 25 640 -40 2734
9 -100 600 -50 2744
8 -75 570 10 2753
8 -75 540 0 2763
7 -50 520 10 2772
13 -200 440 -60 2783
9 -100 400 40 2792
7 -50 380 20 2802
3 50 400 40 2811
2 75 430 10 2821
0 125 480 20 2831
0 125 530 0 2840
0 125 580 0 2850
0 125 630 0 2860
2 75 660 -20 2870
6 -25 650 -40 2879
10 -125 600 -40 2889
7 -50 580 30 2898
9 -100 540 -20 2909
12 -175 470 -30 2918
9 -100 430 30 2928
5 0 430 40 2937
3 50 450 20 2948
1 100 490 20 2957
0 125 540 10 2967
0 125 590 0 2976
0 125 640 0 2985
0 125 690 0 2996
0 125 740 0 3006
8 -75 710 -80 3015
7 -50 690 10 3025
9 -100 650 -20 3035
6 -25 640 30 3044
14 -225 550 -80 3054
12 -175 480 20 3063
6 -25 470 60 3074
6 -25 460 0 3083
1 100 500 50 3093
0 125 550 10 3102
0 125 600 0 3112
0 125 650 0 3122
1 100 690 -10 3132
6 -25 680 -50 3141
8 -75 650 -20 3151
7 -50 630 10 3161
8 -75 600 -10 3171
12 -175 530 -40 3180
9 -100 490 30 3190
5 0 490 40 3200
5 0 490 0 3209
1 100 530 40 3219
1 100 570 0 3228
0 125 620 10 3238
0 125 670 0 3248
0 125 720 0 3258
4 25 730 -40 3267
8 -75 700 -40 3277
8 -75 670 0 3287
8 -75 640 0 3297
7 -50 620 10 3306
14 -225 530 -70 3316
8 -75 500 60 3325
7 -50 480 10 3336
2 75 510 50 3345
1 100 550 10 3355
0 125 600 10 3364
0 125 650 0 3375
0 125 700 0 3384
0 125 750 0 3394
10 -125 700 -100 3403
6 -25 690 40 3414
10 -125 640 -40 3423
6 -25 630 40 3433
13 -200 550 -70 3442
5 0 550 80 3452
7 -50 530 -20 3462
2 75 560 50 3471
0 125 610 20 3481
0 125 660 0 3490
0 125 710 0 3501
0 125 760 0 3510
0 125 810 0 3520
5 0 810 -50 3529
11 -150 750 -60 3539
6 -25 740 50 3550
10 -125 690 -40 3559
10 -125 640 0 3569
12 -175 570 -20 3578
5 0 570 70 3588
6 -25 560 -10 3598
0 125 610 60 3607
0 125 660 0 3617
0 125 710 0 3627
0 125 760 0 3637
0 125 810 0 3646
0 125 860 0 3656
9 -100 820 -90 3666
6 -25 810 30 3676
9 -100 770 -30 3685
8 -75 740 10 3695
13 -200 660 -50 3705
5 0 660 80 3715
7 -50 640 -20 3724
3 50 660 40 3734
0 125 710 30 3743
0 125 760 0 3753
0 125 810 0 3763
6 -25 800 -60 3773
9 -100 760 -30 3782
7 -50 740 20 3792
7 -50 720 0 3802
11 -150 660 -40 3812
10 -125 610 10 3821
7 -50 590 30 3831
4 25 600 30 3841
2 75 630 20 3851
0 125 680 20 3860
0 125 730 0 3870
0 125 780 0 3879
6 -25 770 -60 3890
7 -50 750 -10 3899
6 -25 740 10 3909
8 -75 710 -20 3918
8 -75 680 0 3929
11 -150 620 -30 3938
3 50 640 80 3948
7 -50 620 -40 3957
0 125 670 70 3968
0 125 720 0 3977
0 125 770 0 3987
0 125 820 0 3996
0 125 870 0 4006
18 -325 740 -180 4016
0 125 790 180 4026
17 -300 670 -170 4035
7 -50 650 100 4045
11 -150 590 -40 4055
3 50 610 80 4065
5 0 610 -20 4074
0 125 660 50 4084
0 125 710 0 4093
0 125 760 0 4104
0 125 810 0 4113
0 125 860 0 4123
0 125 910 0 4132
10 -125 860 -100 4143
7 -50 840 30 4152
9 -100 800 -20 4162
10 -125 750 -10 4171
10 -125 700 0 4182
5 0 700 50 4191
5 0 700 0 4200
0 125 750 50 4210
0 125 800 0 4220
0 125 850 0 4230
0 125 900 0 4240
1 100 940 -10 4249
11 -150 880 -100 4259
3 50 900 80 4269
11 -150 840 -80 4279
6 -25 830 50 4288
16 -275 720 -100 4298
5 0 720 110 4307
8 -75 690 -30 4318
0 125 740 80 4327
0 125 790 0 4337
0 125 840 0 4346
0 125 890 0 4357
1 100 930 -10 4366
10 -125 880 -90 4376
4 25 890 60 4385
10 -125 840 -60 4396
9 -100 800 10 4405
9 -100 760 0 4415
5 0 760 40 4424
5 0 760 0 4434
0 125 810 50 4444
0 125 860 0 4454
0 125 910 0 4463
5 0 910 -50 4473
8 -75 880 -30 4483
7 -50 860 10 4493
7 -50 840 0 4502
10 -125 790 -30 4512
10 -125 740 0 4521
6 -25 730 40 4532
5 0 730 10 4541
0 125 780 50 4551
0 125 830 0 4560
0 125 880 0 4571
0 125 930 0 4580
0 125 980 0 4590
15 -250 880 -150 4600
0 125 930 150 4610
16 -275 820 -160 4620
5 0 820 110 4629
8 -75 790 -30 4638
3 50 810 50 4648
0 125 860 30 4658
0 125 910 0 4668
0 125 960 0 4677
0 125 1010 0 4687
0 125 1060 0 4698
13 -200 980 -130 4707
3 50 1000 100 4717
13 -200 920 -100 4726
7 -50 900 60 4737
13 -200 820 -60 4746
3 50 840 100 4756
6 -25 830 -30 4765
0 125 880 60 4775
0 125 930 0 4785
0 125 980 0 4795
0 125 1030 0 4804
0 125 1080 0 4814
0 125 1130 0 4824
12 -175 1060 -120 4834
4 25 1070 80 4843
13 -200 990 -90 4853
9 -100 950 40 4864
7 -50 930 20 4873
6 -25 920 10 4883
0 125 970 60 4892
0 125 1020 0 4902
6 -25 1010 -60 4912
6 -25 1000 0 4922
9 -100 960 -30 4931
4 25 970 50 4941
14 -225 880 -100 4951
6 -25 870 80 4961
8 -75 840 -20 4970
3 50 860 50 4980
0 125 910 30 4989
0 125 960 0 5000
0 125 1010 0 5009
5 0 1010 -50 5019
8 -75 980 -30 5028
5 0 980 30 5039
9 -100 940 -40 5048
8 -75 910 10 5058
5 0 910 30 5067
5 0 910 0 5078
0 125 960 50 5087
0 125 1010 0 5097
0 125 1060 0 5107
0 125 1110 0 5116
15 -250 1010 -150 5127
0 125 1060 150 5136
17 -300 940 -170 5146
4 25 950 130 5155
13 -200 870 -90 5166
0 125 920 130 5175
4 25 930 -40 5185
0 125 980 40 5194
0 125 1030 0 5204
0 125 1080 0 5214
0 125 1130 0 5224
0 125 1180 0 5233
14 -225 1090 -140 5243
0 125 1140 140 5254
14 -225 1050 -140 5263
6 -25 1040 80 5273
9 -100 1000 -30 5282
0 125 1050 90 5293
0 125 1100 0 5302
0 125 1150 0 5312
0 125 1200 0 5321
7 -50 1180 -70 5331
5 0 1180 20 5341
7 -50 1160 -20 5351
6 -25 1150 10 5361
15 -250 1050 -90 5370
2 75 1080 130 5381
8 -75 1050 -60 5390
0 125 1100 80 5400
0 125 1150 0 5409
0 125 1200 0 5420
9 -100 1160 -90 5429
2 75 1190 70 5439
14 -225 1100 -120 5449
6 -25 1090 80 5458
5 0 1090 10 5468
8 -75 1060 -30 5478
0 125 1110 80 5488
0 125 1160 0 5497
0 125 1210 0 5508
7 -50 1190 -70 5517
7 -50 1170 0 5527
7 -50 1150 0 5536
10 -125 1100 -30 5547
9 -100 1060 10 5556
0 125 1110 90 5566
11 -150 1050 -110 5576
0 125 1100 110 5585
0 125 1150 0 5596
0 125 1200 0 5605
12 -175 1130 -120 5615
1 100 1170 110 5624
15 -250 1070 -140 5635
3 50 1090 120 5644
0 125 1140 30 5654
9 -100 1100 -90 5663
0 125 1150 90 5673
0 125 1200 0 5683
0 125 1250 0 5693
0 125 1300 0 5703
0 125 1350 0 5712
21 -400 1190 -210 5723
0 125 1240 210 5732
11 -150 1180 -110 5742
9 -100 1140 20 5751
4 25 1150 50 5762
0 125 1200 40 5771
0 125 1250 0 5781
0 125 1300 0 5791
0 125 1350 0 5800
14 -225 1260 -140 5811
0 125 1310 140 5820
16 -275 1200 -160 5830
0 125 1250 160 5839
0 125 1300 0 5850
7 -50 1280 -70 5860
0 125 1330 70 5869
16 -275 1220 -160 5879
0 125 1270 160 5889
15 -250 1170 -150 5899
3 50 1190 120 5908
0 125 1240 30 5918
14 -225 1150 -140 5928
0 125 1200 140 5938
0 125 1250 0 5948
0 125 1300 0 5957
15 -250 1200 -150 5967
0 125 1250 150 5977
11 -150 1190 -110 5987
0 125 1240 110 5996
0 125 1290 0 6006
0 125 1340 0 6016
0 125 1390 0 6026
25 -500 1190 -250 6036
0 125 1240 250 6045
17 -300 1120 -170 6055
0 125 1170 170 6065
0 125 1220 0 6075
0 125 1270 0 6084
0 125 1320 0 6094
10 -125 1270 -100 6105
2 75 1300 80 6114
11 -150 1240 -90 6124
7 -50 1220 40 6133
0 125 1270 70 6144
0 125 1320 0 6153
0 125 1370 0 6163
6 -25 1360 -60 6172
4 25 1370 20 6182
6 -25 1360 -20 6193
6 -25 1350 0 6202
14 -225 1260 -80 6212
0 125 1310 140 6221
0 125 1360 0 6232
0 125 1410 0 6241
13 -200 1330 -130 6251
0 125 1380 130 6261
11 -150 1320 -110 6270
7 -50 1300 40 6281
0 125 1350 70 6290
0 125 1400 0 6300
12 -175 1330 -120 6310
0 125 1380 120 6320
16 -275 1270 -160 6330
2 75 1300 140 6339
18 -325 1170 -160 6349
0 125 1220 180 6359
0 125 1270 0 6369
0 125 1320 0 6378
0 125 1370 0 6388
17 -300 1250 -170 6398
0 125 1300 170 6408
0 125 1350 0 6418
16 -275 1240 -160 6427
0 125 1290 160 6437
0 125 1340 0 6447
0 125 1390 0 6457
0 125 1440 0 6466
0 125 1490 0 6476
10 -125 1440 -100 6487
6 -25 1430 40 6496
11 -150 1370 -50 6506
8 -75 1340 30 6515
0 125 1390 80 6525
11 -150 1330 -110 6536
0 125 1380 110 6545
0 125 1430 0 6555
0 125 1480 0 6564
7 -50 1460 -70 6575
8 -75 1430 -10 6584
0 125 1480 80 6594
0 125 1530 0 6604
19 -350 1390 -190 6614
0 125 1440 190 6624
0 125 1490 0 6633
18 -325 1360 -180 6643
0 125 1410 180 6653
20 -375 1260 -200 6663
0 125 1310 200 6673
0 125 1360 0 6682
0 125 1410 0 6692
13 -200 1330 -130 6703
0 125 1380 130 6712
10 -125 1330 -100 6722
5 0 1330 50 6731
0 125 1380 50 6742
14 -225 1290 -140 6751
0 125 1340 140 6761
0 125 1390 0 6770
0 125 1440 0 6780
0 125 1490 0 6791
23 -450 1310 -230 6800
0 125 1360 230 6810
16 -275 1250 -160 6819
0 125 1300 160 6830
0 125 1350 0 6839
0 125 1400 0 6849
0 125 1450 0 6858
13 -200 1370 -130 6868
0 125 1420 130 6879
0 125 1470 0 6888
24 -475 1280 -240 6898
0 125 1330 240 6907
0 125 1380 0 6918
0 125 1430 0 6928
0 125 1480 0 6937
0 125 1530 0 6947
14 -225 1440 -140 6957
0 125 1490 140 6967
12 -175 1420 -120 6977
5 0 1420 70 6986
11 -150 1360 -60 6996
0 125 1410 110 7006
0 125 1460 0 7016
0 125 1510 0 7025
12 -175 1440 -120 7035
0 125 1490 120 7046
21 -400 1330 -210 7055
0 125 1380 210 7065
0 125 1430 0 7074
5 0 1430 -50 7085
0 125 1480 50 7094
16 -275 1370 -160 7104
0 125 1420 160 7114
16 -275 1310 -160 7123
0 125 1360 160 7134
0 125 1410 0 7143
13 -200 1330 -130 7153
0 125 1380 130 7162
0 125 1430 0 7173
20 -375 1280 -200 7183
0 125 1330 200 7192
0 125 1380 0 7202
12 -175 1310 -120 7212
0 125 1360 120 7222
0 125 1410 0 7231
0 125 1460 0 7241
0 125 1510 0 7251
5 0 1510 -50 7261
15 -250 1410 -100 7271
0 125 1460 150 7280
20 -375 1310 -200 7290
0 125 1360 200 7301
0 125 1410 0 7310
0 125 1460 0 7320
0 125 1510 0 7329
0 125 1560 0 7340
17 -300 1440 -170 7350
0 125 1490 170 7359
0 125 1540 0 7369
16 -275 1430 -160 7378
0 125 1480 160 7389
0 125 1530 0 7398
16 -275 1420 -160 7408
0 125 1470 160 7418
13 -200 1390 -130 7428
0 125 1440 130 7438
0 125 1490 0 7447
16 -275 1380 -160 7457
0 125 1430 160 7467
0 125 1480 0 7477
15 -250 1380 -150 7487
0 125 1430 150 7496
0 125 1480 0 7506
0 125 1530 0 7516
0 125 1580 0 7526
25 -500 1380 -250 7536
0 125 1430 250 7545
10 -125 1380 -100 7556
3 50 1400 70 7565
0 125 1450 30 7575
0 125 1500 0 7584
0 125 1550 0 7595
16 -275 1440 -160 7605
0 125 1490 160 7614
0 125 1540 0 7624
22 -425 1370 -220 7634
0 125 1420 220 7644
0 125 1470 0 7653
0 125 1520 0 7663
0 125 1570 0 7673
0 125 1620 0 7683
13 -200 1540 -130 7693
0 125 1590 130 7703
0 125 1640 0 7712
22 -425 1470 -220 7723
0 125 1520 220 7732
0 125 1570 0 7742
0 125 1620 0 7751
10 -125 1570 -100 7761
0 125 1620 100 7772
16 -275 1510 -160 7781
0 125 1560 160 7791
0 125 1610 0 7800
14 -225 1520 -140 7811
0 125 1570 140 7821
17 -300 1450 -170 7830
1 100 1490 160 7840
0 125 1540 10 7849
19 -350 1400 -190 7860
0 125 1450 190 7870
0 125 1500 0 7879
14 -225 1410 -140 7889
0 125 1460 140 7899
0 125 1510 0 7909
17 -300 1390 -170 7919
0 125 1440 170 7928
0 125 1490 0 7939
0 125 1540 0 7948
0 125 1590 0 7958
0 125 1640 0 7968
20 -375 1490 -200 7977
0 125 1540 200 7988
18 -325 1410 -180 7997
0 125 1460 180 8007
0 125 1510 0 8016
0 125 1560 0 8027
0 125 1610 0 8037
12 -175 1540 -120 8046
0 125 1590 120 8056
19 -350 1450 -190 8067
0 125 1500 190 8076
0 125 1550 0 8086
0 125 1600 0 8095
0 125 1650 0 8105
20 -375 1500 -200 8116
0 125 1550 200 8125
0 125 1600 0 8135
21 -400 1440 -210 8144
0 125 1490 210 8155
0 125 1540 0 8164
0 125 1590 0 8174
13 -200 1510 -130 8184
0 125 1560 130 8194
0 125 1610 0 8204
21 -400 1450 -210 8214
0 125 1500 210 8223
0 125 1550 0 8233
0 125 1600 0 8243
0 125 1650 0 8253
23 -450 1470 -230 8263
0 125 1520 230 8272
0 125 1570 0 8283
18 -325 1440 -180 8292
0 125 1490 180 8302
0 125 1540 0 8311
0 125 1590 0 8322
10 -125 1540 -100 8332
0 125 1590 100 8341
20 -375 1440 -200 8351
0 125 1490 200 8360
0 125 1540 0 8371
0 125 1590 0 8380
0 125 1640 0 8390
10 -125 1590 -100 8400
0 125 1640 100 8410
13 -200 1560 -130 8420
0 125 1610 130 8430
0 125 1660 0 8439
16 -275 1550 -160 8450
0 125 1600 160 8459
0 125 1650 0 8469
16 -275 1540 -160 8479
0 125 1590 160 8488
0 125 1640 0 8499
13 -200 1560 -130 8508
0 125 1610 130 8518
0 125 1660 0 8528
16 -275 1550 -160 8538
0 125 1600 160 8548
0 125 1650 0 8557
23 -450 1470 -230 8567
0 125 1520 230 8578
0 125 1570 0 8587
11 -150 1510 -110 8597
0 125 1560 110 8606
0 125 1610 0 8616
12 -175 1540 -120 8627
0 125 1590 120 8636
0 125 1640 0 8646
0 125 1690 0 8655
21 -400 1530 -210 8666
0 125 1580 210 8676
0 125 1630 0 8685
19 -350 1490 -190 8695
0 125 1540 190 8705
0 125 1590 0 8715
0 125 1640 0 8724
1 100 1680 -10 8734
20 -375 1530 -190 8744
0 125 1580 200 8754
0 125 1630 0 8764
0 125 1680 0 8773
0 125 1730 0 8783
22 -425 1560 -220 8794
0 125 1610 220 8803
0 125 1660 0 8813
24 -475 1470 -240 8823
0 125 1520 240 8833
0 125 1570 0 8843
0 125 1620 0 8852
14 -225 1530 -140 8862
0 125 1580 140 8872
0 125 1630 0 8882
20 -375 1480 -200 8892
0 125 1530 200 8901
0 125 1580 0 8911
0 125 1630 0 8921
0 125 1680 0 8931
25 -500 1480 -250 8941
0 125 1530 250 8950
0 125 1580 0 8961
15 -250 1480 -150 8971
0 125 1530 150 8980
0 125 1580 0 8990
0 125 1630 0 8999
0 125 1680 0 9010
15 -250 1580 -150 9020
0 125 1630 150 9029
0 125 1680 0 9039
0 125 1730 0 9049
17 -300 1610 -170 9059
0 125 1660 170 9069
0 125 1710 0 9078
22 -425 1540 -220 9089
0 125 1590 220 9098
0 125 1640 0 9108
0 125 1690 0 9118
1 100 1730 -10 9127
17 -300 1610 -160 9138
0 125 1660 170 9147
0 125 1710 0 9157
18 -325 1580 -180 9167
0 125 1630 180 9177
0 125 1680 0 9187
25 -500 1480 -250 9197
0 125 1530 250 9206
0 125 1580 0 9217
0 125 1630 0 9226
14 -225 1540 -140 9236
0 125 1590 140 9245
0 125 1640 0 9255
23 -450 1460 -230 9266
0 125 1510 230 9275
0 125 1560 0 9285
0 125 1610 0 9294
0 125 1660 0 9305
0 125 1710 0 9315
24 -475 1520 -240 9324
0 125 1570 240 9334
0 125 1620 0 9344
16 -275 1510 -160 9354
0 125 1560 160 9364
0 125 1610 0 9373
0 125 1660 0 9383
18 -325 1530 -180 9394
0 125 1580 180 9403
0 125 1630 0 9413
0 125 1680 0 9422
0 125 1730 0 9433
22 -425 1560 -220 9443
0 125 1610 220 9452
0 125 1660 0 9462
22 -425 1490 -220 9472
0 125 1540 220 9482
0 125 1590 0 9491
0 125 1640 0 9501
0 125 1690 0 9511
19 -350 1550 -190 9521
0 125 1600 190 9531
0 125 1650 0 9540
0 125 1700 0 9550
17 -300 1580 -170 9561
0 125 1630 170 9570
0 125 1680 0 9580
24 -475 1490 -240 9590
0 125 1540 240 9600
0 125 1590 0 9610
0 125 1640 0 9619
0 125 1690 0 9629
19 -350 1550 -190 9639
0 125 1600 190 9649
0 125 1650 0 9659
18 -325 1520 -180 9668
0 125 1570 180 9678
0 125 1620 0 9688
0 125 1670 0 9698
12 -175 1600 -120 9708
0 125 1650 120 9717
0 125 1700 0 9728
22 -425 1530 -220 9738
0 125 1580 220 9747
0 125 1630 0 9757
0 125 1680 0 9766
16 -275 1570 -160 9777
0 125 1620 160 9787
0 125 1670 0 9796
20 -375 1520 -200 9806
0 125 1570 200 9816
0 125 1620 0 9826
0 125 1670 0 9835
12 -175 1600 -120 9845
0 125 1650 120 9856
21 -400 1490 -210 9865
0 125 1540 210 9875
0 125 1590 0 9884
0 125 1640 0 9894
24 -475 1450 -240 9905
0 125 1500 240 9914
0 125 1550 0 9924
16 -275 1440 -160 9934
0 125 1490 160 9944
0 125 1540 0 9954
0 125 1590 0 9963
0 125 1640 0 9973
23 -450 1460 -230 9984
0 125 1510 230 9993
0 125 1560 0 10003
18 -325 1430 -180 10012
0 125 1480 180 10022
0 125 1530 0 10032
0 125 1580 0 10042
11 -150 1520 -110 10052
0 125 1570 110 10061
18 -325 1440 -180 10072
0 125 1490 180 10081
0 125 1540 0 10091
0 125 1590 0 10100
0 125 1640 0 10110
24 -475 1450 -240 10121
0 125 1500 240 10130
0 125 1550 0 10140
20 -375 1400 -200 10150
0 125 1450 200 10160
0 125 1500 0 10170
11 -150 1440 -110 10179
0 125 1490 110 10189
0 125 1540 0 10199
21 -400 1380 -210 10209
0 125 1430 210 10219
0 125 1480 0 10228
0 125 1530 0 10238
0 125 1580 0 10248
24 -475 1390 -240 10258
0 125 1440 240 10267
0 125 1490 0 10277
16 -275 1380 -160 10288
0 125 1430 160 10297
0 125 1480 0 10307
0 125 1530 0 10316
14 -225 1440 -140 10327
0 125 1490 140 10337
14 -225 1400 -140 10346
0 125 1450 140 10356
0 125 1500 0 10365
0 125 1550 0 10376
0 125 1600 0 10386
17 -300 1480 -170 10395
0 125 1530 170 10405
22 -425 1360 -220 10415
0 125 1410 220 10425
0 125 1460 0 10434
0 125 1510 0 10444
0 125 1560 0 10455
16 -275 1450 -160 10464
0 125 1500 160 10474
0 125 1550 0 10483
22 -425 1380 -220 10493
0 125 1430 220 10504
0 125 1480 0 10513
0 125 1530 0 10523
19 -350 1390 -190 10532
0 125 1440 190 10543
0 125 1490 0 10552
21 -400 1330 -210 10562
0 125 1380 210 10572
0 125 1430 0 10582
0 125 1480 0 10592
18 -325 1350 -180 10602
0 125 1400 180 10611
0 125 1450 0 10620
0 125 1500 0 10631
0 125 1550 0 10641
16 -275 1440 -160 10650
0 125 1490 160 10660
0 125 1540 0 10670
21 -400 1380 -210 10680
0 125 1430 210 10690
0 125 1480 0 10699
0 125 1530 0 10710
0 125 1580 0 10719
0 125 1630 0 10729
16 -275 1520 -160 10739
0 125 1570 160 10748
0 125 1620 0 10759
18 -325 1490 -180 10769
0 125 1540 180 10778
0 125 1590 0 10788
19 -350 1450 -190 10798
0 125 1500 190 10808
0 125 1550 0 10817
23 -450 1370 -230 10827
0 125 1420 230 10838
0 125 1470 0 10847
0 125 1520 0 10857
0 125 1570 0 10866
19 -350 1430 -190 10876
0 125 1480 190 10886
0 125 1530 0 10896
15 -250 1430 -150 10906
0 125 1480 150 10915
0 125 1530 0 10926
0 125 1580 0 10935
24 -475 1390 -240 10945
0 125 1440 240 10955
0 125 1490 0 10964
17 -300 1370 -170 10975
0 125 1420 170 10984
0 125 1470 0 10994
0 125 1520 0 11003
0 125 1570 0 11014
20 -375 1420 -200 11024
0 125 1470 200 11033
0 125 1520 0 11043
10 -125 1470 -100 11054
0 125 1520 100 11063
0 125 1570 0 11073
14 -225 1480 -140 11082
0 125 1530 140 11092
20 -375 1380 -200 11103
0 125 1430 200 11112
0 125 1480 0 11121
0 125 1530 0 11131
13 -200 1450 -130 11142
0 125 1500 130 11151
0 125 1550 0 11161
21 -400 1390 -210 11171
0 125 1440 210 11181
0 125 1490 0 11191
0 125 1540 0 11200
0 125 1590 0 11210
24 -475 1400 -240 11220
0 125 1450 240 11230
0 125 1500 0 11240
24 -475 1310 -240 11249
0 125 1360 240 11259
0 125 1410 0 11269
0 125 1460 0 11279
16 -275 1350 -160 11289
0 125 1400 160 11298
0 125 1450 0 11309
16 -275 1340 -160 11318
0 125 1390 160 11328
0 125 1440 0 11337
0 125 1490 0 11347
0 125 1540 0 11358
6 -25 1530 -60 11367
14 -225 1440 -80 11377
8 -75 1410 60 11386
0 125 1460 80 11397
17 -300 1340 -170 11407
0 125 1390 170 11416
0 125 1440 0 11426
0 125 1490 0 11436
0 125 1540 0 11446
12 -175 1470 -120 11456
0 125 1520 120 11465
20 -375 1370 -200 11475
0 125 1420 200 11485
0 125 1470 0 11495
0 125 1520 0 11504
0 125 1570 0 11514
21 -400 1410 -210 11525
0 125 1460 210 11534
0 125 1510 0 11544
24 -475 1320 -240 11553
0 125 1370 240 11564
0 125 1420 0 11573
0 125 1470 0 11583
0 125 1520 0 11592
15 -250 1420 -150 11602
0 125 1470 150 11613
0 125 1520 0 11622
23 -450 1340 -230 11632
0 125 1390 230 11641
0 125 1440 0 11652
0 125 1490 0 11662
0 125 1540 0 11671
22 -425 1370 -220 11681
0 125 1420 220 11691
0 125 1470 0 11701
24 -475 1280 -240 11711
0 125 1330 240 11720
0 125 1380 0 11730
0 125 1430 0 11740
0 125 1480 0 11750
0 125 1530 0 11759
19 -350 1390 -190 11769
0 125 1440 190 11780
0 125 1490 0 11789
21 -400 1330 -210 11799
0 125 1380 210 11808
0 125 1430 0 11819
0 125 1480 0 11828
10 -125 1430 -100 11838
0 125 1480 100 11848
4 25 1490 -40 11857
19 -350 1350 -150 11868
0 125 1400 190 11877
0 125 1450 0 11887
0 125 1500 0 11897
13 -200 1420 -130 11907
0 125 1470 130 11917
16 -275 1360 -160 11926
0 125 1410 160 11936
0 125 1460 0 11945
14 -225 1370 -140 11956
0 125 1420 140 11966
17 -300 1300 -170 11975
0 125 1350 170 11985
16 -275 1240 -160 11995
0 125 1290 160 12005
7 -50 1270 -70 12014
0 125 1320 70 12024
0 125 1370 0 12035
8 -75 1340 -80 12044
10 -125 1290 -20 12054
8 -75 1260 20 12063
0 125 1310 80 12073
15 -250 1210 -150 12083
0 125 1260 150 12093
0 125 1310 0 12102
0 125 1360 0 12112
0 125 1410 0 12123
0 125 1460 0 12132
0 125 1510 0 12142
28 -575 1280 -280 12152
0 125 1330 280 12162
21 -400 1170 -210 12172
0 125 1220 210 12181
0 125 1270 0 12191
0 125 1320 0 12200
0 125 1370 0 12211
0 125 1420 0 12220
16 -275 1310 -160 12230
0 125 1360 160 12239
18 -325 1230 -180 12250
0 125 1280 180 12260
0 125 1330 0 12269
13 -200 1250 -130 12279
0 125 1300 130 12289
18 -325 1170 -180 12299
0 125 1220 180 12308
11 -150 1160 -110 12318
10 -125 1110 10 12327
0 125 1160 100 12338
0 125 1210 0 12347
9 -100 1170 -90 12357
4 25 1180 50 12367
11 -150 1120 -70 12377
5 0 1120 60 12387
12 -175 1050 -70 12396
3 50 1070 90 12406
5 0 1070 -20 12416
0 125 1120 50 12426
0 125 1170 0 12435
12 -175 1100 -120 12445
8 -75 1070 40 12454
12 -175 1000 -40 12465
13 -200 920 -10 12475
10 -125 870 30 12484
8 -75 840 20 12493
3 50 860 50 12504
5 0 860 -20 12513
4 25 870 10 12523
18 -325 740 -140 12533
10 -125 690 80 12542
20 -375 540 -100 12553
18 -325 410 20 12562
12 -175 340 60 12571
2 75 370 100 12581
2 75 400 0 12591
0 125 450 20 12601
0 125 500 0 12610
5 0 500 -50 12620
6 -25 490 -10 12630
11 -150 430 -50 12640
7 -50 410 40 12649
8 -75 380 -10 12658
12 -175 310 -40 12668
15 -250 210 -30 12678
9 -100 170 60 12688
5 0 170 40 12697
1 100 210 40 12707
0 125 260 10 12717
0 125 310 0 12726
0 125 360 0 12736
0 125 410 0 12745
1 100 450 -10 12755
4 25 460 -30 12765
6 -25 450 -20 12775
8 -75 420 -20 12784
9 -100 380 -10 12794
8 -75 350 10 12804
13 -200 270 -50 12814
12 -175 200 10 12823
6 -25 190 60 12832
3 50 210 30 12843
3 50 230 0 12852
0 125 280 30 12862
0 125 330 0 12871
0 125 380 0 12881
0 125 430 0 12891
1 100 470 -10 12901
2 75 500 -10 12910
8 -75 470 -60 12919
8 -75 440 0 12930
10 -125 390 -20 12939
6 -25 380 40 12949
12 -175 310 -60 12958
14 -225 220 -20 12968
11 -150 160 30 12978
4 25 170 70 12987
3 50 190 10 12997
0 125 240 30 13006
0 125 290 0 13017
0 125 340 0 13026
0 125 390 0 13036
1 100 430 -10 13045
2 75 460 -10 13056
7 -50 440 -50 13065
9 -100 400 -20 13075
9 -100 360 0 13084
8 -75 330 10 13093
11 -150 270 -30 13104
12 -175 200 -10 13113
7 -50 180 50 13123
4 25 190 30 13132
2 75 220 20 13143
1 100 260 10 13152
0 125 310 10 13162
0 125 360 0 13171
0 125 410 0 13180
0 125 460 0 13191
1 100 500 -10 13200
2 75 530 -10 13210
6 -25 520 -40 13219

« Last Edit: June 24, 2024, 06:49:26 pm by Picuino »
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #58 on: June 24, 2024, 07:33:33 pm »
The motor is too fast. The DC motor has little inertia coupled to the shaft and is faster than the control system.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #59 on: June 25, 2024, 08:40:50 am »
Plot of dc motor position over time, estimated from the sum of the measured back-emf voltages.
Green = Expected position
Red = measured position

 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3552
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #60 on: June 28, 2024, 11:15:49 am »
This:

After the voltage divider this voltage become 27mV, about 5-6 ADC points with ADC reference voltage at 5V.

So with one count of difference of the ADC, you get a 20% change of the input signal to your PID algorithm. You're running out of resolution of your control system here, and can't expect it to do much better.

The motor being faster as the control algorithm also does not help. You could add intertia or switch to a higher PWM frequency, but you're probably in the region where much more effort is not going to improve overall performance much. But if you think it's fun, you can of course see how far you can push it.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #61 on: June 28, 2024, 11:54:19 am »
ADC resolution is not the problem. I have changed the reference voltage to INTERNAL (1.1v) and now, with 5 times more ADC resolution, the problem remains. The motor is too fast.
I'm going to try sticking a weight with enough inertia on the shaft to see if it improves control.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #62 on: June 28, 2024, 12:15:27 pm »
Results by adding inertia to the axis.
The reference is at 20 points of the ADC with reference voltage of 1.1v (22mV emf). That corresponds in my motor to about 60rpm.

Code: [Select]
emf P I D millis
0 0 0 0 0
0 600 20 200 33
0 600 40 0 43
0 600 60 0 53
0 600 80 0 62
0 600 100 0 72
0 600 120 0 81
0 600 140 0 92
0 600 160 0 101
0 600 180 0 111
0 600 200 0 120
0 600 220 0 131
1 570 239 -10 140
10 300 249 -90 150
18 60 251 -80 159
22 -60 249 -40 169
21 -30 248 10 179
20 0 248 10 189
19 30 249 10 198
18 60 251 10 208
18 60 253 0 218
20 0 253 -20 227
22 -60 251 -20 237
22 -60 249 0 246
22 -60 247 0 257
21 -30 246 10 266
20 0 246 10 276
20 0 246 0 285
20 0 246 0 294
18 60 248 20 305
16 120 252 20 315
15 150 257 10 324
14 180 263 10 333
14 180 269 0 344
15 150 274 -10 353
15 150 279 0 363
16 120 283 -10 372
17 90 286 -10 382
18 60 288 -10 392
17 90 291 10 402
17 90 294 0 411
18 60 296 -10 421
21 -30 295 -30 431
22 -60 293 -10 441
21 -30 292 10 450
20 0 292 10 459
20 0 292 0 470
20 0 292 0 479
19 30 293 10 489
18 60 295 10 498
16 120 299 20 508
13 210 306 30 518
11 270 315 20 528
10 300 325 10 537
12 240 333 -20 547
16 120 337 -40 557
19 30 338 -30 567
21 -30 337 -20 576
21 -30 336 0 586
20 0 336 10 595
20 0 336 0 605
21 -30 335 -10 615
22 -60 333 -10 624
24 -120 329 -20 634
22 -60 327 20 644
21 -30 326 10 654
22 -60 324 -10 663
22 -60 322 0 673
22 -60 320 0 683
21 -30 319 10 693
20 0 319 10 702
17 90 322 30 712
14 180 328 30 721
13 210 335 10 732
15 150 340 -20 741
18 60 342 -30 751
19 30 343 -10 760
20 0 343 -10 770
20 0 343 0 780
19 30 344 10 789
19 30 345 0 799
19 30 346 0 808
20 0 346 -10 819
21 -30 345 -10 828
19 30 346 20 838
19 30 347 0 847
21 -30 346 -20 858
21 -30 345 0 867
20 0 345 10 876
18 60 347 20 886
14 180 353 40 897
11 270 362 30 906
8 360 374 30 915
5 450 389 30 925
0 600 409 50 935
0 600 429 0 945
10 300 439 -100 955
31 -330 428 -210 964
39 -570 409 -80 974
38 -540 391 10 984
34 -420 377 40 993
32 -360 365 20 1003
29 -270 356 30 1012
27 -210 349 20 1022
25 -150 344 20 1032
23 -90 341 20 1042
20 0 341 30 1051
16 120 345 40 1061
13 210 352 30 1071
13 210 359 0 1080
13 210 366 0 1090
15 150 371 -20 1099
17 90 374 -20 1110
19 30 375 -20 1119
20 0 375 -10 1129
20 0 375 0 1138
18 60 377 20 1148
17 90 380 10 1158
17 90 383 0 1168
17 90 386 0 1177
16 120 390 10 1187
15 150 395 10 1197
17 90 398 -20 1207
22 -60 396 -50 1216
24 -120 392 -20 1226
22 -60 390 20 1235
20 0 390 20 1245
17 90 393 30 1255
14 180 399 30 1265
13 210 406 10 1274
14 180 412 -10 1285
17 90 415 -30 1294
19 30 416 -20 1303
21 -30 415 -20 1313
21 -30 414 0 1323
22 -60 412 -10 1333
24 -120 408 -20 1342
23 -90 405 10 1352
22 -60 403 10 1361
22 -60 401 0 1372
22 -60 399 0 1381
21 -30 398 10 1391
21 -30 397 0 1400
22 -60 395 -10 1411
19 30 396 30 1420
16 120 400 30 1430
15 150 405 10 1439
17 90 408 -20 1448
19 30 409 -20 1459
21 -30 408 -20 1468
21 -30 407 0 1478
22 -60 405 -10 1487
22 -60 403 0 1498
22 -60 401 0 1507
22 -60 399 0 1517
21 -30 398 10 1526
21 -30 397 0 1537
22 -60 395 -10 1546
23 -90 392 -10 1556
24 -120 388 -10 1565
23 -90 385 10 1575
21 -30 384 20 1585
17 90 387 40 1594
15 150 392 20 1604
14 180 398 10 1613
16 120 402 -20 1624
20 0 402 -40 1633
22 -60 400 -20 1643
23 -90 397 -10 1652
23 -90 394 0 1662
22 -60 392 10 1672
21 -30 391 10 1682
22 -60 389 -10 1691
24 -120 385 -20 1701
23 -90 382 10 1711
23 -90 379 0 1720
23 -90 376 0 1730
23 -90 373 0 1739
23 -90 370 0 1750
22 -60 368 10 1759
20 0 368 20 1769
19 30 369 10 1778
18 60 371 10 1788
19 30 372 -10 1798
19 30 373 0 1808
20 0 373 -10 1817
21 -30 372 -10 1827
21 -30 371 0 1837
22 -60 369 -10 1847
21 -30 368 10 1856
22 -60 366 -10 1866
22 -60 364 0 1875
22 -60 362 0 1885
22 -60 360 0 1895
23 -90 357 -10 1904
25 -150 352 -20 1914
25 -150 347 0 1924
23 -90 344 20 1934
21 -30 343 20 1943
18 60 345 30 1953
16 120 349 20 1963
15 150 354 10 1973
15 150 359 0 1982
18 60 361 -30 1992
20 0 361 -20 2001
22 -60 359 -20 2011
21 -30 358 10 2021
20 0 358 10 2030
20 0 358 0 2040
22 -60 356 -20 2050
23 -90 353 -10 2060
24 -120 349 -10 2069
24 -120 345 0 2079
24 -120 341 0 2088
24 -120 337 0 2099
24 -120 333 0 2108
23 -90 330 10 2117
22 -60 328 10 2127
20 0 328 20 2137
18 60 330 20 2147
17 90 333 10 2156
17 90 336 0 2166
18 60 338 -10 2176
18 60 340 0 2186
18 60 342 0 2195
19 30 343 -10 2205
20 0 343 -10 2214
20 0 343 0 2224
21 -30 342 -10 2234
22 -60 340 -10 2244
22 -60 338 0 2253
21 -30 337 10 2263
20 0 337 10 2273
20 0 337 0 2282
22 -60 335 -20 2292
22 -60 333 0 2301
20 0 333 20 2312
17 90 336 30 2321
15 150 341 20 2331
14 180 347 10 2340
14 180 353 0 2351
15 150 358 -10 2360
18 60 360 -30 2370
20 0 360 -20 2379
21 -30 359 -10 2390
21 -30 358 0 2399
21 -30 357 0 2408
22 -60 355 -10 2418
22 -60 353 0 2427
23 -90 350 -10 2438
23 -90 347 0 2447
22 -60 345 10 2457
21 -30 344 10 2466
22 -60 342 -10 2477
23 -90 339 -10 2486
22 -60 337 10 2496
20 0 337 20 2505
18 60 339 20 2515
15 150 344 30 2525
15 150 349 0 2534
17 90 352 -20 2544
19 30 353 -20 2553
19 30 354 0 2564
19 30 355 0 2573
19 30 356 0 2583
19 30 357 0 2592
20 0 357 -10 2603
22 -60 355 -20 2612
22 -60 353 0 2622
21 -30 352 10 2631
20 0 352 10 2641
19 30 353 10 2651
21 -30 352 -20 2661
21 -30 351 0 2670
19 30 352 20 2679
15 150 357 40 2690
12 240 365 30 2699
9 330 376 30 2709
6 420 390 30 2718
10 300 400 -40 2728
17 90 403 -70 2738
23 -90 400 -60 2748
24 -120 396 -10 2757
23 -90 393 10 2767
22 -60 391 10 2777
21 -30 390 10 2787
21 -30 389 0 2796
21 -30 388 0 2806
21 -30 387 0 2816
22 -60 385 -10 2826
23 -90 382 -10 2835
23 -90 379 0 2844
22 -60 377 10 2854
21 -30 376 10 2864
18 60 378 30 2874
16 120 382 20 2883
14 180 388 20 2893
14 180 394 0 2903
14 180 400 0 2913
15 150 405 -10 2922
18 60 407 -30 2932
20 0 407 -20 2941
21 -30 406 -10 2952
20 0 406 10 2961
20 0 406 0 2971
20 0 406 0 2980
19 30 407 10 2991
18 60 409 10 3000
17 90 412 10 3010
16 120 416 10 3019
19 30 417 -30 3030
22 -60 415 -30 3039
22 -60 413 0 3048
20 0 413 20 3058
18 60 415 20 3067
16 120 419 20 3078
15 150 424 10 3087
16 120 428 -10 3097
18 60 430 -20 3106
20 0 430 -20 3117
20 0 430 0 3126
20 0 430 0 3136
21 -30 429 -10 3145
22 -60 427 -10 3155
22 -60 425 0 3165
22 -60 423 0 3175
22 -60 421 0 3184
22 -60 419 0 3194
23 -90 416 -10 3204
24 -120 412 -10 3214
23 -90 409 10 3223
21 -30 408 20 3233
19 30 409 20 3243
17 90 412 20 3252
17 90 415 0 3262
19 30 416 -20 3271
21 -30 415 -20 3281
21 -30 414 0 3291
21 -30 413 0 3301
22 -60 411 -10 3310
22 -60 409 0 3320
22 -60 407 0 3330
22 -60 405 0 3340
22 -60 403 0 3349
22 -60 401 0 3359
23 -90 398 -10 3368
24 -120 394 -10 3379
23 -90 391 10 3388
21 -30 390 20 3397
18 60 392 30 3407
15 150 397 30 3417
13 210 404 20 3427
15 150 409 -20 3436
20 0 409 -50 3446
23 -90 406 -30 3456
23 -90 403 0 3466
23 -90 400 0 3475
23 -90 397 0 3485
22 -60 395 10 3494
22 -60 393 0 3505
23 -90 390 -10 3514
23 -90 387 0 3524
23 -90 384 0 3533
23 -90 381 0 3543
24 -120 377 -10 3553
24 -120 373 0 3562
23 -90 370 10 3572
21 -30 369 20 3581
20 0 369 10 3592
19 30 370 10 3601
18 60 372 10 3611
18 60 374 0 3620
19 30 375 -10 3631
20 0 375 -10 3640
21 -30 374 -10 3650
22 -60 372 -10 3659
22 -60 370 0 3668
22 -60 368 0 3679
23 -90 365 -10 3688
22 -60 363 10 3698
22 -60 361 0 3707
24 -120 357 -20 3718
25 -150 352 -10 3727
24 -120 348 10 3737
23 -90 345 10 3746
20 0 345 30 3757
17 90 348 30 3766
15 150 353 20 3776
16 120 357 -10 3785
17 90 360 -10 3795
19 30 361 -20 3805
21 -30 360 -20 3814
21 -30 359 0 3824
21 -30 358 0 3833
21 -30 357 0 3844
21 -30 356 0 3853
22 -60 354 -10 3863
23 -90 351 -10 3872
23 -90 348 0 3883
24 -120 344 -10 3892
24 -120 340 0 3902
23 -90 337 10 3911
22 -60 335 10 3920
22 -60 333 0 3931
22 -60 331 0 3940
21 -30 330 10 3950
19 30 331 20 3959
18 60 333 10 3970
18 60 335 0 3979
18 60 337 0 3989
18 60 339 0 3998
18 60 341 0 4008
19 30 342 -10 4018
20 0 342 -10 4028
20 0 342 0 4037
21 -30 341 -10 4047
22 -60 339 -10 4057
22 -60 337 0 4066
21 -30 336 10 4076
20 0 336 10 4085
20 0 336 0 4096
21 -30 335 -10 4105
21 -30 334 0 4115
20 0 334 10 4124
17 90 337 30 4134
14 180 343 30 4144
13 210 350 10 4154
14 180 356 -10 4163
16 120 360 -20 4173
18 60 362 -20 4183
20 0 362 -20 4192
21 -30 361 -10 4202
21 -30 360 0 4211
21 -30 359 0 4221
22 -60 357 -10 4231
22 -60 355 0 4241
23 -90 352 -10 4250
23 -90 349 0 4260
22 -60 347 10 4270
22 -60 345 0 4280
22 -60 343 0 4289
23 -90 340 -10 4299
22 -60 338 10 4308
20 0 338 20 4318
18 60 340 20 4328
15 150 345 30 4337
15 150 350 0 4347
17 90 353 -20 4357
19 30 354 -20 4367
19 30 355 0 4376
19 30 356 0 4386
19 30 357 0 4396
19 30 358 0 4406
19 30 359 0 4415
21 -30 358 -20 4425
23 -90 355 -20 4434
22 -60 353 10 4445
21 -30 352 10 4454
20 0 352 10 4463
21 -30 351 -10 4473
20 0 351 10 4483
17 90 354 30 4493
15 150 359 20 4502
12 240 367 30 4512
9 330 378 30 4521
4 480 394 50 4532
0 600 414 40 4541
0 600 434 0 4551
10 300 444 -100 4561
29 -270 435 -190 4571
39 -570 416 -100 4581
38 -540 398 10 4590
35 -450 383 30 4599
32 -360 371 30 4610
30 -300 361 20 4619
26 -180 355 40 4629
24 -120 351 20 4638
23 -90 348 10 4647
21 -30 347 20 4658
18 60 349 30 4667
15 150 354 30 4677
12 240 362 30 4686
11 270 371 10 4697
11 270 380 0 4706
14 180 386 -30 4716
18 60 388 -40 4725
21 -30 387 -30 4736
21 -30 386 0 4745
20 0 386 10 4755
19 30 387 10 4764
19 30 388 0 4774
19 30 389 0 4784
18 60 391 10 4794
17 90 394 10 4803
16 120 398 10 4813
18 60 400 -20 4823
21 -30 399 -30 4833
22 -60 397 -10 4842
19 30 398 30 4851
16 120 402 30 4861
15 150 407 10 4871
14 180 413 10 4881
15 150 418 -10 4890
16 120 422 -10 4900
18 60 424 -20 4910
20 0 424 -20 4920
21 -30 423 -10 4929
22 -60 421 -10 4939
22 -60 419 0 4948
22 -60 417 0 4959
22 -60 415 0 4968
22 -60 413 0 4978
23 -90 410 -10 4987
24 -120 406 -10 4998
23 -90 403 10 5007
22 -60 401 10 5016
20 0 401 20 5026
18 60 403 20 5036
16 120 407 20 5046
16 120 411 0 5055
18 60 413 -20 5065
20 0 413 -20 5074
21 -30 412 -10 5085
22 -60 410 -10 5094
22 -60 408 0 5104
22 -60 406 0 5113
22 -60 404 0 5124
22 -60 402 0 5133
21 -30 401 10 5143
21 -30 400 0 5152
21 -30 399 0 5161
23 -90 396 -20 5172
25 -150 391 -20 5182
23 -90 388 20 5191
21 -30 387 20 5200
18 60 389 30 5211
15 150 394 30 5220
14 180 400 10 5230
16 120 404 -20 5239
20 0 404 -40 5250
22 -60 402 -20 5259
23 -90 399 -10 5269
23 -90 396 0 5278
22 -60 394 10 5288
22 -60 392 0 5298
23 -90 389 -10 5308
23 -90 386 0 5317
23 -90 383 0 5326
24 -120 379 -10 5337
23 -90 376 10 5346
24 -120 372 -10 5356
23 -90 369 10 5365
22 -60 367 10 5376
20 0 367 20 5385
19 30 368 10 5395
17 90 371 20 5404
17 90 374 0 5414
19 30 375 -20 5424
21 -30 374 -20 5434
22 -60 372 -10 5443
22 -60 370 0 5452
22 -60 368 0 5463
22 -60 366 0 5472
22 -60 364 0 5482
23 -90 361 -10 5491
23 -90 358 0 5501
23 -90 355 0 5511
23 -90 352 0 5521
23 -90 349 0 5530
23 -90 346 0 5540
21 -30 345 20 5550
19 30 346 20 5560
17 90 349 20 5569
15 150 354 20 5579
15 150 359 0 5588
18 60 361 -30 5598
20 0 361 -20 5608
21 -30 360 -10 5617
21 -30 359 0 5627
21 -30 358 0 5637
21 -30 357 0 5647
21 -30 356 0 5656
22 -60 354 -10 5666
24 -120 350 -20 5676
25 -150 345 -10 5686
24 -120 341 10 5695
23 -90 338 10 5704
22 -60 336 10 5714
23 -90 333 -10 5724
23 -90 330 0 5734
21 -30 329 20 5743
19 30 330 20 5753
18 60 332 10 5763
18 60 334 0 5773
18 60 336 0 5782
18 60 338 0 5792
18 60 340 0 5801
18 60 342 0 5812
19 30 343 -10 5821
20 0 343 -10 5830
20 0 343 0 5840
21 -30 342 -10 5850
22 -60 340 -10 5860
22 -60 338 0 5869
21 -30 337 10 5879
21 -30 336 0 5889
21 -30 335 0 5899
21 -30 334 0 5908
21 -30 333 0 5918
19 30 334 20 5927
17 90 337 20 5938
15 150 342 20 5947
13 210 349 20 5957
14 180 355 -10 5966
16 120 359 -20 5977
19 30 360 -30 5986
20 0 360 -10 5995
21 -30 359 -10 6005
21 -30 358 0 6014
21 -30 357 0 6025
22 -60 355 -10 6034
23 -90 352 -10 6044
23 -90 349 0 6053
22 -60 347 10 6064
22 -60 345 0 6073
22 -60 343 0 6083
23 -90 340 -10 6092
23 -90 337 0 6102


EDIT:
I have not been able to avoid the speed oscillation despite trying to tune the PID with higher derivative gain.
Perhaps another control system would be better, one based on the internal model of the dc motor.
« Last Edit: June 28, 2024, 12:18:02 pm by Picuino »
 


Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #64 on: June 28, 2024, 12:21:21 pm »
I think the back-emf voltage measurement gives realistic motor speed feedback and is simpler to implement.
The problem is in the control system. With Ripple Counting Technique the problem would be similar.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3552
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #65 on: June 28, 2024, 12:58:00 pm »
Increasing derivative gain is making your system more stable. It's use is to make the motor respond faster, but how can you expect that to work if your control algorithm is already slower then your motor response time? As a minimum, your PID algorithm should run at 4x the speed of the motor response time and 10x is more comfortable.
But why do you think the motor response time is faster then the PID algorithm in the first place?
I see a sampling time of around 10ms (With a lot of Jitter, that is not good as I wrote before) and I see an oscillation with a period of around 12 samples, i.e. 120ms.

Also, derivative term is for increasing response time. This is not important for a power feed motor. It's likely better to not use this at all in this case.

Another suspicious pat is that both the P and D terms are multiples of 10.
 

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 188
  • Country: ru
Re: Brushed DC motor closed loop speed control
« Reply #66 on: June 28, 2024, 01:11:48 pm »
Has anyone experience with decent quality (stiffness/dynamic range) control of small brushed DC motors?
You can open any schematics of VCR from 1980's (70's ?) and use solution from it. Top loading VCR, as I remember.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #67 on: June 28, 2024, 04:45:16 pm »
I just realized that this low speed, low friction control has a major problem because it is nonlinear.
Accelerating the motor is very simple, just give it more current by increasing the PWM cycle, but no matter how much you reduce the PWM cycle at any time you can not brake the motor. For that we depend on the external friction. When the external friction is low, we have a nonlinear control that cannot be controlled as a traditional PID.
That is probably the reason why in the result of a few posts ago the "jerky" dc motor operation was reduced when the shaft brake was increased.

I am going to try to implement another type of control, a model based control, which I think can become more accurate.
 

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 188
  • Country: ru
Re: Brushed DC motor closed loop speed control
« Reply #68 on: June 28, 2024, 05:10:10 pm »
Are you generally familiar with DC motor controllers in VCRs? Do your research before writing anything.
http://www.ids-elektronik.de/159.pdf
« Last Edit: June 28, 2024, 05:36:36 pm by Postal2 »
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #69 on: June 29, 2024, 08:33:32 am »
Sorry, I have researched and read that datasheet (the English translated version) and did not understand how to apply it to the dc motor control.
Do you have any document explaining the issue?
 

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 188
  • Country: ru
Re: Brushed DC motor closed loop speed control
« Reply #70 on: June 29, 2024, 11:49:53 am »
Do you have any document explaining the issue?
I have it, but in russian. I think the first thing to understand is that a speed sensor (FG) is definitely needed.
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #71 on: June 30, 2024, 07:29:34 am »
I have a couple of Advanced Motion Control 30A8 servo drives (datasheet link) collecting dust.
So the servo amplifier has arrived (thanks), some info on the unit:
2298453-0
More details in the manual (link above).
For Doctorandus_P  here's the PCB image
2298457-1
Unfortunately all markings are sanded off. As the four power MOSFETs are soldered from the bottom and bolted to the case, I can't show an image of the bottom side.

- Martin
 

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 835
  • Country: se
Re: Brushed DC motor closed loop speed control
« Reply #72 on: June 30, 2024, 09:30:32 am »
Here's an image of the underside.
MOSFETs are IRFP150.
 

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1018
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #73 on: June 30, 2024, 10:29:47 am »
Do you have any document explaining the issue?
I have it, but in russian. I think the first thing to understand is that a speed sensor (FG) is definitely needed.
With the back-emf control system, the speed sensor is the dc motor itself, which acts as the motor and also acts as the tachometer when the current drops to zero. This system has the disadvantage of having to disconnect the motor from the power supply several times per second, so it cannot be continuously connected to 24V. But that matters little at low speeds.
The control I am implementing right now has the motor connected to the power supply via PWM for 8 milliseconds and disconnected for 2 milliseconds (20% of the time). This means that at most I can deliver 19V to the motor when I set the PWM control to 100%.

During the time the motor is off, it simply acts as a tachometer delivering a voltage proportional to the speed the motor is at that moment (dc motor acts as speed sensor).
« Last Edit: June 30, 2024, 10:31:40 am by Picuino »
 

Offline Postal2

  • Regular Contributor
  • *
  • Posts: 188
  • Country: ru
Re: Brushed DC motor closed loop speed control
« Reply #74 on: June 30, 2024, 01:39:24 pm »
« Last Edit: June 30, 2024, 04:17:08 pm by Postal2 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf