Jump to content

Recommended Posts

Posted

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?

  • 3 weeks later...
Posted

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.

ev3_cal_mov.png

I hope it is of some help.

/Hknssn

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...