Digital to Analog Conversion with Counters
Boss9
Posts: 8
I need to take the pulses from an rotary encoder (digital input) and output a proportional DC voltage. Looks like I would use a counter configured for POSEDGE DETECTOR for the input, but also need DUTY MODE for the output.
Question is can I configure Counter A in one mode and Counter B in the other Mode? Basically counter A FRQA stores the frequency and Counter B is in Duty Mode and the output pin varies proportionally with FRQA ?
This is being used to provide the Velocity Gain to a Servo Drive. It requires a signal proportional to 3 Vdc @ 1000 RPM. I will convert the RPM to to Khz based on the encoder resolution and ball-screw pitch.
I'm experienced at reading the encoder pulses with a Propeller, and outputting encoder counts, degrees, etc. I haven't got the counter modules down 100% . Read the Propeller labs, and the app notes on counters.
Just trying to get headed down the right path before I get started. Having trouble with the concept. Any input would be appreciated.
Question is can I configure Counter A in one mode and Counter B in the other Mode? Basically counter A FRQA stores the frequency and Counter B is in Duty Mode and the output pin varies proportionally with FRQA ?
This is being used to provide the Velocity Gain to a Servo Drive. It requires a signal proportional to 3 Vdc @ 1000 RPM. I will convert the RPM to to Khz based on the encoder resolution and ball-screw pitch.
I'm experienced at reading the encoder pulses with a Propeller, and outputting encoder counts, degrees, etc. I haven't got the counter modules down 100% . Read the Propeller labs, and the app notes on counters.
Just trying to get headed down the right path before I get started. Having trouble with the concept. Any input would be appreciated.
Comments
Here is possible (untested) code. The comments should explain it.
Andy
EDIT: I see now that you not have a Servo pulse input, but a digital encoder, so the code above does not really fit. I hope you can get something out of it anyway. A digital encoder can not be read with a counter direct, you should use an object that does that.
Thanks Andy. I may try this first as I'm more comfortable with Spin.
I tought first you had a servo pulse to convert to a analog voltage.
A digital encoder is much harder and needs Assembly, because the counters on Prop1 have no "Encoder input mode". (Prop2 will have).
Andy
I have a few projects where I read the pulses from an encoder and display as encoder counts, are as positions or degrees with some math added. Think I can take this a a base and figure it out. I give it a try here soon.
Randy