Author Topic: Quadrature Direction  (Read 5131 times)

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 109
  • Karma: +0/-0
    • Dewind Dewatering
Quadrature Direction
« on: August 04, 2016, 08:57:20 PM »
I have been working with just speed pickup and now need to get direction the hydraulic motors are spinning. I can get the 1 and -1 on quad count and I can get the speed from freq. What is the best practice to combine these values for direction at speed?

I am using an MC024-020 pins C2P1, C2P2 for my speed quadrature speed sensor.

Thanks,
Mike

Offline jashom1

  • PLUS+1 Expert
  • ****
  • Posts: 78
  • Karma: +6/-0
Re: Quadrature Direction
« Reply #1 on: August 05, 2016, 06:57:14 AM »
Hi Mike,

I'd look at the quad count and if it's negative, I would just multiply the speed by -1.

Is this what you were thinking?

Cheers,

John.


Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 109
  • Karma: +0/-0
    • Dewind Dewatering
Re: Quadrature Direction
« Reply #2 on: August 08, 2016, 06:08:21 PM »
John,

That is exactly what I was thinking just wasn't sure if that was reliable. I was using a signal generator but my sign kept going 0 -1 0 -1 so likely an issue with the generator not my code.

Thanks!
Mike

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 109
  • Karma: +0/-0
    • Dewind Dewatering
Re: Quadrature Direction
« Reply #3 on: August 12, 2016, 04:35:07 PM »
I got this program loaded into the controller on the test bed and my quadcount value was jumping -1 to 0 to -1 etc. The sprocket, a 60 tooth sprocket is running one direction continuously getting these values. I haven't used the direction before so I was wondering if this is normal or if it should stay -1 steady while in one direction and 1 steady the other direction? Obviously if I have my feedback to multiply by the quadcount if it is 0 it would cause my PID loop to falter, which I am already having issues tuning.

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Quadrature Direction
« Reply #4 on: August 12, 2016, 05:19:30 PM »
Quad count is the number of measured counts this loop.  When you see 0 that means that the processor has completed a cycle without seeing a pulse - which is entirely possible.  I seem to recall that it's fairly easy to determine the average cycle time for the processor running your program, and if that time is shorter than the period of pulses from your sensor then there will be cycles that don't see a pulse.  I wouldn't be too worried about it.

I'd recommend some logic that ignores a 0 quadcount unless it's like that for a certain amount of time.  I'm envisioning an On Delay Timer and probably some Value Connect components.  It could also be accomplished fairly easily in Structured Text.
Controls Engineer
Hydra-Power Systems