Author Topic: HandCab WiFi Throttle Build...........  (Read 2374 times)

0 Members and 1 Guest are viewing this topic.

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #15 on: April 25, 2024, 11:50:20 AM »
0
HandCab WiFi Throttle – Part 4...

More assembly images......



.



.



.



.



.



.



.



.



.




To be Continued …...

For the whole build of this throttle go ( HERE ).

Sumner
« Last Edit: April 25, 2024, 11:57:58 AM by Sumner »
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

mmagliaro

  • Crew
  • *
  • Posts: 6359
  • Gender: Male
  • Respect: +1860
    • Maxcow Online
Re: HandCab WiFi Throttle Build...........
« Reply #16 on: April 26, 2024, 01:30:26 PM »
+1
I haven't chimed in on this project until now, but I am thoroughly enjoying this.  Very nice build and design process.

I have a few comments about detecting that pot position for the throttle position.   You say you are only using 120 degrees of the rotation of the pot, and I notice from the resistance values that you seem to be using a 10k pot and using a section in the middle of its range from about 2k to about 8k.  That's good.  Pots get more wonky at the extreme ends of their range, so staying away from the ends is a good idea.  You have notch 8 at the low end of the resistance range (about 2k)  ALSO good, and important!  If that pot ever goes open and reads 10k+, you want the train to drop to low speed or idle instead of notch 8.  Did you do that on purpose?

I assume you are using this pot as a voltage divider and just reading the voltage on a microcontroller pin to know where the throttle lever is.  It doesn't have to be exact.  It just has to fall within those ranges you listed on your little piece of paper.  But still, while this is repeatable, my concern is that it won't be repeatable across multiple pots.  Have you tried putting 3 or 4 other 10k pots in there and seeing if you get the same ranges for each position?  It's not uncommon at all for pots to vary by at least 10% from one device to another.

One other thought... does it have to be a 10k pot?  I say this because a 10k pot at 5v will draw 0.5mA.  While that sounds like nothing, this thing runs on battery power, so getting rid of every little load in the milliamp range can really extend your battery life.  A 100k pot, which would get you the same voltage readings, would only use 0.05mA.  And 100k is still low enough to not suffer from any weirdness caused by moisture, handling, stray capacitance, etc.

I think your design is clever and looks terrific.   And the better things like this get, the more it gets me thinking about them - hence the comments, which I hope you realize are intended to be helpful and engaged, not nit picking.

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #17 on: April 26, 2024, 06:12:57 PM »
+1
I think your design is clever and looks terrific.   And the better things like this get, the more it gets me thinking about them - hence the comments, which I hope you realize are intended to be helpful and engaged, not nit picking.

First off thanks for the input and the thought that went into it, 'not nit picking' at all.  Hopefully I can add insight into the project but I'm not an electrical engineer and have very little experience coding an Arduino/ESP32.  I pretty much copy others work trying to adapt what they have done to what I'm building.

Good point on the 100k pots and I don't know if I can/could use them.  I've just see 10k be the more common ones used and are what I used in building my turntable controller.  I could certainly try them and if I can get this up and running I'll do that.  The other throttle that I built using the ESP32 runs a long time on a battery but no drainage from any pots so that might be a concern.  I will put two batteries in this like I did with one of those and you can switch when one goes low.

I have a software program that I've just finished that will be used to work around the differences in pots and also how they are positioned in the throttle as that can also be a variable. The user will load and run that program in the ESP32 first to take readings on the three pots.  The program has you put the throttle in all 9 positions one at at time and hit 'c' to go to the next one.  It reads where the pot is in each position which creates a range for each position as you mentioned.  The detents seem to do a really good job with the throttle being repeatable at each notch but as you mentioned this isn't a 'has to be dead on' situation.

The software will need the pots to be wired opposite to what was initially shown.  I was just two lazy there to turn the wires around.  Not sure about a pot failure being an issue but there are two buttons on the throttle top that help there.  One shuts down the loco (or consist) being controlled and the other shuts down all track power.  They are on the other throttles I build around the same design.  Both are immediate.

