So although I have mainly been done with VRC, in my remaining few days in the lab I still feel like doing a little programming project. To pay homage to Jpearman I did something very similar to his testings. Very simple mechanical structure, one 269 motor 12 tooth gear, big red encoder attached, driving an 84 tooth gear with an arrow indicating orientation. Three bumpers, one LCD, one potentiometer, and some interesting programming.
So far I have done some things I wanted to do, such as using one potentiometer and a bumper switch to directly tweak constants, simple PID target control that is easily manageable, again, homage to Jpearman.
And today I was working on automatically printing rerun program. I met Ruiqi at worlds and forgot to ask him about the rerun program, but I guess it would be testing with PID velocity and recording the joystick values only, and then plugging those values back into the loop.
So the first thing with PID velocity is to map out current vs. rpm, and this is all I got today… This has been done by jpearman before nicely, but I figure I would post my mapping here just for fun!
Information: one 269 motor plugged into a 2 wire port, one quad encoder updating velocity every 100 ms interval, acceleration wait time is 1 sec for each update.
https://vexforum.com/attachment.php?attachmentid=9305&stc=1&d=1431013575
Again, this has been done before, and this perhaps is just to again remind VRC community that…
[LIST]
motor value vs. rpm is** not linear**.
From my few trials the motor is practically motionless from power of 0 to 16.
In my case, the greatest velocity easily exceeded 100 rpm, orienting around 113 rpm max.
[/LIST]
I will work on this and if I do get my rerun to work, I’ll make a thorough tutorial about it. Special thanks to Jpearman and Cody who taught me about csv and making graphs with Excel. Thanks for you awesome people now I can do a little programming too!
Martin Ma, Peace
pid test.c (7.91 KB)
1st testing.txt (950 Bytes)