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 »

I am progressing with my home brew 3-position switch. Question: are "Reeds" mode and S/C mutually exclusive or can I hook up both and see what suits me best? Any objection against hard wiring the 3-pos. switch to the Pro Mini board without a servo plug?

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

The reeds mode and Codamac mode are virtually identical, so I wouldn't worry too much which once you choose.

The reeds mode is nearly self explanatory, you move the switch right and the rudder goes right, you centre the switch and it goes to the centre. Move the switch left, the rudder goes left. The rudder follows the switch.

The Codamac mode is provided for conversions of transmitters such as the MacGregor Codamac or the similar Staveley Tonelock or Futaba FR23 Codemaster. These were single channel transmitters, still with a push button, but also a three position switch. The switch produced the correct timing for a compound escapement, so right switch was the same as one press of the push button and left switch the same as two presses of the push button.

The encoder emulates this, so pressing the switch right makes the rudder go right, but when released, the rudder goes quickly to neutral, then left and then back to neutral, just like a compound escapement. Similarly, left switch makes the servo go quickly right, then centre before going left.

Unless you are converting a MacGregor Codamac or similar, then start with the default reeds mode, but later try the Codamac mode to see how these old transmitters would have worked.

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,

Thanks for your explanation, it always helps to understand things better. But maybe I should have worded my question better, what I was after is if the 3-pos. switch had to be unplugged for s/c operation (and hence needs a plug in connection) and that connecting it to the board somehow forced the reed/codamac mode and prevented s/c mode. That appears not to be the case, so it will be my choice to solder the leads directly to the ProMini or make a plug in connection. Correct?

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

You can have the push button and three position switch both connected at the same time, this is the configuration I use on my practice transmitter. If I make a mess of pressing the push button and get the wrong command, I quickly use the three position switch to rescue myself. So the push button and the position switch both work together, in fact if the push switch and three position switch are use at exactly the same time, then the three position switch overrides the push button.

I have made it removable only for ease of construction. I find it easier to solder a header to the Arduino board and then use a servo lead to solder to the switch and plug it in, rather than soldering wires directly to the Arduino. But if you want to solder the three position switch straight to Arduino, it isn't a problem.

Cheers

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

Re: Yet another Single Channel Encoder

Post by MaxZ »

Thanks Mike.

My home built 3-pos. switch is ready and working fine. I decided to go the servo lead way :)

Cheers,
Max.
User avatar
_AL_
Posts: 160
Joined: 17 Feb 2018, 01:09
Location: Sydney Australia

Re: Yet another Single Channel Encoder

Post by _AL_ »

Mine is finally assembled.
I jut need to paint it & add the decals now.

Al
GEM rep2.jpg
GEM rep1.jpg
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

I am having problems programming the Arduino board. I received this: https://nl.aliexpress.com/item/1pcs-Sma ... Title=true USBasp programmer, hooked it up to a usb port of my Mac and tried to upload the Blink sketch to a Nano as a test (because it has the 6-pin connector). It did not work. I selected the 328P chip (checked that with the Nano) and the usbasp programmer. There was no port type to be selected, which suggest that I have to download a driver from somewhere, but where? The chip on the programmer is labeled ATMEGA8A AU 1320.
Rereading the ad for the USBasp programmer (see link above) I may have bought the wrong item since the ATMEGA 328P is not listed.

Now, I could program the ProMini as I have done succesfully before with my AVRISP programmer and hope that the power-up delay will not shut down my module, but how to connect the buzzer in that case?

I would appreciate if somebody could have a look at this and advise me what to do best.

Max.

Edit: I completed the adapter for the ProMini, and tried again (selected the ProMini board in Arduino). Unfortunately the result is the same.

Edit 2: Result! After searching through some other posts I found that you have to use Sketch > Upload via Programmer rather than the arrow in the sketch window. Upload now completed.

I am still left with a warning avrdude: warning: cannot set sck period. please check for usbasp firmware update. Something to worry about?

Edit 3: I found the answer to that last question in an older thread, says I should ignore the "warning"...
MaxZ
Posts: 330
Joined: 31 Jan 2019, 11:48
Location: Boskoop, Netherlands

Re: Yet another Single Channel Encoder

Post by MaxZ »

Phil_G wrote: 27 Apr 2019, 20:31 Brilliant Max, its great when you reach the stage where you can answer your own questions! :D :D :D
Bwa..just another way of saying I should do my homework first before bothering somebody else.... :roll: :D

Max.
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: Yet another Single Channel Encoder

Post by Tobe »

The "Little Grey Cells " works at different levels where 2 are in the conscious and about 3 to 5 in the unconscious and problems move as convenient between this layers where they are approached and worked out and when they are solved they popout...and they do it at their leisure not concerned about if the moment is appropriate or not. One of the reasons I always keep pen and paper readily available.
Cheers,

Tobe
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

Good to hear you have sorted out your programming problems.

Like Phil and Tobe have said, you are not alone in having a few problems, we've all encountered these type of problems in the past and continue to do so. Recently I spent a few days trying to get an ESP32 board to do reliable analogue to digital conversion while the web interface was active and eventually got there with help on other forums and a lot of trial and error. But the satisfaction when you succeed makes up for the frustration.

Now you have got the USBASP working you can use it for any other Arduino project and have the benefit of near-instant boot times. Would it help for me to expand the instructions for using the USBASP for others who are having a go themselves? I guess I'm so familiar with using the USBASP programmer, that I take it for granted and only wrote a few lines about it in the instructions.

My latest single channel transmitter project, an OS Pixie MK2 has progressed a bit. I have designed it in three parts, a base, the main body and a lid to be held on by magnets. I was away all weekend but left two 3D printers running while I was away. The base finished up as a "ball of spaghetti", but the main body came out OK. I've had a dry fit and all the components fit OK, though the 2.4 antenna hole may need moving slightly and the power switch is very close to the microswitch, I'll probably have to bend the lugs a bit and heat shrink them. I'll set the printers going again this evening to have another try at the base and the lid.

Cheers

Mike
3D print on the left, original on the right
3D print on the left, original on the right
The layout of the OS Pixie MK2
The layout of the OS Pixie MK2
Post Reply