The program also reads the other pots and only needs to read the full on and full off position for them.  The software divides that into ranges, 5 for the brake and 3 for the reverser.  Here is an example of the output of that program.  It changes the resistance into numbers.

-----------------------------------------------------------------------------------
/// HandCab_Data.h

int throttleIn[] = {1293,1541,1782,2015,2238,2462,2693,2926};

int brakeIn[] = {1355,1731,2107,2483,2859};

int reverserIn[] = {1355,2851};

int speedStepIn[] = {4,10,15,25,35,45,55,65};

int delayIn [] = {50,100,300};

---------------------------------------------------------------------------
The user will put those numbers into a header (.h) config file that the main throttle program in the ESP32 will read each time the throttle is used.  This will be done for any throttle that is setup or has been taken apart and the pots moved/rotated.  It will normally only be done once.  Above you can see the three pot ranges, throttleIn, brakeIn and reverserIn.  The user will also be able to input two other sets of values (at this time).

speedStep is used to tell the throttle what speed step will be sent to the loco at each notch.  In my case I speed match my locos to scale mile per hour for each speed step.  For mine notch 1 will be 4 mph, 2 will be 10 mph, ......8 will be 65 mph.  If one uses a different approach or this one you put the speed step for each notch in there that you want.  It will be for the throttle not any loco.

The acceleration and deceleration momentum will also be determined by the user also.  That is the next 3 values.  When the throttle is moved to the next notch the software sees where that is, say 35 to 45.  It won't change the speed step from 35 to 45 directly.  It will do it in steps with delays between each step.  The user determines how long those delays will be and can have three levels that can be changed real time while operating the loco to suit the conditions.  Maybe longer slower out on the main vs. shorter quicker running in a yard.  The momentum will work similar on the braking putting in delays as the throttle steps down when the throttle returns to speed step 0 and the software steps it down with the delays set by where the brake handle is.  I'll probably set mine up where the delay from 0 to 65 would take 25-30 seconds if you moved the throttle immediately from notch 0 to notch 8..

Hopefully if this works as planned the throttle will determine the momentum not the decoder so should work with any decoder out there as a number have no braking function from what I've read.  For the throttle to work well across multiple locos/decoders you will still need to speed match them to whatever speed steps you want to use.  You aren't limited to my example.

This throttle still has a long ways to go and no it isn't for everyone to build.  I can build the WitController throttle....

https://1fatgmc.com/RailRoad/DCC/WiTcontroller-Index.html

... in less than a day for about $50 and this should be similar with the addition of the 3 pots.  Peter Akers (EngineDriver designer) wrote the software for the WiTcontroller throttle and hopefully we are going to be able to integrate what I'm doing into that software/hardware so that all the functions that throttle has (lots) will be available here with the addition of the physical throttle controls that have been added.

