Loading ...
Sorry, an error occurred while loading the content.
 

Re: Labyrinth maze solver

Expand Messages
  • yamanoor sairam
    Hello Dan, Thanks for your kind reply. I am attaching a picture of the system. I removed the knobs of the maze. and used a helical beam coupling between the
    Message 1 of 19 , Jun 26, 2011
    Hello Dan,

    Thanks for your kind reply. I am attaching a picture of the system. I removed the knobs of the maze. and used a helical beam coupling between the stepper motor and each axis of the stepper motor shaft. 

    So if the first video had a pre-determined track, how did he determine the angle of tilt for those movements where he had to rotate motors of both the axes? I tried doing that but I was successful only when one of the motors had to be rotated i.e linear movements. 

    So in order to compensate for the track the changes, is he taking a difference image or something to compensate for the deviation from the track? Is it like a kalman filter where he is trying to avoid an error?

    SAi







  • Dan Tebbs
    Hey SAi, That looks like it will function very well, nice work. As for to rotate motors of both the axes? , the trick here is to decompose the x and y
    Message 2 of 19 , Jun 26, 2011
      Hey SAi,

      That looks like it will function very well, nice work.

      As for "to rotate motors of both the axes?", the trick here is to decompose the x and y dimensions from the image and image deltas, and treat each separately, with their own run through the appropriate dimension's filter. The filters may be slightly different since there are slight leverage and momentum differences between the axis. Then simply update both motor positions at once on each frame.

      It would make sense to start with a single dimension. See if you can leave the ball against one wall, and then balance it halfway along the wall. Then it will be very easy to expand to 2 dimensions.

      I haven't used a Kalman filter since my college days, so take this with a grain of salt:
      It would work, but there is a gotcha in that your application might not have enough noise in it to work properly with a Kalman design.

      Perhaps a Bessel filter would be best to avoid sensitivity (undesired oscillations at certain frequencies), and since you don't need a steep cutoff.

      -Dan


      On Sun, Jun 26, 2011 at 1:20 PM, yamanoor sairam <yamanoorsai@...> wrote:
       
      [Attachment(s) from yamanoor sairam included below]

      Hello Dan,

      Thanks for your kind reply. I am attaching a picture of the system. I removed the knobs of the maze. and used a helical beam coupling between the stepper motor and each axis of the stepper motor shaft. 

      So if the first video had a pre-determined track, how did he determine the angle of tilt for those movements where he had to rotate motors of both the axes? I tried doing that but I was successful only when one of the motors had to be rotated i.e linear movements. 

      So in order to compensate for the track the changes, is he taking a difference image or something to compensate for the deviation from the track? Is it like a kalman filter where he is trying to avoid an error?

      SAi










      --
      Dan Tebbs
      Auric Consulting LLC
      Ph: 425-341-3261
      Email: AuricConsultingLLC@...
      http://www.Linkedin.com/in/dantebbs
    • yamanoor sairam
      Hello Dan,  I have attached a screen shot of my progress so far. I found your suggestion to be valuable. I am trying a single dimension now. So far, I have
      Message 3 of 19 , Jun 28, 2011
      Hello Dan,

       I have attached a screen shot of my progress so far. I found your suggestion to be valuable. I am trying a single dimension now.

      So far, I have taken the black line's contour as shown in the attached image. This is helpful to me in the path planning. I have also matched the template of the ball. I am able to print the coordinates of the ball and the coordinates of the black line in my maze.

      My computer says that the ball is at 466,288 and lets say I would like to move to 466,152 ( the end of the straight line on the image).

      I am confused about implementing the PID algorithm here. The format based on which my stepper motor controller accepts the commands is that

      Time,Number of Steps,Axis 1 motor, Axis 2 motor. 

      I thinking about the feedback that I should use for the PID algorithm. The template matching algorithm is not able to find the ball while it is spinning and my stepper would just push the ball to other side into a hole :(

      I am planning to use several waypoints in the maze to solve the problem. Should I do it like 288,268,248... 158 and try correcting the error?

      Sai
    • Dan Tebbs
      Hey Sai, Sounds like you re making great progress. I wonder if the confusion which is dogging you is the difference between a classic static balancing PID,
      Message 4 of 19 , Jun 28, 2011
        Hey Sai,

        Sounds like you're making great progress.

        I wonder if the confusion which is dogging you is the difference between a classic "static balancing" PID, and this "dynamic" PID. I suggest that you start with the static solution first, and then perhaps it will become clear how to move from a static solution into a dynamic one, as a separate step.

        So your first goal is to start the marble at the "288" position, and then get your PID to balance it somewhere in the middle of that first straight segment, say around 215. This will relate very well to the classic PID intro challenge where you are balancing an inverted pendulum. When that is working, it will move the ball to the target point (at 215). If you then perturb the ball, the PID will again return it to position 215.

        Next, simply get it to work on the other axis too. At that point you could turn on both PIDs and balance the ball around a specific point on a plane.

        At that point, I think you can see that at each time frame, you can move the PID's "balance point target" slightly along the path, and the PID will automatically react appropriately.

        -Dan


        On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@...> wrote:
         
        [Attachment(s) from yamanoor sairam included below]

        Hello Dan,

         I have attached a screen shot of my progress so far. I found your suggestion to be valuable. I am trying a single dimension now.

        So far, I have taken the black line's contour as shown in the attached image. This is helpful to me in the path planning. I have also matched the template of the ball. I am able to print the coordinates of the ball and the coordinates of the black line in my maze.

        My computer says that the ball is at 466,288 and lets say I would like to move to 466,152 ( the end of the straight line on the image).

        I am confused about implementing the PID algorithm here. The format based on which my stepper motor controller accepts the commands is that

        Time,Number of Steps,Axis 1 motor, Axis 2 motor. 

        I thinking about the feedback that I should use for the PID algorithm. The template matching algorithm is not able to find the ball while it is spinning and my stepper would just push the ball to other side into a hole :(

        I am planning to use several waypoints in the maze to solve the problem. Should I do it like 288,268,248... 158 and try correcting the error?

        Sai




        --
        Dan Tebbs
        Auric Consulting LLC
        Ph: 425-341-3261
        Email: AuricConsultingLLC@...
        http://www.Linkedin.com/in/dantebbs
      • yamanoor sairam
        Hello Dan, Thanks for the reply. That was a great idea again! So I was discussing your suggestion with some one and it occurred to me that I didn t consider
        Message 5 of 19 , Jun 29, 2011
          Hello Dan,

          Thanks for the reply. That was a great idea again!

          So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?

          If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)

          I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.

          Sai

          --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@...> wrote:
          >
          > Hey Sai,
          >
          > Sounds like you're making great progress.
          >
          > I wonder if the confusion which is dogging you is the difference between a
          > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
          > start with the static solution first, and then perhaps it will become clear
          > how to move from a static solution into a dynamic one, as a separate step.
          >
          > So your first goal is to start the marble at the "288" position, and then
          > get your PID to balance it somewhere in the middle of that first straight
          > segment, say around 215. This will relate very well to the classic PID intro
          > challenge where you are balancing an inverted pendulum. When that is
          > working, it will move the ball to the target point (at 215). If you then
          > perturb the ball, the PID will again return it to position 215.
          >
          > Next, simply get it to work on the other axis too. At that point you could
          > turn on both PIDs and balance the ball around a specific point on a plane.
          >
          > At that point, I think you can see that at each time frame, you can move the
          > PID's "balance point target" slightly along the path, and the PID will
          > automatically react appropriately.
          >
          > -Dan
          >
          >
          > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@...>wrote:
          >
          > > **
          > >
          > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
          > > below]
          > >
          > > Hello Dan,
          > >
          > > I have attached a screen shot of my progress so far. I found your
          > > suggestion to be valuable. I am trying a single dimension now.
          > >
          > > So far, I have taken the black line's contour as shown in the attached
          > > image. This is helpful to me in the path planning. I have also matched the
          > > template of the ball. I am able to print the coordinates of the ball and the
          > > coordinates of the black line in my maze.
          > >
          > > My computer says that the ball is at 466,288 and lets say I would like to
          > > move to 466,152 ( the end of the straight line on the image).
          > >
          > > I am confused about implementing the PID algorithm here. The format based
          > > on which my stepper motor controller accepts the commands is that
          > >
          > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
          > >
          > > I thinking about the feedback that I should use for the PID algorithm. The
          > > template matching algorithm is not able to find the ball while it is
          > > spinning and my stepper would just push the ball to other side into a hole
          > > :(
          > >
          > > I am planning to use several waypoints in the maze to solve the problem.
          > > Should I do it like 288,268,248... 158 and try correcting the error?
          > >
          > > Sai
          > >
          > >
          > >
          >
          >
          >
          > --
          > Dan Tebbs
          > Auric Consulting LLC
          > Ph: 425-341-3261
          > Email: AuricConsultingLLC@...
          > http://www.Linkedin.com/in/dantebbs
          >
        • David Buckley
          ... How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up
          Message 6 of 19 , Jun 29, 2011
            >I am currently trying to solve a problem where the stepper motor
            controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
             
            How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
             
             
            ----- Original Message -----
            Sent: Thursday, June 30, 2011 2:22 AM
            Subject: [SeattleRobotics] Re: Labyrinth maze solver

             

            Hello Dan,

            Thanks for the reply. That was a great idea again!

            So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?

            If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)

            I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.

            Sai

            --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@...> wrote:
            >
            > Hey Sai,
            >
            > Sounds like you're making great progress.
            >
            > I wonder if the confusion which is dogging you is the difference between a
            > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
            > start with the static solution first, and then perhaps it will become clear
            > how to move from a static solution into a dynamic one, as a separate step.
            >
            > So your first goal is to start the marble at the "288" position, and then
            > get your PID to balance it somewhere in the middle of that first straight
            > segment, say around 215. This will relate very well to the classic PID intro
            > challenge where you are balancing an inverted pendulum. When that is
            > working, it will move the ball to the target point (at 215). If you then
            > perturb the ball, the PID will again return it to position 215.
            >
            > Next, simply get it to work on the other axis too. At that point you could
            > turn on both PIDs and balance the ball around a specific point on a plane.
            >
            > At that point, I think you can see that at each time frame, you can move the
            > PID's "balance point target" slightly along the path, and the PID will
            > automatically react appropriately.
            >
            > -Dan
            >
            >
            > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@...>wrote:
            >
            > > **
            > >
            > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
            > > below]
            > >
            > > Hello Dan,
            > >
            > > I have attached a screen shot of my progress so far. I found your
            > > suggestion to be valuable. I am trying a single dimension now.
            > >
            > > So far, I have taken the black line's contour as shown in the attached
            > > image. This is helpful to me in the path planning. I have also matched the
            > > template of the ball. I am able to print the coordinates of the ball and the
            > > coordinates of the black line in my maze.
            > >
            > > My computer says that the ball is at 466,288 and lets say I would like to
            > > move to 466,152 ( the end of the straight line on the image).
            > >
            > > I am confused about implementing the PID algorithm here. The format based
            > > on which my stepper motor controller accepts the commands is that
            > >
            > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
            > >
            > > I thinking about the feedback that I should use for the PID algorithm. The
            > > template matching algorithm is not able to find the ball while it is
            > > spinning and my stepper would just push the ball to other side into a hole
            > > :(
            > >
            > > I am planning to use several waypoints in the maze to solve the problem.
            > > Should I do it like 288,268,248... 158 and try correcting the error?
            > >
            > > Sai
            > >
            > >
            > >
            >
            >
            >
            > --
            > Dan Tebbs
            > Auric Consulting LLC
            > Ph: 425-341-3261
            > Email: AuricConsultingLLC@...
            > http://www.Linkedin.com/in/dantebbs
            >

          • Dan Tebbs
            Glad you liked it, Sai. :) Re: your idea to add an accelerometer. It turns out, your setup already IS a two-axis accelerometer. You ve already identified the
            Message 7 of 19 , Jun 30, 2011
              Glad you liked it, Sai.  :)

              Re: your idea to add an accelerometer.
              It turns out, your setup already IS a two-axis accelerometer. You've already identified the ball in the image, so now simply take the 2nd derivative of your position vectors, and you get acceleration vectors.

              Re: x/2 steps should make my maze 'levelled'
              No, it doesn't work that way. Maze tilt is an acceleration force, so you have to multiply it by time to get the resultant ball velocity. Ideally you could bring the ball to a halt with the PID, and then unpower your motors and it would stay there. In reality, there is enough slop in many different points in your control loop, that the ball is in constant motion even when the field is "level". If you really want to get a ball to stop and stay passively put on a wooden plane, you'll have to take the project up two orders of magnitude in complexity and difficulty.

              Re: "just starts spinning in random"
              If you were talking a single control line, I'ld say this was either an interrupt issue, a loose wire, or a noise issue. However, if I understand correctly, then your u-controller is sending the right sequence to your stepper coils to get it to turn, so the bug could only be in the higher level logic portion of your code. Look for overflow or corner cases in code that affects your motor.

              -Dan


              On Wed, Jun 29, 2011 at 6:22 PM, yamanoor sairam <yamanoorsai@...> wrote:
               

              Hello Dan,

              Thanks for the reply. That was a great idea again!

              So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?

              If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)

              I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.

              Sai



              --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@...> wrote:
              >
              > Hey Sai,
              >
              > Sounds like you're making great progress.
              >
              > I wonder if the confusion which is dogging you is the difference between a
              > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
              > start with the static solution first, and then perhaps it will become clear
              > how to move from a static solution into a dynamic one, as a separate step.
              >
              > So your first goal is to start the marble at the "288" position, and then
              > get your PID to balance it somewhere in the middle of that first straight
              > segment, say around 215. This will relate very well to the classic PID intro
              > challenge where you are balancing an inverted pendulum. When that is
              > working, it will move the ball to the target point (at 215). If you then
              > perturb the ball, the PID will again return it to position 215.
              >
              > Next, simply get it to work on the other axis too. At that point you could
              > turn on both PIDs and balance the ball around a specific point on a plane.
              >
              > At that point, I think you can see that at each time frame, you can move the
              > PID's "balance point target" slightly along the path, and the PID will
              > automatically react appropriately.
              >
              > -Dan
              >
              >
              > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@...>wrote:
              >
              > > **
              > >
              > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included

              > > below]
              > >
              > > Hello Dan,
              > >
              > > I have attached a screen shot of my progress so far. I found your
              > > suggestion to be valuable. I am trying a single dimension now.
              > >
              > > So far, I have taken the black line's contour as shown in the attached
              > > image. This is helpful to me in the path planning. I have also matched the
              > > template of the ball. I am able to print the coordinates of the ball and the
              > > coordinates of the black line in my maze.
              > >
              > > My computer says that the ball is at 466,288 and lets say I would like to
              > > move to 466,152 ( the end of the straight line on the image).
              > >
              > > I am confused about implementing the PID algorithm here. The format based
              > > on which my stepper motor controller accepts the commands is that
              > >
              > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
              > >
              > > I thinking about the feedback that I should use for the PID algorithm. The
              > > template matching algorithm is not able to find the ball while it is
              > > spinning and my stepper would just push the ball to other side into a hole
              > > :(
              > >
              > > I am planning to use several waypoints in the maze to solve the problem.
              > > Should I do it like 288,268,248... 158 and try correcting the error?
              > >
              > > Sai
              > >
              > >
              > >
              >
              >
              >
              > --
              > Dan Tebbs
              > Auric Consulting LLC
              > Ph: 425-341-3261
              > Email: AuricConsultingLLC@...




              --
              Dan Tebbs
              Auric Consulting LLC
              Ph: 425-341-3261
              Email: DanTebbs@...
              http://www.Linkedin.com/in/dantebbs
              http://www.AuricConsultingLLC.com

            • yamanoor sairam
              ... The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn t spin but it vibrates my system slightly. I wrote
              Message 8 of 19 , Jul 1, 2011
                >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?



                The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..

                Sai



                --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                >
                > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                >
                > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                >
                >
                > ----- Original Message -----
                > From: yamanoor sairam
                > To: SeattleRobotics@yahoogroups.com
                > Sent: Thursday, June 30, 2011 2:22 AM
                > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                >
                >
                >
                > Hello Dan,
                >
                > Thanks for the reply. That was a great idea again!
                >
                > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                >
                > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                >
                > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                >
                > Sai
                >
                > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                > >
                > > Hey Sai,
                > >
                > > Sounds like you're making great progress.
                > >
                > > I wonder if the confusion which is dogging you is the difference between a
                > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                > > start with the static solution first, and then perhaps it will become clear
                > > how to move from a static solution into a dynamic one, as a separate step.
                > >
                > > So your first goal is to start the marble at the "288" position, and then
                > > get your PID to balance it somewhere in the middle of that first straight
                > > segment, say around 215. This will relate very well to the classic PID intro
                > > challenge where you are balancing an inverted pendulum. When that is
                > > working, it will move the ball to the target point (at 215). If you then
                > > perturb the ball, the PID will again return it to position 215.
                > >
                > > Next, simply get it to work on the other axis too. At that point you could
                > > turn on both PIDs and balance the ball around a specific point on a plane.
                > >
                > > At that point, I think you can see that at each time frame, you can move the
                > > PID's "balance point target" slightly along the path, and the PID will
                > > automatically react appropriately.
                > >
                > > -Dan
                > >
                > >
                > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                > >
                > > > **
                > > >
                > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                > > > below]
                > > >
                > > > Hello Dan,
                > > >
                > > > I have attached a screen shot of my progress so far. I found your
                > > > suggestion to be valuable. I am trying a single dimension now.
                > > >
                > > > So far, I have taken the black line's contour as shown in the attached
                > > > image. This is helpful to me in the path planning. I have also matched the
                > > > template of the ball. I am able to print the coordinates of the ball and the
                > > > coordinates of the black line in my maze.
                > > >
                > > > My computer says that the ball is at 466,288 and lets say I would like to
                > > > move to 466,152 ( the end of the straight line on the image).
                > > >
                > > > I am confused about implementing the PID algorithm here. The format based
                > > > on which my stepper motor controller accepts the commands is that
                > > >
                > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                > > >
                > > > I thinking about the feedback that I should use for the PID algorithm. The
                > > > template matching algorithm is not able to find the ball while it is
                > > > spinning and my stepper would just push the ball to other side into a hole
                > > > :(
                > > >
                > > > I am planning to use several waypoints in the maze to solve the problem.
                > > > Should I do it like 288,268,248... 158 and try correcting the error?
                > > >
                > > > Sai
                > > >
                > > >
                > > >
                > >
                > >
                > >
                > > --
                > > Dan Tebbs
                > > Auric Consulting LLC
                > > Ph: 425-341-3261
                > > Email: AuricConsultingLLC@
                > > http://www.Linkedin.com/in/dantebbs
                > >
                >
              • yamanoor sairam
                Hello Dan, I am sorry that I had been troubling you of late. So I actually tried implementing an algorithm that works PIDish.
                Message 9 of 19 , Jul 1, 2011
                  Hello Dan,

                  I am sorry that I had been troubling you of late.

                  So I actually tried implementing an algorithm that works PIDish.

                  http://www.youtube.com/watch?v=MEfp7RqPmqY

                  So I actually tried your earlier suggestion where I took a template of the maze, particularly the starting point and calculated the centroid of the template and the centroid of the ball location.

                  I implemented the PID algorithm such that the ball is centered around the centroid of the template.

                  Though the system outputs commands to switch direction at the right time, my stepper keeps rotating in the wrong direction. If you watch that video closely, the motor keeps rotating after reaching the farthest point on one side.

                  Is it because I am just sending out the output values as it is calculated from the PID algorithm? For e.g If my PID output is greater than 100 steps or something, just move 100 steps?

                  Is it because of the slow image processing algorithm that takes 200ms for a single cycle? Can tuning the parameters hasten the process? I am just confused whether it is the speed of the controller in processing the commands or tuning of the PID parameters.

                  I am also worried whether printing values for the debugging is delaying the execution of the PID algorithm.

                  With the centroid of the ball available, How should I go about making it follow the line?

                  Thanks,
                  Sai
                  --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@...> wrote:
                  >
                  > Glad you liked it, Sai. :)
                  >
                  > Re: your idea to add an accelerometer.
                  > It turns out, your setup already IS a two-axis accelerometer. You've already
                  > identified the ball in the image, so now simply take the 2nd derivative of
                  > your position vectors, and you get acceleration vectors.
                  >
                  > Re: x/2 steps should make my maze 'levelled'
                  > No, it doesn't work that way. Maze tilt is an acceleration force, so you
                  > have to multiply it by time to get the resultant ball velocity. Ideally you
                  > could bring the ball to a halt with the PID, and then unpower your motors
                  > and it would stay there. In reality, there is enough slop in many different
                  > points in your control loop, that the ball is in constant motion even when
                  > the field is "level". If you really want to get a ball to stop and stay
                  > passively put on a wooden plane, you'll have to take the project up two
                  > orders of magnitude in complexity and difficulty.
                  >
                  > Re: "just starts spinning in random"
                  > If you were talking a single control line, I'ld say this was either an
                  > interrupt issue, a loose wire, or a noise issue. However, if I understand
                  > correctly, then your u-controller is sending the right sequence to your
                  > stepper coils to get it to turn, so the bug could only be in the higher
                  > level logic portion of your code. Look for overflow or corner cases in code
                  > that affects your motor.
                  >
                  > -Dan
                  >
                  >
                  > On Wed, Jun 29, 2011 at 6:22 PM, yamanoor sairam <yamanoorsai@...>wrote:
                  >
                  > > **
                  > >
                  > >
                  > > Hello Dan,
                  > >
                  > > Thanks for the reply. That was a great idea again!
                  > >
                  > > So I was discussing your suggestion with some one and it occurred to me
                  > > that I didn't consider the use of an accelerometer to measure the angle of
                  > > tilt and keep the maze level in order to retain a ball at the same point.
                  > > But would that really be necessary?
                  > >
                  > > If I rotate my stepper x steps to tilt the maze in one direction and move
                  > > the ball, ideally x/2 steps should make my maze 'levelled'. This is
                  > > something that I am trying now and I will have to eliminate the need of
                  > > another sensor here. ( I really don't like to disturb my beautiful setup as
                  > > it would involve removing wood screws from that board!)
                  > >
                  > > I am currently trying to solve a problem where the stepper motor controller
                  > > while waiting for commands from my computer, just starts spinning in random!
                  > > I have to disable my motor and enable it to stop this from happening.
                  > >
                  > > Sai
                  > >
                  > >
                  > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                  > > >
                  > > > Hey Sai,
                  > > >
                  > > > Sounds like you're making great progress.
                  > > >
                  > > > I wonder if the confusion which is dogging you is the difference between
                  > > a
                  > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that
                  > > you
                  > > > start with the static solution first, and then perhaps it will become
                  > > clear
                  > > > how to move from a static solution into a dynamic one, as a separate
                  > > step.
                  > > >
                  > > > So your first goal is to start the marble at the "288" position, and then
                  > > > get your PID to balance it somewhere in the middle of that first straight
                  > > > segment, say around 215. This will relate very well to the classic PID
                  > > intro
                  > > > challenge where you are balancing an inverted pendulum. When that is
                  > > > working, it will move the ball to the target point (at 215). If you then
                  > > > perturb the ball, the PID will again return it to position 215.
                  > > >
                  > > > Next, simply get it to work on the other axis too. At that point you
                  > > could
                  > > > turn on both PIDs and balance the ball around a specific point on a
                  > > plane.
                  > > >
                  > > > At that point, I think you can see that at each time frame, you can move
                  > > the
                  > > > PID's "balance point target" slightly along the path, and the PID will
                  > > > automatically react appropriately.
                  > > >
                  > > > -Dan
                  > > >
                  > > >
                  > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                  > > >
                  > > > > **
                  > > > >
                  > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam
                  > > included
                  > >
                  > > > > below]
                  > > > >
                  > > > > Hello Dan,
                  > > > >
                  > > > > I have attached a screen shot of my progress so far. I found your
                  > > > > suggestion to be valuable. I am trying a single dimension now.
                  > > > >
                  > > > > So far, I have taken the black line's contour as shown in the attached
                  > > > > image. This is helpful to me in the path planning. I have also matched
                  > > the
                  > > > > template of the ball. I am able to print the coordinates of the ball
                  > > and the
                  > > > > coordinates of the black line in my maze.
                  > > > >
                  > > > > My computer says that the ball is at 466,288 and lets say I would like
                  > > to
                  > > > > move to 466,152 ( the end of the straight line on the image).
                  > > > >
                  > > > > I am confused about implementing the PID algorithm here. The format
                  > > based
                  > > > > on which my stepper motor controller accepts the commands is that
                  > > > >
                  > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                  > > > >
                  > > > > I thinking about the feedback that I should use for the PID algorithm.
                  > > The
                  > > > > template matching algorithm is not able to find the ball while it is
                  > > > > spinning and my stepper would just push the ball to other side into a
                  > > hole
                  > > > > :(
                  > > > >
                  > > > > I am planning to use several waypoints in the maze to solve the
                  > > problem.
                  > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                  > > > >
                  > > > > Sai
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >
                  > > >
                  > > > --
                  > > > Dan Tebbs
                  > > > Auric Consulting LLC
                  > > > Ph: 425-341-3261
                  > > > Email: AuricConsultingLLC@
                  > >
                  > > > http://www.Linkedin.com/in/dantebbs
                  > > >
                  > >
                  > >
                  > >
                  >
                  >
                  >
                  > --
                  > Dan Tebbs
                  > Auric Consulting LLC
                  > Ph: 425-341-3261
                  > Email: DanTebbs@...
                  > http://www.Linkedin.com/in/dantebbs
                  > http://www.AuricConsultingLLC.com
                  >
                • Dan Tebbs
                  Hey Sai, It looks to me like you are very close to having something working. The debugging phase is tricky though, and the devil is in the details. For a
                  Message 10 of 19 , Jul 2, 2011
                    Hey Sai,

                    It looks to me like you are very close to having something working. The debugging phase is tricky though, and the devil is in the details.

                    For a first-brush approach though, you need to discover which part of your system is misbehaving. Your PID? Your PC-side comms? Your USB link? Your motor driver circuit?

                    If you disconnect the PID and just use a floating point input field, are you able to set the board tilt angle to any value within range at will?

                    PIDs do have a serious limitation in that they can't handle out of bounds conditions. You have to pamper them a bit and ensure that they only ever receive acceptable inputs, and you add code that handles out of bounds as a separate block. The action you filmed is one possible response to that problem.

                    If you need more debugging help, let's make an appointment for you to bring the contraption by my place and we'll get it ironed out.

                    -Dan


                    On Fri, Jul 1, 2011 at 10:55 PM, yamanoor sairam <yamanoorsai@...> wrote:
                     

                    Hello Dan,

                    I am sorry that I had been troubling you of late.

                    So I actually tried implementing an algorithm that works PIDish.

                    http://www.youtube.com/watch?v=MEfp7RqPmqY

                    So I actually tried your earlier suggestion where I took a template of the maze, particularly the starting point and calculated the centroid of the template and the centroid of the ball location.

                    I implemented the PID algorithm such that the ball is centered around the centroid of the template.

                    Though the system outputs commands to switch direction at the right time, my stepper keeps rotating in the wrong direction. If you watch that video closely, the motor keeps rotating after reaching the farthest point on one side.

                    Is it because I am just sending out the output values as it is calculated from the PID algorithm? For e.g If my PID output is greater than 100 steps or something, just move 100 steps?

                    Is it because of the slow image processing algorithm that takes 200ms for a single cycle? Can tuning the parameters hasten the process? I am just confused whether it is the speed of the controller in processing the commands or tuning of the PID parameters.

                    I am also worried whether printing values for the debugging is delaying the execution of the PID algorithm.

                    With the centroid of the ball available, How should I go about making it follow the line?

                    Thanks,


                    Sai
                    --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@...> wrote:
                    >
                    > Glad you liked it, Sai. :)
                    >
                    > Re: your idea to add an accelerometer.
                    > It turns out, your setup already IS a two-axis accelerometer. You've already
                    > identified the ball in the image, so now simply take the 2nd derivative of
                    > your position vectors, and you get acceleration vectors.
                    >
                    > Re: x/2 steps should make my maze 'levelled'
                    > No, it doesn't work that way. Maze tilt is an acceleration force, so you
                    > have to multiply it by time to get the resultant ball velocity. Ideally you
                    > could bring the ball to a halt with the PID, and then unpower your motors
                    > and it would stay there. In reality, there is enough slop in many different
                    > points in your control loop, that the ball is in constant motion even when
                    > the field is "level". If you really want to get a ball to stop and stay
                    > passively put on a wooden plane, you'll have to take the project up two
                    > orders of magnitude in complexity and difficulty.
                    >
                    > Re: "just starts spinning in random"
                    > If you were talking a single control line, I'ld say this was either an
                    > interrupt issue, a loose wire, or a noise issue. However, if I understand
                    > correctly, then your u-controller is sending the right sequence to your
                    > stepper coils to get it to turn, so the bug could only be in the higher
                    > level logic portion of your code. Look for overflow or corner cases in code
                    > that affects your motor.
                    >
                    > -Dan
                    >
                    >
                    > On Wed, Jun 29, 2011 at 6:22 PM, yamanoor sairam <yamanoorsai@...>wrote:

                    >
                    > > **
                    > >
                    > >
                    > > Hello Dan,
                    > >
                    > > Thanks for the reply. That was a great idea again!
                    > >
                    > > So I was discussing your suggestion with some one and it occurred to me
                    > > that I didn't consider the use of an accelerometer to measure the angle of
                    > > tilt and keep the maze level in order to retain a ball at the same point.
                    > > But would that really be necessary?
                    > >
                    > > If I rotate my stepper x steps to tilt the maze in one direction and move
                    > > the ball, ideally x/2 steps should make my maze 'levelled'. This is
                    > > something that I am trying now and I will have to eliminate the need of
                    > > another sensor here. ( I really don't like to disturb my beautiful setup as
                    > > it would involve removing wood screws from that board!)
                    > >
                    > > I am currently trying to solve a problem where the stepper motor controller
                    > > while waiting for commands from my computer, just starts spinning in random!
                    > > I have to disable my motor and enable it to stop this from happening.
                    > >
                    > > Sai
                    > >
                    > >
                    > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                    > > >
                    > > > Hey Sai,
                    > > >
                    > > > Sounds like you're making great progress.
                    > > >
                    > > > I wonder if the confusion which is dogging you is the difference between
                    > > a
                    > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that
                    > > you
                    > > > start with the static solution first, and then perhaps it will become
                    > > clear
                    > > > how to move from a static solution into a dynamic one, as a separate
                    > > step.
                    > > >
                    > > > So your first goal is to start the marble at the "288" position, and then
                    > > > get your PID to balance it somewhere in the middle of that first straight
                    > > > segment, say around 215. This will relate very well to the classic PID
                    > > intro
                    > > > challenge where you are balancing an inverted pendulum. When that is
                    > > > working, it will move the ball to the target point (at 215). If you then
                    > > > perturb the ball, the PID will again return it to position 215.
                    > > >
                    > > > Next, simply get it to work on the other axis too. At that point you
                    > > could
                    > > > turn on both PIDs and balance the ball around a specific point on a
                    > > plane.
                    > > >
                    > > > At that point, I think you can see that at each time frame, you can move
                    > > the
                    > > > PID's "balance point target" slightly along the path, and the PID will
                    > > > automatically react appropriately.
                    > > >
                    > > > -Dan
                    > > >
                    > > >
                    > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                    > > >
                    > > > > **
                    > > > >
                    > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam
                    > > included
                    > >
                    > > > > below]
                    > > > >
                    > > > > Hello Dan,
                    > > > >
                    > > > > I have attached a screen shot of my progress so far. I found your
                    > > > > suggestion to be valuable. I am trying a single dimension now.
                    > > > >
                    > > > > So far, I have taken the black line's contour as shown in the attached
                    > > > > image. This is helpful to me in the path planning. I have also matched
                    > > the
                    > > > > template of the ball. I am able to print the coordinates of the ball
                    > > and the
                    > > > > coordinates of the black line in my maze.
                    > > > >
                    > > > > My computer says that the ball is at 466,288 and lets say I would like
                    > > to
                    > > > > move to 466,152 ( the end of the straight line on the image).
                    > > > >
                    > > > > I am confused about implementing the PID algorithm here. The format
                    > > based
                    > > > > on which my stepper motor controller accepts the commands is that
                    > > > >
                    > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                    > > > >
                    > > > > I thinking about the feedback that I should use for the PID algorithm.
                    > > The
                    > > > > template matching algorithm is not able to find the ball while it is
                    > > > > spinning and my stepper would just push the ball to other side into a
                    > > hole
                    > > > > :(
                    > > > >
                    > > > > I am planning to use several waypoints in the maze to solve the
                    > > problem.
                    > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                    > > > >
                    > > > > Sai
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > > >
                    > > >
                    > > > --
                    > > > Dan Tebbs
                    > > > Auric Consulting LLC
                    > > > Ph: 425-341-3261
                    > > > Email: AuricConsultingLLC@
                    > >
                    > > > http://www.Linkedin.com/in/dantebbs
                    > > >
                    > >
                    > >
                    > >
                    >
                    >
                    >
                    > --
                    > Dan Tebbs
                    > Auric Consulting LLC
                    > Ph: 425-341-3261
                    > Email: DanTebbs@...




                    --
                    Dan Tebbs
                    Auric Consulting LLC
                    Ph: 425-341-3261
                    Email: DanTebbs@...
                    http://www.Linkedin.com/in/dantebbs
                    http://www.AuricConsultingLLC.com

                  • David Buckley
                    Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can t say. It sounds from what the designer of
                    Message 11 of 19 , Jul 2, 2011
                      Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can't say.
                      It sounds from what the designer of the board says that there is something wrong with it's design unless it only happens when the motor is being held in a fractional step position. Can you turn off microstepping? If you do and it still happens when the motor is stopped then the board is bad.
                       
                      ----- Original Message -----
                      Sent: Saturday, July 02, 2011 6:23 AM
                      Subject: [SeattleRobotics] Re: Labyrinth maze solver

                       

                      >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?

                      The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..

                      Sai

                      --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                      >
                      > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                      >
                      > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                      >
                      >
                      > ----- Original Message -----
                      > From: yamanoor sairam
                      > To: SeattleRobotics@yahoogroups.com
                      > Sent: Thursday, June 30, 2011 2:22 AM
                      > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                      >
                      >
                      >
                      > Hello Dan,
                      >
                      > Thanks for the reply. That was a great idea again!
                      >
                      > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                      >
                      > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                      >
                      > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                      >
                      > Sai
                      >
                      > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                      > >
                      > > Hey Sai,
                      > >
                      > > Sounds like you're making great progress.
                      > >
                      > > I wonder if the confusion which is dogging you is the difference between a
                      > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                      > > start with the static solution first, and then perhaps it will become clear
                      > > how to move from a static solution into a dynamic one, as a separate step.
                      > >
                      > > So your first goal is to start the marble at the "288" position, and then
                      > > get your PID to balance it somewhere in the middle of that first straight
                      > > segment, say around 215. This will relate very well to the classic PID intro
                      > > challenge where you are balancing an inverted pendulum. When that is
                      > > working, it will move the ball to the target point (at 215). If you then
                      > > perturb the ball, the PID will again return it to position 215.
                      > >
                      > > Next, simply get it to work on the other axis too. At that point you could
                      > > turn on both PIDs and balance the ball around a specific point on a plane.
                      > >
                      > > At that point, I think you can see that at each time frame, you can move the
                      > > PID's "balance point target" slightly along the path, and the PID will
                      > > automatically react appropriately.
                      > >
                      > > -Dan
                      > >
                      > >
                      > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                      > >
                      > > > **
                      > > >
                      > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                      > > > below]
                      > > >
                      > > > Hello Dan,
                      > > >
                      > > > I have attached a screen shot of my progress so far. I found your
                      > > > suggestion to be valuable. I am trying a single dimension now.
                      > > >
                      > > > So far, I have taken the black line's contour as shown in the attached
                      > > > image. This is helpful to me in the path planning. I have also matched the
                      > > > template of the ball. I am able to print the coordinates of the ball and the
                      > > > coordinates of the black line in my maze.
                      > > >
                      > > > My computer says that the ball is at 466,288 and lets say I would like to
                      > > > move to 466,152 ( the end of the straight line on the image).
                      > > >
                      > > > I am confused about implementing the PID algorithm here. The format based
                      > > > on which my stepper motor controller accepts the commands is that
                      > > >
                      > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                      > > >
                      > > > I thinking about the feedback that I should use for the PID algorithm. The
                      > > > template matching algorithm is not able to find the ball while it is
                      > > > spinning and my stepper would just push the ball to other side into a hole
                      > > > :(
                      > > >
                      > > > I am planning to use several waypoints in the maze to solve the problem.
                      > > > Should I do it like 288,268,248... 158 and try correcting the error?
                      > > >
                      > > > Sai
                      > > >
                      > > >
                      > > >
                      > >
                      > >
                      > >
                      > > --
                      > > Dan Tebbs
                      > > Auric Consulting LLC
                      > > Ph: 425-341-3261
                      > > Email: AuricConsultingLLC@
                      > > http://www.Linkedin.com/in/dantebbs
                      > >
                      >

                    • yamanoor sairam
                      The weird stepping problem occurs when the board is sent signals continuously i.e if you keep changing the speed by varying the time duration of rotation and
                      Message 12 of 19 , Jul 6, 2011
                        The weird stepping problem occurs when the board is sent signals continuously i.e if you keep changing the speed by varying the time duration of rotation and the number of steps continuously. However, this weird action could be stopped by disabling the motors with a command at any time.

                        Sai

                        --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                        >
                        > Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can't say.
                        > It sounds from what the designer of the board says that there is something wrong with it's design unless it only happens when the motor is being held in a fractional step position. Can you turn off microstepping? If you do and it still happens when the motor is stopped then the board is bad.
                        >
                        > ----- Original Message -----
                        > From: yamanoor sairam
                        > To: SeattleRobotics@yahoogroups.com
                        > Sent: Saturday, July 02, 2011 6:23 AM
                        > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                        >
                        >
                        >
                        > >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?
                        >
                        > The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..
                        >
                        > Sai
                        >
                        > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                        > >
                        > > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                        > >
                        > > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                        > >
                        > >
                        > > ----- Original Message -----
                        > > From: yamanoor sairam
                        > > To: SeattleRobotics@yahoogroups.com
                        > > Sent: Thursday, June 30, 2011 2:22 AM
                        > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                        > >
                        > >
                        > >
                        > > Hello Dan,
                        > >
                        > > Thanks for the reply. That was a great idea again!
                        > >
                        > > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                        > >
                        > > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                        > >
                        > > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                        > >
                        > > Sai
                        > >
                        > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                        > > >
                        > > > Hey Sai,
                        > > >
                        > > > Sounds like you're making great progress.
                        > > >
                        > > > I wonder if the confusion which is dogging you is the difference between a
                        > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                        > > > start with the static solution first, and then perhaps it will become clear
                        > > > how to move from a static solution into a dynamic one, as a separate step.
                        > > >
                        > > > So your first goal is to start the marble at the "288" position, and then
                        > > > get your PID to balance it somewhere in the middle of that first straight
                        > > > segment, say around 215. This will relate very well to the classic PID intro
                        > > > challenge where you are balancing an inverted pendulum. When that is
                        > > > working, it will move the ball to the target point (at 215). If you then
                        > > > perturb the ball, the PID will again return it to position 215.
                        > > >
                        > > > Next, simply get it to work on the other axis too. At that point you could
                        > > > turn on both PIDs and balance the ball around a specific point on a plane.
                        > > >
                        > > > At that point, I think you can see that at each time frame, you can move the
                        > > > PID's "balance point target" slightly along the path, and the PID will
                        > > > automatically react appropriately.
                        > > >
                        > > > -Dan
                        > > >
                        > > >
                        > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                        > > >
                        > > > > **
                        > > > >
                        > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                        > > > > below]
                        > > > >
                        > > > > Hello Dan,
                        > > > >
                        > > > > I have attached a screen shot of my progress so far. I found your
                        > > > > suggestion to be valuable. I am trying a single dimension now.
                        > > > >
                        > > > > So far, I have taken the black line's contour as shown in the attached
                        > > > > image. This is helpful to me in the path planning. I have also matched the
                        > > > > template of the ball. I am able to print the coordinates of the ball and the
                        > > > > coordinates of the black line in my maze.
                        > > > >
                        > > > > My computer says that the ball is at 466,288 and lets say I would like to
                        > > > > move to 466,152 ( the end of the straight line on the image).
                        > > > >
                        > > > > I am confused about implementing the PID algorithm here. The format based
                        > > > > on which my stepper motor controller accepts the commands is that
                        > > > >
                        > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                        > > > >
                        > > > > I thinking about the feedback that I should use for the PID algorithm. The
                        > > > > template matching algorithm is not able to find the ball while it is
                        > > > > spinning and my stepper would just push the ball to other side into a hole
                        > > > > :(
                        > > > >
                        > > > > I am planning to use several waypoints in the maze to solve the problem.
                        > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                        > > > >
                        > > > > Sai
                        > > > >
                        > > > >
                        > > > >
                        > > >
                        > > >
                        > > >
                        > > > --
                        > > > Dan Tebbs
                        > > > Auric Consulting LLC
                        > > > Ph: 425-341-3261
                        > > > Email: AuricConsultingLLC@
                        > > > http://www.Linkedin.com/in/dantebbs
                        > > >
                        > >
                        >
                      • David Buckley
                        It sounds suspiciously like it is a software problem on the board and not fixable. Try using a different make of board. David ... From: yamanoor sairam To:
                        Message 13 of 19 , Jul 6, 2011
                          It sounds suspiciously like it is a software problem on the board and not fixable.
                          Try using a different make of board.
                          David
                           
                           
                          ----- Original Message -----
                          Sent: Thursday, July 07, 2011 2:28 AM
                          Subject: [SeattleRobotics] Re: Labyrinth maze solver

                           

                          The weird stepping problem occurs when the board is sent signals continuously i.e if you keep changing the speed by varying the time duration of rotation and the number of steps continuously. However, this weird action could be stopped by disabling the motors with a command at any time.

                          Sai

                          --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                          >
                          > Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can't say.
                          > It sounds from what the designer of the board says that there is something wrong with it's design unless it only happens when the motor is being held in a fractional step position. Can you turn off microstepping? If you do and it still happens when the motor is stopped then the board is bad.
                          >
                          > ----- Original Message -----
                          > From: yamanoor sairam
                          > To: SeattleRobotics@yahoogroups.com
                          > Sent: Saturday, July 02, 2011 6:23 AM
                          > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                          >
                          >
                          >
                          > >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?
                          >
                          > The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..
                          >
                          > Sai
                          >
                          > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                          > >
                          > > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                          > >
                          > > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                          > >
                          > >
                          > > ----- Original Message -----
                          > > From: yamanoor sairam
                          > > To: SeattleRobotics@yahoogroups.com
                          > > Sent: Thursday, June 30, 2011 2:22 AM
                          > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                          > >
                          > >
                          > >
                          > > Hello Dan,
                          > >
                          > > Thanks for the reply. That was a great idea again!
                          > >
                          > > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                          > >
                          > > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                          > >
                          > > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                          > >
                          > > Sai
                          > >
                          > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                          > > >
                          > > > Hey Sai,
                          > > >
                          > > > Sounds like you're making great progress.
                          > > >
                          > > > I wonder if the confusion which is dogging you is the difference between a
                          > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                          > > > start with the static solution first, and then perhaps it will become clear
                          > > > how to move from a static solution into a dynamic one, as a separate step.
                          > > >
                          > > > So your first goal is to start the marble at the "288" position, and then
                          > > > get your PID to balance it somewhere in the middle of that first straight
                          > > > segment, say around 215. This will relate very well to the classic PID intro
                          > > > challenge where you are balancing an inverted pendulum. When that is
                          > > > working, it will move the ball to the target point (at 215). If you then
                          > > > perturb the ball, the PID will again return it to position 215.
                          > > >
                          > > > Next, simply get it to work on the other axis too. At that point you could
                          > > > turn on both PIDs and balance the ball around a specific point on a plane.
                          > > >
                          > > > At that point, I think you can see that at each time frame, you can move the
                          > > > PID's "balance point target" slightly along the path, and the PID will
                          > > > automatically react appropriately.
                          > > >
                          > > > -Dan
                          > > >
                          > > >
                          > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                          > > >
                          > > > > **
                          > > > >
                          > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                          > > > > below]
                          > > > >
                          > > > > Hello Dan,
                          > > > >
                          > > > > I have attached a screen shot of my progress so far. I found your
                          > > > > suggestion to be valuable. I am trying a single dimension now.
                          > > > >
                          > > > > So far, I have taken the black line's contour as shown in the attached
                          > > > > image. This is helpful to me in the path planning. I have also matched the
                          > > > > template of the ball. I am able to print the coordinates of the ball and the
                          > > > > coordinates of the black line in my maze.
                          > > > >
                          > > > > My computer says that the ball is at 466,288 and lets say I would like to
                          > > > > move to 466,152 ( the end of the straight line on the image).
                          > > > >
                          > > > > I am confused about implementing the PID algorithm here. The format based
                          > > > > on which my stepper motor controller accepts the commands is that
                          > > > >
                          > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                          > > > >
                          > > > > I thinking about the feedback that I should use for the PID algorithm. The
                          > > > > template matching algorithm is not able to find the ball while it is
                          > > > > spinning and my stepper would just push the ball to other side into a hole
                          > > > > :(
                          > > > >
                          > > > > I am planning to use several waypoints in the maze to solve the problem.
                          > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                          > > > >
                          > > > > Sai
                          > > > >
                          > > > >
                          > > > >
                          > > >
                          > > >
                          > > >
                          > > > --
                          > > > Dan Tebbs
                          > > > Auric Consulting LLC
                          > > > Ph: 425-341-3261
                          > > > Email: AuricConsultingLLC@
                          > > > http://www.Linkedin.com/in/dantebbs
                          > > >
                          > >
                          >

                        • yamanoor sairam
                          Thanks, Sai
                          Message 14 of 19 , Jul 6, 2011
                            Thanks,
                            Sai

                            --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                            >
                            > It sounds suspiciously like it is a software problem on the board and not fixable.
                            > Try using a different make of board.
                            > David
                            >
                            >
                            > ----- Original Message -----
                            > From: yamanoor sairam
                            > To: SeattleRobotics@yahoogroups.com
                            > Sent: Thursday, July 07, 2011 2:28 AM
                            > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                            >
                            >
                            >
                            > The weird stepping problem occurs when the board is sent signals continuously i.e if you keep changing the speed by varying the time duration of rotation and the number of steps continuously. However, this weird action could be stopped by disabling the motors with a command at any time.
                            >
                            > Sai
                            >
                            > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                            > >
                            > > Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can't say.
                            > > It sounds from what the designer of the board says that there is something wrong with it's design unless it only happens when the motor is being held in a fractional step position. Can you turn off microstepping? If you do and it still happens when the motor is stopped then the board is bad.
                            > >
                            > > ----- Original Message -----
                            > > From: yamanoor sairam
                            > > To: SeattleRobotics@yahoogroups.com
                            > > Sent: Saturday, July 02, 2011 6:23 AM
                            > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                            > >
                            > >
                            > >
                            > > >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?
                            > >
                            > > The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..
                            > >
                            > > Sai
                            > >
                            > > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                            > > >
                            > > > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                            > > >
                            > > > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                            > > >
                            > > >
                            > > > ----- Original Message -----
                            > > > From: yamanoor sairam
                            > > > To: SeattleRobotics@yahoogroups.com
                            > > > Sent: Thursday, June 30, 2011 2:22 AM
                            > > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                            > > >
                            > > >
                            > > >
                            > > > Hello Dan,
                            > > >
                            > > > Thanks for the reply. That was a great idea again!
                            > > >
                            > > > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                            > > >
                            > > > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                            > > >
                            > > > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                            > > >
                            > > > Sai
                            > > >
                            > > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                            > > > >
                            > > > > Hey Sai,
                            > > > >
                            > > > > Sounds like you're making great progress.
                            > > > >
                            > > > > I wonder if the confusion which is dogging you is the difference between a
                            > > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                            > > > > start with the static solution first, and then perhaps it will become clear
                            > > > > how to move from a static solution into a dynamic one, as a separate step.
                            > > > >
                            > > > > So your first goal is to start the marble at the "288" position, and then
                            > > > > get your PID to balance it somewhere in the middle of that first straight
                            > > > > segment, say around 215. This will relate very well to the classic PID intro
                            > > > > challenge where you are balancing an inverted pendulum. When that is
                            > > > > working, it will move the ball to the target point (at 215). If you then
                            > > > > perturb the ball, the PID will again return it to position 215.
                            > > > >
                            > > > > Next, simply get it to work on the other axis too. At that point you could
                            > > > > turn on both PIDs and balance the ball around a specific point on a plane.
                            > > > >
                            > > > > At that point, I think you can see that at each time frame, you can move the
                            > > > > PID's "balance point target" slightly along the path, and the PID will
                            > > > > automatically react appropriately.
                            > > > >
                            > > > > -Dan
                            > > > >
                            > > > >
                            > > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                            > > > >
                            > > > > > **
                            > > > > >
                            > > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                            > > > > > below]
                            > > > > >
                            > > > > > Hello Dan,
                            > > > > >
                            > > > > > I have attached a screen shot of my progress so far. I found your
                            > > > > > suggestion to be valuable. I am trying a single dimension now.
                            > > > > >
                            > > > > > So far, I have taken the black line's contour as shown in the attached
                            > > > > > image. This is helpful to me in the path planning. I have also matched the
                            > > > > > template of the ball. I am able to print the coordinates of the ball and the
                            > > > > > coordinates of the black line in my maze.
                            > > > > >
                            > > > > > My computer says that the ball is at 466,288 and lets say I would like to
                            > > > > > move to 466,152 ( the end of the straight line on the image).
                            > > > > >
                            > > > > > I am confused about implementing the PID algorithm here. The format based
                            > > > > > on which my stepper motor controller accepts the commands is that
                            > > > > >
                            > > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                            > > > > >
                            > > > > > I thinking about the feedback that I should use for the PID algorithm. The
                            > > > > > template matching algorithm is not able to find the ball while it is
                            > > > > > spinning and my stepper would just push the ball to other side into a hole
                            > > > > > :(
                            > > > > >
                            > > > > > I am planning to use several waypoints in the maze to solve the problem.
                            > > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                            > > > > >
                            > > > > > Sai
                            > > > > >
                            > > > > >
                            > > > > >
                            > > > >
                            > > > >
                            > > > >
                            > > > > --
                            > > > > Dan Tebbs
                            > > > > Auric Consulting LLC
                            > > > > Ph: 425-341-3261
                            > > > > Email: AuricConsultingLLC@
                            > > > > http://www.Linkedin.com/in/dantebbs
                            > > > >
                            > > >
                            > >
                            >
                          • yamanoor sairam
                            Dan, I made some improvement with the PID algorithm. Earlier in the video, the motor kept spinning even after the ball has reached the other side whereas now
                            Message 15 of 19 , Jul 6, 2011
                            Dan,

                            I made some improvement with the PID algorithm. Earlier in the video, the motor kept spinning even after the ball has reached the other side whereas now the motor changes direction as soon the ball reaches other side ( I cannot stop laugh seeing the improvement so far :-) )

                            Now, I am not sure about the way I have implemented the PID algorithm. The input to the stepper is time and number of steps. But I am just using the position data in my PID algorithm i.e I am just altering the number of steps and my maze goes +/-100 alternatively. I have also limited the number of steps with a ceiling of not more than the +/- 100 steps. As of now, if the ball is to the left and trying to approach the center, it would just roll away to the other end and keep swinging back and forth. I am using the position vector and calculating the velocity and acceleration vectors.

                            Is this the right method? I am not convinced whether it would make sense to make use in the difference between two frames and use something like a Kalman filter using timestamp information and calculate the ball velocity. 

                            How should I convert the convert the PID algorithm into time and steps data? When I tilt the maze even the smallest distance, my maze's ball is on a roll! I can certainly eliminate issues due to image processing. I am totally clueless about a solution for this problem. Should I keep tilting the maze in opposite direction with a separate command. 

                            In order to get the coordinates of the trajectory, I used blob analysis technique and rendered my trajectory information on the original image and extracted the trajectory information completely as shown in the attached image. I have some information on the waypoints the ball has to follow. I will have to make it follow a simple straight line using the data.

                            Sai


                          • Dan Tebbs
                            It also sounds suspiciously like a serial buffer overflow. Have you tried turning on either hardware flow control (RTS/CTS) or software flow control (XON/XOFF)
                            Message 16 of 19 , Jul 6, 2011
                              It also sounds suspiciously like a serial buffer overflow. Have you tried turning on either hardware flow control (RTS/CTS) or software flow control (XON/XOFF) to see if that fixes it? Does the data sheet say that it requires one or the other? Can you put fixed delays in between each command to get it to work again (even if not at the update rate you want)?

                              -Dan


                              On Wed, Jul 6, 2011 at 7:50 PM, yamanoor sairam <yamanoorsai@...> wrote:
                               



                              Thanks,


                              Sai

                              --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@...> wrote:
                              >
                              > It sounds suspiciously like it is a software problem on the board and not fixable.
                              > Try using a different make of board.
                              > David
                              >
                              >
                              > ----- Original Message -----
                              > From: yamanoor sairam
                              > To: SeattleRobotics@yahoogroups.com
                              > Sent: Thursday, July 07, 2011 2:28 AM
                              > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                              >
                              >
                              >
                              > The weird stepping problem occurs when the board is sent signals continuously i.e if you keep changing the speed by varying the time duration of rotation and the number of steps continuously. However, this weird action could be stopped by disabling the motors with a command at any time.
                              >
                              > Sai
                              >
                              > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                              > >
                              > > Well since you are using Linux that eliminated one possible cause but whther Linux does similar stupid things I can't say.
                              > > It sounds from what the designer of the board says that there is something wrong with it's design unless it only happens when the motor is being held in a fractional step position. Can you turn off microstepping? If you do and it still happens when the motor is stopped then the board is bad.
                              > >
                              > > ----- Original Message -----
                              > > From: yamanoor sairam
                              > > To: SeattleRobotics@yahoogroups.com
                              > > Sent: Saturday, July 02, 2011 6:23 AM
                              > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                              > >
                              > >
                              > >
                              > > >>> How does the controller get its cmnds? Is the computer sending >>>garbage from another program? Windoz does that sort of thing, or >>>are the inputs picking up noise?
                              > >
                              > > The controller gets commands via USB serial port. I am using a Linux operating system. The motor doesn't spin but it vibrates my system slightly. I wrote to the guy who designed the board and he says that just the humming noise is common. I am not sure whether this is fine..
                              > >
                              > > Sai
                              > >
                              > > --- In SeattleRobotics@yahoogroups.com, "David Buckley" <david@> wrote:
                              > > >
                              > > > >I am currently trying to solve a problem where the stepper motor controller while waiting >for commands from my computer, just starts spinning in random! I have to disable my >motor and enable it to stop this from happening
                              > > >
                              > > > How does the controller get its cmnds? Is the computer sending garbage from another program? Windoz does that sort of thing, or are the inputs picking up noise?
                              > > >
                              > > >
                              > > > ----- Original Message -----
                              > > > From: yamanoor sairam
                              > > > To: SeattleRobotics@yahoogroups.com
                              > > > Sent: Thursday, June 30, 2011 2:22 AM
                              > > > Subject: [SeattleRobotics] Re: Labyrinth maze solver
                              > > >
                              > > >
                              > > >
                              > > > Hello Dan,
                              > > >
                              > > > Thanks for the reply. That was a great idea again!
                              > > >
                              > > > So I was discussing your suggestion with some one and it occurred to me that I didn't consider the use of an accelerometer to measure the angle of tilt and keep the maze level in order to retain a ball at the same point. But would that really be necessary?
                              > > >
                              > > > If I rotate my stepper x steps to tilt the maze in one direction and move the ball, ideally x/2 steps should make my maze 'levelled'. This is something that I am trying now and I will have to eliminate the need of another sensor here. ( I really don't like to disturb my beautiful setup as it would involve removing wood screws from that board!)
                              > > >
                              > > > I am currently trying to solve a problem where the stepper motor controller while waiting for commands from my computer, just starts spinning in random! I have to disable my motor and enable it to stop this from happening.
                              > > >
                              > > > Sai
                              > > >
                              > > > --- In SeattleRobotics@yahoogroups.com, Dan Tebbs <dantebbs@> wrote:
                              > > > >
                              > > > > Hey Sai,
                              > > > >
                              > > > > Sounds like you're making great progress.
                              > > > >
                              > > > > I wonder if the confusion which is dogging you is the difference between a
                              > > > > classic "static balancing" PID, and this "dynamic" PID. I suggest that you
                              > > > > start with the static solution first, and then perhaps it will become clear
                              > > > > how to move from a static solution into a dynamic one, as a separate step.
                              > > > >
                              > > > > So your first goal is to start the marble at the "288" position, and then
                              > > > > get your PID to balance it somewhere in the middle of that first straight
                              > > > > segment, say around 215. This will relate very well to the classic PID intro
                              > > > > challenge where you are balancing an inverted pendulum. When that is
                              > > > > working, it will move the ball to the target point (at 215). If you then
                              > > > > perturb the ball, the PID will again return it to position 215.
                              > > > >
                              > > > > Next, simply get it to work on the other axis too. At that point you could
                              > > > > turn on both PIDs and balance the ball around a specific point on a plane.
                              > > > >
                              > > > > At that point, I think you can see that at each time frame, you can move the
                              > > > > PID's "balance point target" slightly along the path, and the PID will
                              > > > > automatically react appropriately.
                              > > > >
                              > > > > -Dan
                              > > > >
                              > > > >
                              > > > > On Tue, Jun 28, 2011 at 5:33 PM, yamanoor sairam <yamanoorsai@>wrote:
                              > > > >
                              > > > > > **
                              > > > > >
                              > > > > > [Attachment(s) <#130d8d1e5a9341a6_TopText> from yamanoor sairam included
                              > > > > > below]
                              > > > > >
                              > > > > > Hello Dan,
                              > > > > >
                              > > > > > I have attached a screen shot of my progress so far. I found your
                              > > > > > suggestion to be valuable. I am trying a single dimension now.
                              > > > > >
                              > > > > > So far, I have taken the black line's contour as shown in the attached
                              > > > > > image. This is helpful to me in the path planning. I have also matched the
                              > > > > > template of the ball. I am able to print the coordinates of the ball and the
                              > > > > > coordinates of the black line in my maze.
                              > > > > >
                              > > > > > My computer says that the ball is at 466,288 and lets say I would like to
                              > > > > > move to 466,152 ( the end of the straight line on the image).
                              > > > > >
                              > > > > > I am confused about implementing the PID algorithm here. The format based
                              > > > > > on which my stepper motor controller accepts the commands is that
                              > > > > >
                              > > > > > Time,Number of Steps,Axis 1 motor, Axis 2 motor.
                              > > > > >
                              > > > > > I thinking about the feedback that I should use for the PID algorithm. The
                              > > > > > template matching algorithm is not able to find the ball while it is
                              > > > > > spinning and my stepper would just push the ball to other side into a hole
                              > > > > > :(
                              > > > > >
                              > > > > > I am planning to use several waypoints in the maze to solve the problem.
                              > > > > > Should I do it like 288,268,248... 158 and try correcting the error?
                              > > > > >
                              > > > > > Sai
                              > > > > >
                              > > > > >
                              > > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > > --
                              > > > > Dan Tebbs
                              > > > > Auric Consulting LLC
                              > > > > Ph: 425-341-3261
                              > > > > Email: AuricConsultingLLC@
                              > > > > http://www.Linkedin.com/in/dantebbs
                              > > > >
                              > > >
                              > >
                              >




                              --
                              Dan Tebbs
                              Auric Consulting LLC
                              Ph: 425-341-3261
                              Email: DanTebbs@...
                              http://www.Linkedin.com/in/dantebbs
                              http://www.AuricConsultingLLC.com

                            • Dan Tebbs
                              Hey Sai, I think at this point we need to spend some time at a whiteboard looking at the design. Please contact me off list, and let s get together to go over
                              Message 17 of 19 , Jul 6, 2011
                                Hey Sai,

                                I think at this point we need to spend some time at a whiteboard looking at the design. Please contact me off list, and let's get together to go over it.

                                -Dan


                                On Wed, Jul 6, 2011 at 8:29 PM, yamanoor sairam <yamanoorsai@...> wrote:
                                 
                                [Attachment(s) from yamanoor sairam included below]

                                Dan,

                                I made some improvement with the PID algorithm. Earlier in the video, the motor kept spinning even after the ball has reached the other side whereas now the motor changes direction as soon the ball reaches other side ( I cannot stop laugh seeing the improvement so far :-) )

                                Now, I am not sure about the way I have implemented the PID algorithm. The input to the stepper is time and number of steps. But I am just using the position data in my PID algorithm i.e I am just altering the number of steps and my maze goes +/-100 alternatively. I have also limited the number of steps with a ceiling of not more than the +/- 100 steps. As of now, if the ball is to the left and trying to approach the center, it would just roll away to the other end and keep swinging back and forth. I am using the position vector and calculating the velocity and acceleration vectors.

                                Is this the right method? I am not convinced whether it would make sense to make use in the difference between two frames and use something like a Kalman filter using timestamp information and calculate the ball velocity. 

                                How should I convert the convert the PID algorithm into time and steps data? When I tilt the maze even the smallest distance, my maze's ball is on a roll! I can certainly eliminate issues due to image processing. I am totally clueless about a solution for this problem. Should I keep tilting the maze in opposite direction with a separate command. 

                                In order to get the coordinates of the trajectory, I used blob analysis technique and rendered my trajectory information on the original image and extracted the trajectory information completely as shown in the attached image. I have some information on the waypoints the ball has to follow. I will have to make it follow a simple straight line using the data.

                                Sai





                                --
                                Dan Tebbs
                                Auric Consulting LLC
                                Ph: 425-341-3261
                                Email: DanTebbs@...
                                http://www.Linkedin.com/in/dantebbs
                                http://www.AuricConsultingLLC.com

                              Your message has been successfully submitted and would be delivered to recipients shortly.