Jump to content

BlazK

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BlazK's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Yes, this is OK for determing the direction. But seems that i will have to do the speed measurement manually. Probably the best is to do it in the interrupt routine: " _Interrupt HSC 0,1", which is triggered when the HSC (reload) is reloaded (when the "reload event" bit is triggered). In the meantime i made a timing diagram to show you, where is the main problem in the HSC behaviour (.pdf attachment) V430_HSC_encoderX2_timingdiagram.pdf
  2. I need speed and direction. Speed of the line in m/min, but i need to detect when the material reverses. Also wanted to use x4 encoder, so i get more pulses out per rotation, because as i said that encoder has a poor resolution and i can see some incoming problems at low speeds and start ups
  3. Yes, i know that, on x2 encoder setting, the HSC counts on: rising edge of A falling edge of A On x4 setting it counts on: rising edge of A rising edge of B falling edge of A falling edge of B What bothers me, is that the HSC acts differently when counting positive vs. when counting negative. I figured that out after almost two days of trying to get that frequency measurement function to work. That function seems to have everything that i need. It has dynamic HSC preset to adopt for low and high frequencies, status output...
  4. Hello to everyone, I am trying to get the encoder input working properly, but after some banging with the head to the table i think i found something strange. First let me describe what i want to do and what hardware i have... V430-J-TA24 Quadrature encoder on HSC inputs I0 and I1 (A and B tracks od encoder) Measuring of the speed in both directions Pulse frequency is quite low as the encoder resolution is poor (existing encoder on the machine), so the function to measure frequency in the HW config is not OK, as it is only accurate to 1Hz i am testing on bench with the function generator instead of encoder, so i can observe nice and even counts I had high hopes for the Freq <- HSC function (Frequency measurement based on HSC), but it does not work into negative counting. In positive direction everything is OK, but in reverse it gives out status 16. I have now noticed that the HSC counter acts a bit strange. In the positive direction it resets it selfs when it is above the "Counter target value". (reset of counter = when "counter value" > "target value") In the negative direction it resets when it is equal to the "Counter target value". (reset of counter = when "counter value" = "target value") I made a simple program so you can see what i mean. In the middle i change the direction of encoder. A and B are encoder tracks. I also tried a completelly new, blank project and i can replicate the problem with manual changing of the HSC preset value while reversing the encoder signal. If anyone will try this, keep in mind that the HSC target value is taken into account only after the "enable reload" bit is reset and set again. My guess is that the "Freq <- HSC" function does not work correct because of this problem. In the negative direction the function gives out a negative value for the HSC preset on the output "I" (HSC Freq. Measurement: function’s Reload Value), but that value is never reached, because the HSC resets itself one value before that. Did anyone else had such problems and what was the solution? V430_testHSC_1.vlp
×
×
  • Create New...