so my team is trying to have encoders control the speed of our flywheel. we want it to spin at X amount of rpm 100% of the time so battery power wont effect it. how do we do this and are there any tips on doing this? thanks!
January 16, 2016, 6:47am
Firstly, are you using IME’s or shaft encoders? Secondly, the best way of having a constant velocity is to make a velocity control loop like PID or TBH.
Quad optical shaft encoders.
Can you explain what the PID and the TBH are in greater detail.
PID (Proportional, Integral, Derivative) and TBH (“Take back half”) are both ways where you constantly adjust the power being supplied to the motor to keep it moving at a constant speed. For both, you get the speed of the motor from the encoder, then if it’s less than the target speed you want it will increase the power supplied to the motor and if it’s faster than you want, it reduces the power. This happens in a loop so it will be around the target speed more often than if you don’t use PID or TBH.
The difference between the two is in how the applied motor speed is calculated when the current speed is different to the target speed. With PID at its most basic (just P), the change in motor power is proportional to the difference between actual speed and target speed, so if it’s near the target speed, the applied power won’t change much. TBH works on the special case whenever the actual speed overshoots the target speed, and then halves the difference in applied power from before and after to get back to the target speed.
There’s a lot more stuff explained more clearly and in more detail on other threads on the forum as well as wikipedia pages, so I won’t go into too much detail here.
Some links (most of the forum stuff is by jpearman :D) :
W O W that was much more than I expected. the only thing that I really got from that is how they are different. (thank you for that) but I would like to know how to program it and which one to use for easy c purposes that I have.
for some reason it wont open is it able to cross from mac to windows?
can that code be used with easyc? if so how do I get what I need from it?
or I can upload my program that I have now so you can look at it and see what I need to change
those are the files I get but when I go to open it, it says
this is what I have so far (sorry for quality couldn’t figure out how to take a screenshot)