2017-08-29 01:02 AM
Hi everyone,
I need to reed a quadrature encoder signal from a sensor, modify the number of pulse and send this signal out to a machine.
The output signal must be a TTL quadrature signal, I have 5 pins: 0v, 5v, A, B and Z on my machine.
All the reading part is OK but I don't know how I should do for sending exact amount of pulse with quadrature signal.
Thank you for your help
#quadrature-encoder #output-quadrature #ttl Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-08-29 01:38 AM
As you gave no speed requirements and nearly no other informations on your environment:
Try bitbanging the signals.
2017-08-29 03:44 AM
I'm not sure I'm allowed to put commercial link on this forum
Here are information that I have
2017-08-29 04:02 AM
Your title is wrong. You need quadrature encoder input, so a quadrature decoder!
Any two channel STM32 timer can act as quadrature decode. Read the reference manual and the timer cookbook about that.
2017-08-29 04:07 AM
In my project, I have 3 main components:
A quadrature encoder which value is read by STM32, the STM32 and the chinese DRO.
The chinese DRO can't accept the resolution of the quadrature encoder so I must change the resolution with the STM32 and need the STM32 to act as a quadrature encoder for the DRO. so, if I'm correct, In need to decode the signal and to encode the new signal after
2017-08-29 04:12 AM
What is a DRO?
2017-08-29 04:13 AM
This stands for Digital Read Out. This is a display unit used on machines such as lathe, milling machine etc to show the relative position of the tool on X,Y and Z
2017-08-29 04:18 AM
And what is your translation factor. How many DRO pulses do you need for a given number of encoder pulses? I think you can generate N up pulses by programming a 2 channel timer to run N times, with both channels to toggle output on compare match and one channel set to 25 % of the period and the other 75%. For pulses for the other direction set to 75 and 25 %. But N and period need to be determined
2017-08-29 04:27 AM
This is the other tricky part.
Encoder pulse: 512 pulses per mm, hence 1.95micron per pulse
DRO can accept multiple resolution: 0.1 mic, 0.5mic, 1mic, 2mic and more.
I was thinking about using 0.1mic resolution and adjust the remaining error with DRO software or live with that error which is very very low, this is for hobby use, not professional purpose. hence when i receive 1, I send 19 pulses.
I need to pay attention to the limit of the STM32 regarding number of pulses sent in a short time. If it's not powerful enough, I can decrease the resolution.
And also, for fast traveling moment, I have the Z reference each 25mm hence each 12800 pulse in
2017-08-29 04:33 AM
Ah, so you probably have bought an encoder and a DRO that don't fit together, as the scale factor does not fit? The encoder can give you up to 10 MPulse/s, you wan't be able to rescale as described above. So weither get a display for the STM32 as DRO and use the decoded values or get a fitting DRO.