Thanks again for the input, much appreciated (I'll check the 100K pots out if I can get things working with the 10K).

Sumner

.
« Last Edit: April 26, 2024, 06:22:10 PM by Sumner »
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #18 on: May 09, 2024, 08:27:29 PM »
+1
HandCab WiFi Throttle – Part 5....

Time to get something inside the throttle body......



.



.



.



.



.



.



.



.



.



To be Continued …...

For the whole build of this throttle go ( HERE ).

Sumner

« Last Edit: May 09, 2024, 08:29:55 PM by Sumner »
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #19 on: May 11, 2024, 12:36:40 PM »
+3
HandCab WiFi Throttle – Part 6...

Lots of wiring ......



I buy the Striveday 5 color wire packs (box with wire holes) in 22 and 30 gauge for wiring. Most all of this wiring is the 30 gauge. Used it on the other throttles with not problems so hope that holds true. A couple more colors would help on distinguishing wires during the build. To make up for that I take the magic marker and band some of the red, blue and yellow wires as shown above. I'll try to stay true to the colors shown above during the build and would recommend that you do the same if you build the throttle.



One can remap any of the buttons to different functions except B2 (horn). That button is connected to the horn lever on the right side of the control stalk (not shown above). All of the other buttons could be remapped to a different function.

Also all the keys on the keypad can be mapped to functions. For example if you have a sound decoder that has multiple functions B5 could be mapped to the coupler sound and one of the keypad keys, say #1, could be mapped to Drive-Hold.



Time to start attaching wires to the two solder pads.



Sorry that I haven't shown the horn lever yet but wanted to show the limit switch that it contacts to sound the horn.



The blue signal wire from the limit switch is soldered to one post of the B2 button switch (second horn switch). The signal wire to pin 25 of the ESP32 is also attached to the same post. Pushing the button switch or activating the horn lever on the control stalk will sound the horn.



.



.



I've found that if you overheat these button switches while soldering the leads on they likely won't work or won't work reliably. If the plastic at one of the posts gets hot and the post can move around you might have to throw the switch away.

I tin the wire, put some liquid flux I like on the post, slide the wire in, have the tip of my iron clean and put a dab of solder on it. Have my $15 60 watt iron as hot as it can go and quickly dab the iron/solder on the post and wire. You should see the solder flow almost instantly. Remove the iron after it is on the solder joint for less than 2 seconds. As soon as you see the solder flow remove the iron.

This is typical of how to solder most of the wiring in the throttle. I have my iron on full hot (iron setting says 450c – not sure if it is). I clean the tip between almost every solder joint with the sponge or tip cleaner or both, just takes a second. Flux, hot iron, watching for the solder to flow and getting on and off quickly is key to not melting wiring here or wiring to your track.

More on the $15 irons (love them) and the flux I use and other soldering tips ( HERE ). You don't need a high dollar soldering station to have success soldering but doing it will make it easier over time.



.



To be Continued …...

For the whole build of this throttle go ( HERE ).

Sumner
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

peteski

  • Crew
  • *
  • Posts: 32815
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5264
    • Coming (not so) soon...
Re: HandCab WiFi Throttle Build...........
« Reply #20 on: May 11, 2024, 05:14:59 PM »
0
I'm curious what the encoder is for.
. . . 42 . . .

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #21 on: May 11, 2024, 07:16:16 PM »
0
I'm curious what the encoder is for.

Hoping to be able switch between it and the pot throttle speed control if one wants to. 

The other two WiTcontroller throttles I build ( HERE ) use an encoder for the throttle and to be honest I can see where at times someone might want to use it over the pot throttle as it is much more responsive without all the momentum the pot throttle has.  Hopefully one will be able to turn most of that off easily with the Accel/Delay button though.

I have the other WiTcontroller throttle so I can use that anytime I want but some might only build this one and want the feel of a more traditional model railroad throttle at times.  When using the pots it is going to hopefully be more like the real thing where things happen a little slower.

There are a lot of 'hopefullys' and that is because the software isn't finished.  I think what I have written will take care of reading the pots and adding momentum via different user defined acceleration and braking delays.  Peter needs to add this to his WiTcontroller code and won't be back from vacation for another week and I don't know how many issues he has to catch up with then on that software and his continued efforts to make EngineDriver better.  This is also only the second coding I've done for an Arduino/ESP32 so once Peter sees what I've done I'll bet he will make some changes  ;).

Thanks for the interest,

Sumner
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

peteski

  • Crew
  • *
  • Posts: 32815
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5264
    • Coming (not so) soon...
Re: HandCab WiFi Throttle Build...........
« Reply #22 on: May 11, 2024, 09:20:05 PM »
0
Thanks Sumner.
. . . 42 . . .

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #23 on: May 13, 2024, 02:10:03 PM »
+2
HandCab WiFi Throttle – Part 7...

More wiring ......



.


 

Note that the OLED display bracket is shown upside down above. It needs to be turned over and the larger high part at the bottom above has to press against the lower part of the OLED board/display.



