Adjusting pulsin with trim pot

hippy

Technical Support
Staff member
You could use a pot to add to or subtract from the pulse width read, could also use it as an integer or fractional multiplier, or use it to adjust values the pulse width is being compared with.

It might help to explain which pulse widths you want to adjust and how, whether this trim pot is local to the PICAXE or itself a pulse width sent via the RC transmission.
 

69-cat

Member
Something basic that would work for any of the pulsin inputs and looking for fine tuning and the pot would be local to the picaxe (on the circuit board). If the set point was set for the pulsin is 100, would like to fine tune 95-105 without re programming if possible.
Dave
 

hippy

Technical Support
Staff member
You could do something like the following. This converts the 0 to 255 pot reading to 0 to 10, adds 95, giving a variable set point of 95 to 105 ...

Code:
Symbol pulseWidth = b0
Symbol setPoint   = b1

Pulsin RC_PIN, pulseWidth

ReadAdc ADC_PIN, setPoint
setPoint = setPoint / 25 + 95

If pulseWidth > setPoint Then ...
 

the old fart

Senior Member
I've programmed loads of chips to interface with RC receivers.
mid position is 150 or 300 or 600 depending on frequency set.

So depending on the speed would determine the division factor of the ADC signal to add or subtract from the RC pulsin center position.

I often use a led output to show when the RC is in the mid position +-10.

also if you intend to pulsout to an ESC, then attempt to keep within the 20ms cycle time.
Some brushless motors do very strange thing if outside the 20ms cycle time, like start smoking.

TOF
 
Top