What's New on the PRR Panhandle 2.0?

All Facets of O-Gauge, 3-Rail, Model Railroading
User avatar
Rufus T. Firefly
Posts: 42007
Joined: Wed May 16, 2007 7:52 am
Location: To be Determined

Re: What's New on the PRR Panhandle 2.0?

Postby Rufus T. Firefly » Wed May 11, 2022 6:47 pm

G3750 wrote:Resolved some mounting issues with the Arduino in the Open Hearth. Ordered some spacers, mounting feet, and extra jumpers.

Also made a power cable for the relay board using a USB cable - it works!

Fired up one of the relays on the board using a test snippet of Arduino code - it works! We are getting the pieces together.


Model RR'ing or going into the reanimation business?
The average train of thought isn’t big enough to carry a full sized opinion on any subject.

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Wed May 11, 2022 7:53 pm

Rufus T. Firefly wrote:
G3750 wrote:Resolved some mounting issues with the Arduino in the Open Hearth. Ordered some spacers, mounting feet, and extra jumpers.

Also made a power cable for the relay board using a USB cable - it works!

Fired up one of the relays on the board using a test snippet of Arduino code - it works! We are getting the pieces together.


Model RR'ing or going into the reanimation business?


I'm working on the Stepford Railroad! :lol: :lol: :lol: :lol:

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Thu May 19, 2022 10:40 am

Updated 5/18/2022:

While it doesn't look like it, there has been some progress made.
  • About 350 lines of C code have been written for the Open Hearth (so far), not including comments.
  • I've created a table of activities and timings for each of the four furnaces.
  • I continue to investigate sound libraries and sound effects for the mill.
  • Watching a lot of YouTube videos on the Arduino, relays, and C programming. Although I've written code in 20 programming languages over my career, this is my first foray into the C language.
  • Ordered and received a long cable for connecting my development PC to the Arduino, which is now installed inside the mill along with the first relay board, and a small breadboard.
  • Got one of the smokestack lighting circuits working. Ordered and received some additional circuits for the smokestacks (I fried one :oops: ).

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Sat May 21, 2022 8:48 pm

Updated 5/21/2022:

Every so often, you have to go backwards to make some forward progress. Here's last week's roundup of activities:

  • As you may know, there are 4 furnaces in my Open Hearth model - #11, #12, #13, and #14. The plan is to have each animate a different set of activities in the Open Hearth process. The animations are carried out on an Arduino MEGA 2560 processor running a C program I am writing. To date, I have finished the bulk of the Furnace11 code (at least the logic for invoking the relays) but I'm not particularly happy with it. It’s convoluted. I’m leaving the MP3 player logic until later.
  • I then moved on to try writing the Furnace13 code which is the most complex. Keeping track of the “{“ and matching “}” (in the C programming language) motivated me to search for a pretty-printer and a way of matching parenthesis. The answer was moving to the 2nd version of the Arduino IDE (Integrated Development Environment). It also has a debugger, which I’ve yet to try.
  • I got well into the Furnace13 state logic and decided it was becoming too big, too complex, and too unwieldy. There's a lot of potential for logic errors. Looked at YouTube and found a task scheduler tutorial. SchedTask seems to be the correct choice. I am investigating this more fully, but it looks very promising. Using the Task Scheduler will simplify the code, removing most of the state machine logic, improving comprehension, and making it easier to maintain. Using it will allow me to build small, simple functions to perform specific tasks and control their use.
  • Ordered and received a long (25’) USB A-B cable for programming the Arduino. While it lets me connect my development computer (in the workshop) to the Open Hearth base in the trainroom, I’m thinking that running back and forth is not a great idea. Therefore, I have decided to clean up the table in the workshop, move the OH onto it, and do both the programming and the physical model construction there.
  • Before I can move the model, a general clean-up of the workshop will be necessary. The paints have already gone back into their storage area beneath the spray booth. The electrical workbench will get cleared of its track-related components; the OH lighting and Arduino components will be staged there. Open Hearth structural components will go back into the Open Hearth project box until needed.

