radiogareth
Senior Member
I'm making a small 12V DC powered aerial rotator. The mechanical part drives a potentiometer through 280 degrees (of its 300 degrees possible travel) as itself rotates 0-360 degrees. The 10 degrees 'spare' at each end of the potentiometer is to save it from end-stop damage in the event of minor overshoot.
I'd like to display the 'Degrees direction' via a voltmeter, i.e. representing 0-360 degrees from an output of 0 - 3.60 volts.
By using readadc10 I can get plenty of resolution of the actual position and in software I can provide a raised 0 and lowered 360, adding code to stop the motor if either are exceeded, ie turn motor drive off and light a RED led.
The DAC command seems to only offer 32 steps, not accurate enough really. Some of the forum posts show using PWM for improved accuracy but the PWM wizard only offers steps of 1%, ie that would represent 3.6 degrees? Is there a way round that? Or could I just use a simple pause loop like pause 500 high 1 pause 500 low 1 =50% pwm. With a bit of RC integration I'd end up with a stable voltage that would follow the potentiometer (20 seconds rotation 0-360)
I really wanted the visibility of the big red LED voltmeter as a display, rather than another LCD 20*2 display.
Thoughts and comments welcome...
Gareth
I'd like to display the 'Degrees direction' via a voltmeter, i.e. representing 0-360 degrees from an output of 0 - 3.60 volts.
By using readadc10 I can get plenty of resolution of the actual position and in software I can provide a raised 0 and lowered 360, adding code to stop the motor if either are exceeded, ie turn motor drive off and light a RED led.
The DAC command seems to only offer 32 steps, not accurate enough really. Some of the forum posts show using PWM for improved accuracy but the PWM wizard only offers steps of 1%, ie that would represent 3.6 degrees? Is there a way round that? Or could I just use a simple pause loop like pause 500 high 1 pause 500 low 1 =50% pwm. With a bit of RC integration I'd end up with a stable voltage that would follow the potentiometer (20 seconds rotation 0-360)
I really wanted the visibility of the big red LED voltmeter as a display, rather than another LCD 20*2 display.
Thoughts and comments welcome...
Gareth