garethjellis Posted April 30, 2014 Posted April 30, 2014 Good morning, I have recently moved to EV3 from NXT and have realized that the hi-technic PID block does not work for EV3. So, I tried creating my own and have run in to all sorts of problems and am here looking for help or advice. Here is what I would like it to do, Calibrate - move a motor in a direction (to a hard stop point) reset the degrees. and make this the datum 0 point for all new move references Move - move using the datum from the calibration point a set amount of degrees. I was trying to use two degree reads 0.1 seconds apart, subtracting them using a math block then comparing it to a set value of 5 degrees to measure no movement. all contained with in a loop, using the compare to break the loop. It dont work argggg. Please help any ideas? Quote
hknssn Posted May 15, 2014 Posted May 15, 2014 Hello The code below should work as a calibration (99) and move (98) function. The move block is just a P regulator and not a PID regulator as the old one from hi technic but in most cases its enough :). With the "range" block you can set how accurate you want the move function to be, however i dont think you can go lower then -2 and +2 becouse it might get stuck in the loop depending of the P value. I have only run the code a few times so i'm pretty sure that it's not perfect and it will probably not work with a daisy chained motor. I hope it is of some help. /Hknssn Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.