It's progress, of a sort. :roll:

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Wed Jun 08, 2022 3:05 pm

Updated 6/8/2022:

Much effort, small amount of visible progress to report.

The Arduino program is coming along. The use of the scheduler library has made the task much simpler but the bulk of the effort is still ahead of me. With all the routines needed and the complexity of the simulation, I think we are looking a program size of around 1,000 SLOC (source lines of code).

Right now I am in the process of wiring some of the relays and components inside the "Lean-To", which will house all the electronics. Thank goodness for Amazon - my source for many components and hardware fittings.

More when I know it.

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
healey36
Posts: 6944
Joined: Fri Sep 03, 2010 4:43 pm
Location: Westminster, MD

Re: What's New on the PRR Panhandle 2.0?

Postby healey36 » Sun Jun 12, 2022 9:01 am

Reading this harkens back college memories of writing BASIC, COBOL, and FORTRAN code back in the late 1970s, the latter of which used Hollerith cards for data input/storage. BASIC was interesting for the power that could be derived from something so simple; the others, not so much. It followed me into my first few years in accounting/finance before I managed to shake involvement from that level of detail in the day-to-day. I can't imagine writing a thousand lines of any code now for a hobby application, but I know there are people who do it. I'll be interested to see what you come up with.

User avatar
Rufus T. Firefly
Posts: 42007
Joined: Wed May 16, 2007 7:52 am
Location: To be Determined

Re: What's New on the PRR Panhandle 2.0?

Postby Rufus T. Firefly » Sun Jun 12, 2022 9:47 am

healey36 wrote:can't imagine writing a thousand lines of any code now for a hobby application, but I know there are people who do it.


A version of me 40+ years ago might have dashed that off pretty handily, but no, now now......good for those that do, but I'd rather build something.
The average train of thought isn’t big enough to carry a full sized opinion on any subject.

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Sun Jun 12, 2022 2:38 pm

healey36 wrote:Reading this harkens back college memories of writing BASIC, COBOL, and FORTRAN code back in the late 1970s, the latter of which used Hollerith cards for data input/storage. BASIC was interesting for the power that could be derived from something so simple; the others, not so much. It followed me into my first few years in accounting/finance before I managed to shake involvement from that level of detail in the day-to-day. I can't imagine writing a thousand lines of any code now for a hobby application, but I know there are people who do it. I'll be interested to see what you come up with.


Yes, I got involved in programming in 1974 and did write a lot of Fortran in the early part of my career. A thousand lines of code is a lot for a hobby application, but this mill program is more of a simulation than an animation. Four furnaces, 8-10 effects / furnace, and 4 operating modes makes for a fairly sophisticated piece of code. Although I can't say that C is my favorite programming language, it has been fun to rediscover the joy of making something more complicated than blinking an LED happen.

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Thu Jun 30, 2022 10:00 pm

Updated 6/30/2022:

Yesterday I had one of those moments. You know, the kind where the blind man says "I see!!!!". [laugh]