.



Hopefully once the throttle software is completed you will be able to switch between the throttle lever on the control stalk to the encoder throttle control and back and forth. At times the encoder which will be capable of changing speeds quicker than the more realistic acting throttle lever might be preferred.



.



.



Be sure to install the keypad bracket on the top of the keypad and bottom of the middle case before screwing the middle case to the top.



The WEMOS Lolin32 Lite ESP32 is capable of charging the battery/batteries but I like using the Adafruit 3 stage LiPo battery charger. It only cost $6 and is available from Adafruit or DigiKey. It comes setup as a 100mA charger but if your battery is over 500mAh you can solder across the 2 part pad at the bottom and it will charge at 500 mA per hour. Since both of the batteries I'll use are quite a bit over 500mAh I solder across the gap for the higher charging rate.

I can't find out much about the Lolin32 Lite's battery charging circuit but don't imagine it is as good at the Adafruit one. Also to use it the ESP32 has to be connected to a USB charging (5v) cord and the ESP32 itself is turned on while charging. I like the fact that for a few dollars more using their charger the ESP32 can be off except when you are using the throttle.



Above is the charging circuit. Red wire from Adafruit charger to middle two posts of the DPDT center/off switch. One set of outer poles on the toggle switch controls which batter is being used or charged. The other set goes to two 0402 LEDs that show which batter is in use. You will also run a wire from the two center posts to the On/Off switch that will be located next to this toggle switch. I didn't show that wire in the image above but now is a good time to wrap one around and solder it to the wire between the posts.

I strip the wire from the charger back a ways, tin it and then put it through one of the center posts and then over and through the other post and then solder to both of them.



To be Continued …...

For the whole build of this throttle go ( HERE ).

Sumner
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24682
  • Head Kino
  • Respect: +9122
    • Conrail 1285
Re: HandCab WiFi Throttle Build...........
« Reply #24 on: May 14, 2024, 10:12:26 AM »
+1
Every time I see it. Holy *****.

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #25 on: May 14, 2024, 10:28:32 PM »
+1
HandCab WiFi Throttle – Part 8...

Finish the wiring ......



.



.



.



.



.



I put soldering all the wires to the ESP32 off for a day procrastinating about it. Shouldn't of as it went really quick. I said a hour about, maybe a little over that but not much.

Keeping all the wires color-coded to match the schematic I posted earlier really made this pretty simple along with having the wires and the ESP32 posts all pre-tinned. I'd clean the iron tip before each solder joint and put a little bit of solder on the tip. Hold the wire to the post and drag the 'really hot' iron and solder on the tip across the solder joint and it was made in about a second.



If I built this again I would of put a piece of PCB across the two post by the ESP32 like I did for the WiTcontroller Throttle build ( HERE ). Dividing it into two parts for the negative leads (larger part) and positive leads. Divide the bottom of it also if it is a double sided PCB. Then I could of put some of the negative and positive leads hear and by the control stalk. This would of made soldering all those leads a little easier as they would have been spread between the two locations.



I put the scrap piece from a 3D print across the posts to help keep the wiring in this area from moving. A PCB would do the same.



As I did this my second 2000mAh battery hadn't arrived yet. When it did I also installed it as shown above. The DPDT c/o toggle switch allows one to select which battery is in use or being charged. The WiTcontroller throttle will run a long time on a battery but I'm thinking that the three pot circuits might run a batter down sooner so when with the one larger second battery for this build. I'll know more once it is up and running.



Time to test the software I wrote to read the pots and put in the momentum using the throttle vs. the decoder. If that all works then I'm hoping Peter will be able to add this to his WiTcontroller software that is really great.

To be Continued …...

For the whole build of this throttle go( HERE ).

Sumner
« Last Edit: May 14, 2024, 10:30:10 PM by Sumner »
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

Lemosteam

  • Crew
  • *
  • Posts: 5902
  • Gender: Male
  • PRR, The Standard Railroad of my World
  • Respect: +3620
    • Designer at Keystone Details
