Yet another Single Channel Encoder

Button pushers
Post Reply
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

Thanks Ron. Covering material from my remaining stock of Solarfilm.

Max.
User avatar
RON
Site Admin
Posts: 614
Joined: 12 Jun 2017, 15:09
Location: Stokesley North Yorkshire

Re: Yet another Single Channel Encoder

Post by RON »

Brilliant. Would never of thought of that.

Plate something like this. Silver foil backing.
20AD22DC-E3DB-4296-B293-62B281BEE2BC.jpeg
G0MBV Class A Radio Amateur, North Yorkshire
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

I'll think about it Ron.

Question for Mike. I am not keen on the jumpers to set the programming/operation mode, I did order the wrong ones without a proper grip, and generally don't like to have to keep them at hand for changing settings.
I am considering fitting dip switches (5 or 6 fold) instead, soldering them directly on the ProMini (pins 5 thru 9) with one side and connect the other sides together to pin 4.
For that, I need to make some changes to the sketch. Now, i know a bit about coding, but it doesn't go very deep.
This is what I had in mind, can you please check and confirm that it is all I need to do?:
Code_changes_dip.jpg
Thanks,
Max.
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: Yet another Single Channel Encoder

Post by Mike_K »

Hi Max

A lovely looking transmitter Max, some competition for Ron!

It isn't a problem to use DIP switches, though 5-way DIP switches are not that common, the only one I know of is an Omron, but there must be many alternatives:

https://uk.farnell.com/omron/a6t5104/sw ... 9242028213

You will need to make a few other minor alterations for the Arduino program/sketch for it to compile properly. You will need to comment out the "pinMode" and "digitalWrite" for the redundant config*_0V outputs as in the attached screen-shot.
modified_4_Max.jpg
Alternatively, I've got 100's of the 0.1" jumpers with tabs that fit very securely on the normal Arduino pins. I can send you a few if it would help.

Cheers

Mike
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

Hi Mike,

Thank you for your kind offer, but for now I will wait and see what I get delivered and look for a suitable DIP switch unit in the mean time.

And thanks for the info on the code changes.

Cheers,
Max.
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

Hi again Mike,

I am altering ( a copy of) the sketch for the use of DIP switching in accordance with your instructions.

All is well, but line 36 caught my attention:
#define batteryIn 6 //Battery voltage connected to analogue I/P 6 via a potential divider...etc.
I know this is pin A6, but is the pin number defined correctly? It seems to conflict with line 21 which defines the 0V for jumper 2. Or does the analogRead statement further down looks for A6 automatically? Trying to learn here....

Cheers,
Max.
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: Yet another Single Channel Encoder

Post by Mike_K »

Hi Max

With the Arduino Pro Mini (and Nano or other ATmega328P based Arduino's) you define the digital inputs 0 - to 13 and 14 to 19 if using the analogue inputs (A0 to A6) as digital inputs. The analogue inputs (ADC) are defined 0 to 7. A6 and A7 can only be used as analogue inputs and are only available on surface mounted ATmega328P chips (Pro Mini and Nano, not Uno).

So you can define both digitalRead and analogRead from 0 to 7 without conflicting.

Mike
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

Thanks Mike, I think I get it.

Cheers,
Max.
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

From the manual:
With Electric Mode once the timer has elapsed and the throttle is still open, there will be regular short beeps every 5 seconds to remind you that the timer has elapsed and the motor is still running. There is no further warning in I/C mode.

Run Timer

Once the timer has elapsed, the Run Timer closes the throttle. It is forced on when Sequential and Electric Modes have been set, but it can be enabled for any other mode.


I am having trouble understanding this. Say I am running Electric Mode (as I will be). The first part suggests that it is possible to have the motor running after the timer has elapsed. However, the second part says that the Run Timer closes the throttle, and it is forced on in Sequential and Electric Mode.

Can someone explain please, will the motor be shut down on timer elapse or not?

Cheers,
Max.
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: Yet another Single Channel Encoder

Post by Mike_K »

Hi Max
MaxZ wrote: 04 May 2019, 17:33 From the manual:
With Electric Mode once the timer has elapsed and the throttle is still open, there will be regular short beeps every 5 seconds to remind you that the timer has elapsed and the motor is still running. There is no further warning in I/C mode.


This is for compound mode with "blip throttle" and the "motor run" timer disabled. In this case, you control the motor, so you can be flying around at full throttle after the count down timer has elapsed. The transmitter will beep at you, to remind you that the timer has elapsed.

But if the "motor run" timer has been enabled (normal for sequential), then when the timer elapses the motor stops. You won't need any further beeps to remind you that the timer has elapsed as you will be "dead-stick".

Maybe the easiest way to understand the timer would be to complete your transmitter and then try the different time settings on the bench. I think you'd understand the manual better with a working transmitter in front of you.

Cheers

Mike
Post Reply