Several fixes / re-orgs took place. The Open Hearth's Arduino connects to 3 vertically stacked 8-relay boards. Trying to connect wires from lights, smoke units, and whatnot to them made me re-think the set-up. Regarding the 3 mounted and difficult to wire Arduino 8-relay boards, I’ve decided that the physical wiring connected to them are even bulkier and more troublesome to manage than the Dupont jumpers from the Arduino.

  • I disconnected all the Dupont jumpers from the relays and re-organized their pin numbering and grouping. This will make the wiring more practical and less cumbersome. For example, all overhead lights are grouped (pins - relays - wires). Same thing is being done for furnace interior lights. This will fill-out the bottom (#1) relay board. The color coding is being maintained, which requires finding the proper color 5 cm length Dupont jumpers and re-labeling them. I am using a Klein wire marking book for this purpose.
  • The above forced a pin re-numbering will have to be done inside the code as well. I created a new “cheat sheet” for the pin numbers which I am using faithfully to make the changes slowly and systematically. Otherwise, I risk losing what little sanity is left to me.
  • I discovered about 3 coding errors and fixed those. (Only 3? Yeah, it's early yet. :lol: ) As soon as the first set of wires (the overhead lights) is done, I will test out the code to see if I fixed the bugs.

The good news is that I am finding and fixing issues. At this point there don't seem to be any unexplained issues (I just hate those).

More when I know it.

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
Rufus T. Firefly
Posts: 42007
Joined: Wed May 16, 2007 7:52 am
Location: To be Determined

Re: What's New on the PRR Panhandle 2.0?

Postby Rufus T. Firefly » Fri Jul 01, 2022 8:33 am

G3750 wrote:I am using a Klein wire marking book for this purpose.


Is that anything like keeping it in a Klein bottle?
The average train of thought isn’t big enough to carry a full sized opinion on any subject.

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Fri Jul 01, 2022 6:07 pm

Rufus T. Firefly wrote:
G3750 wrote:I am using a Klein wire marking book for this purpose.


Is that anything like keeping it in a Klein bottle?


No. I only keep the genie in that.
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
Rufus T. Firefly
Posts: 42007
Joined: Wed May 16, 2007 7:52 am
Location: To be Determined

Re: What's New on the PRR Panhandle 2.0?

Postby Rufus T. Firefly » Sat Jul 02, 2022 8:15 am

G3750 wrote:
Rufus T. Firefly wrote:
G3750 wrote:I am using a Klein wire marking book for this purpose.


Is that anything like keeping it in a Klein bottle?


No. I only keep the genie in that.


Explains everything, :lol: :lol: :lol: :lol: :lol:
The average train of thought isn’t big enough to carry a full sized opinion on any subject.

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Sat Jul 02, 2022 1:25 pm

Rufus T. Firefly wrote:
G3750 wrote:
Rufus T. Firefly wrote:
Is that anything like keeping it in a Klein bottle?


No. I only keep the genie in that.


Explains everything, :lol: :lol: :lol: :lol: :lol:


Not to me. :?: :? :? :? :? :lol:
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust

User avatar
Rufus T. Firefly
Posts: 42007
Joined: Wed May 16, 2007 7:52 am
Location: To be Determined

Re: What's New on the PRR Panhandle 2.0?

Postby Rufus T. Firefly » Sat Jul 02, 2022 2:13 pm

G3750 wrote:
Rufus T. Firefly wrote:
G3750 wrote:
No. I only keep the genie in that.


Explains everything, :lol: :lol: :lol: :lol: :lol:


Not to me. :?: :? :? :? :? :lol:


Ask the genie, :wink: :wink:
The average train of thought isn’t big enough to carry a full sized opinion on any subject.

User avatar
G3750
Posts: 4344
Joined: Fri Apr 16, 2010 7:02 pm
Location: Cranberry Township, PA USA

Re: What's New on the PRR Panhandle 2.0?

Postby G3750 » Tue Jul 05, 2022 10:59 am

Updated 7/05/2022:

  • I got tired of programming and decided to start painting trusses. Man, these puppies soak up a lot of paint!
  • Also bought some Plastruct 1/8" U channel which will be used to hide the very thin (magnet) wires for the overhead lights in the mill bays. These were made by Evan Design to my specifications. The mini-chip LEDs are glued into lampshades. There are 10 lights in a string and they run under the trusses. There are 4 such strings.

George
What is a 'Conservative'? "Someone who wants society and policy to recognize objective reality- economic, biological, and historical."

—Katy Faust


Return to “O-Gauge, 3-Rail, Model Railroading”

Who is online

Users browsing this forum: No registered users and 9 guests