Re: HandCab WiFi Throttle Build...........
« Reply #26 on: May 15, 2024, 06:42:37 AM »
+1
Why is this thread not a "Best Of" yet?

Although I would have no need for this, the concept is wonderful!

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #27 on: May 18, 2024, 10:31:42 PM »
+4
HandCab WiFi Throttle – Part 9...

Ready for testing ......



.



Some small round discs of foam were cut out and put on the pot shafts below the brake and reverser handles. This puts a little drag on them and makes them feel better when operating them. They turned too freely without them. The throttle has the 9 detents and it works great with them giving 9 clear-cut stops.



.



.



.



So far love the feel of working the handles vs. the other throttles I have with only a knob. They don't run the real thing, at least from my time period with knobs.



My other throttles have the horn controlled with one of the red button switches. It works fine but again wanted a control somewhat like what you might find in a real cab. I don't have a ceiling above the throttle to hang a more conventional  pull type horn control but think the lever shown above will be a big improvement over the button switch.



One has the option of installing one or two batteries. I'm going with two like on my other throttles. Don't have to worry so much about how much charge is left in the battery. With two you need a battery selector switch. I also added two LED's to show which battery is being used or is charging. The LED's are very small 0402 LED's so hard to see the one that isn't lit above but it is there.


.



I'm done with the software to read the pots and to setup acceleration and braking momentum's. So far testing the software I love how the throttle controls feel. Way different than my other throttles that have an encoder knob. I've never been in a cab before but using the controls feel like I'm really controlling something vs. using a more conventional had throttle. You also have to pay more attention to what you are doing with the built in momentum.

So far all the testing has been with the throttle and watching the numbers on the computer screen go up and down as you run through the throttle notches and apply the brake and having to react to the built in momentum.

Peter is back from vacation and has committed to spending some time on this when he gets caught up with other projects so hopefully in the not too distant future his great WiTcontroller WiFi software will be modified to run with the pots and the throttle can be put into use with a real (N scale) loco.

To be Continued …...

For the whole build of this throttle go ( HERE )).

Sumner
« Last Edit: May 18, 2024, 10:34:19 PM by Sumner »
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html

Lemosteam

  • Crew
  • *
  • Posts: 5902
  • Gender: Male
  • PRR, The Standard Railroad of my World
  • Respect: +3620
    • Designer at Keystone Details
Re: HandCab WiFi Throttle Build...........
« Reply #28 on: May 20, 2024, 10:34:30 AM »
0
@peteski, @Ed Kapuscinski

I second my first motion for this to be a "Best Of" thread.

Sumner

  • Crew
  • *
  • Posts: 334
  • Gender: Male
  • Respect: +706
    • My Home Pages....
Re: HandCab WiFi Throttle Build...........
« Reply #29 on: May 20, 2024, 10:58:31 AM »
0
@peteski, @Ed Kapuscinski

I second my first motion for this to be a "Best Of" thread.

Thanks, but lets hold off on getting to excited until the software is up and running.  Peter and I are working on that but it isn't an easy path to adding what I have written to what he has written for the WiTcontroller and still use all the options it has. 

Right now you have the option to run up to 6 different throttles (locos or consists) at the same tine (you can toggle through them) with the WiTcontroller throttle.  Each continues on at the last command the throttle was sending for that loco or consist when you move to the next one.

If the HandCab throttle could only run one train or consist at a time things would be simpler.  For me it wouldn't be a problem as I'd run the other trains on one of the other throttles I have and they would probably being doing laps unless someone else was running that throttle.  I'd use the HandCab on only one loco/consist at a time.

Any thoughts on how that would effect you guys???

Sumner
Working in N Scale ---Modeling UP from late 40's to early 70's very loosely......

Under$8.00 Servo turnout Control --- 3D Printed Model RR Objects -- My Home Page

http://1fatgmc.com/RailRoad/RR Main/Link Page Menu.html