Can a teensy 3.5 handle 5 encoders and 5 PIDs?

Status
Not open for further replies.
Never mind, we got results

I figured my PIDs were backwards in relation to the encoder output... etc
I got it to work and is still rough, but it looks great, the difference between them is small -about 150 pulses, you can hardly see it. For info
and I can still work on setting more...

andere Frage:
Are you using pin 2 or 3? They are assigned to the base rotation, and the base started to move strongly... I flipped the breaker, but I would need those pins.
32 is an available pin. most are taken for encoders, PWM and limit switches.

Also,
Maybe you can explain this part: I dont get it:

if (stopwatch < 6000)
{
Serial.printf("%d\t%d\t%d\t%d\t%d\n", micros() - startMicros, Wrist_LEncoder.counter, Wrist_REncoder.counter, (int)masterOutput, (int)slaveOutput); // tab seperated for easy import into excel

if (stopwatch > 2500)
{
masterTarget = 0;
}

delay(5);
}
else
{
PID_Timer.end();
// This stops all the motors in all directions
analogWrite(Wrist_LUpPin, 256);
analogWrite(Wrist_LDnPin, 256);
analogWrite(Wrist_RUpPin, 256);
analogWrite(Wrist_RDnPin, 256);
//master.speed = 0;
// slave.speed = 0;

while (1)
{
digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));
delay(50);
}

}

}

Here is a sample:

micros E_master E_slave Sp_master Sp_slave
360971 0 0 0 0
366103 3 0 60 0
371233 9 0 60 0
376364 16 0 60 0
381508 24 0 60 0
386642 33 0 60 100
391800 43 3 60 100
396959 53 10 60 100
402120 64 20 60 100
407282 75 32 60 100
412453 86 47 60 64
417615 98 61 60 64
422776 110 75 60 64
427948 123 88 60 64
433111 136 101 60 64
438286 149 112 60 5
443447 163 121 60 5
448606 175 126 60 5
453766 188 127 60 5
458926 200 126 60 5
464087 213 125 60 100
469262 225 128 60 100
474435 237 134 60 100
479611 250 144 60 100

Later on:

1817432 4253 4079 60 100
1822622 4269 4085 60 100
1827810 4286 4094 60 100
1833002 4303 4107 60 100
1838205 4319 4121 60 100
1843396 4336 4137 60 100
1848586 4353 4155 60 100
1853775 4369 4174 60 100
1858966 4385 4195 60 100
1864169 4401 4216 60 100
1869362 4417 4239 60 100
1874551 4432 4262 60 100
1879740 4448 4286 60 100
1884931 4465 4311 60 100
1890120 4481 4334 60 0
1895295 4499 4351 60 0
1900471 4516 4362 60 0
1905646 4533 4368 60 0
1910822 4551 4370 60 0
1916009 4568 4373 60 100
1921200 4585 4379 60 100
1926392 4601 4390 60 100
1931582 4617 4403 60 100
1936772 4633 4418 60 100
1941960 4650 4436 60 100
1947164 4666 4456 60 100
1952355 4682 4477 60 100
1957547 4699 4499 60 100
1962735 4715 4522 60 80
1967926 4732 4544 60 80
1973115 4749 4564 60 80
1978306 4765 4585 60 80
1983496 4781 4604 60 80
1988686 4797 4623 60 63
1993875 4814 4641 60 63
1999066 4830 4658 60 63
2004255 4847 4673 60 63
2009446 4865 4688 60 63
2014635 4883 4702 60 100
2019826 4900 4717 60 100
2025015 4918 4734 60 100
2030206 4935 4752 60 100
2035396 4953 4772 60 100
2040587 4969 4792 60 100
 
Status
Not open for further replies.
Back
Top