This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
traincontrol [2021/10/15 00:18] dpisuperadmin [Software] |
traincontrol [2021/10/15 02:47] (current) dpisuperadmin [Hardware and Wiring] |
||
|---|---|---|---|
| Line 33: | Line 33: | ||
| Engine and track switch control use a dual H-bridge card and a quad open-drain driver card. The dual DC motor controller peripheral (DC2) and the dual H-bridge card (D7HB) can easily control the engine speed and direction. | Engine and track switch control use a dual H-bridge card and a quad open-drain driver card. The dual DC motor controller peripheral (DC2) and the dual H-bridge card (D7HB) can easily control the engine speed and direction. | ||
| - | The track switches are left and right hand three-wire switches from Atlas. | + | The track switches are left and right hand three-wire switches from Atlas. |
| One problem with our chosen hardware is that at power up the open-drain driver outputs are at ground. | One problem with our chosen hardware is that at power up the open-drain driver outputs are at ground. | ||
| Line 43: | Line 43: | ||
| A wireviz generated wiring diagram for the system is shown below. | A wireviz generated wiring diagram for the system is shown below. | ||
| {{ wiki: | {{ wiki: | ||
| + | /* Wiringviz source file for the above | ||
| + | connectors: | ||
| + | Switch-Left: | ||
| + | type: Soldered wires | ||
| + | pinlabels: [Coil-Left, Common, Coil-Straight] | ||
| + | show_name: false | ||
| + | notes: Track Switch Left | ||
| + | Switch-Right: | ||
| + | type: Soldered wires | ||
| + | pinlabels: [Coil-Right, | ||
| + | show_name: false | ||
| + | notes: Track Switch Right | ||
| + | DC-IN: | ||
| + | type: Barrel | ||
| + | subtype: female | ||
| + | pinlabels: [V+, GND] | ||
| + | show_name: false | ||
| + | notes: Power Adapter | ||
| + | SMR-5: | ||
| + | type: screw terminal | ||
| + | pinlabels: [V+, GND, V5.0, GND] | ||
| + | show_name: false | ||
| + | notes: SMR-5 regulator | ||
| + | DRV4: | ||
| + | type: screw terminal | ||
| + | pinlabels: [V+, GND, O1, O2, O3, O4] | ||
| + | show_name: false | ||
| + | notes: DRV4 Open-Drain Driver | ||
| + | D7HB: | ||
| + | type: screw terminal | ||
| + | pinlabels: [V+, GND, A1, A2, B1, B2] | ||
| + | show_name: false | ||
| + | notes: D7HB H-bridge | ||
| + | SBC: | ||
| + | type: Soldered wires | ||
| + | pinlabels: [V5.0, GND] | ||
| + | show_name: false | ||
| + | notes: Single Board Computer | ||
| + | Track: | ||
| + | type: screw terminal | ||
| + | pinlabels: [Rail-1, Rail-2] | ||
| + | show_name: false | ||
| + | notes: Track | ||
| + | |||
| + | cables: | ||
| + | W1: | ||
| + | colors: [RD,BK] | ||
| + | W2: | ||
| + | colors: [RD,BK] | ||
| + | W3: | ||
| + | colors: [RD,WH] | ||
| + | W4: | ||
| + | colors: [RD,WH] | ||
| + | W5: | ||
| + | colors: [GN,YE,RD] | ||
| + | W6: | ||
| + | colors: [GN,YE,RD] | ||
| + | W7: | ||
| + | colors: [RD,WH] | ||
| + | |||
| + | connections: | ||
| + | - | ||
| + | - DRV4: [4,1,3] | ||
| + | - W5: [1,2,3] | ||
| + | - Switch-Left: | ||
| + | - | ||
| + | - DRV4: [5,1,6] | ||
| + | - W6: [1,2,3] | ||
| + | - Switch-Right: | ||
| + | - | ||
| + | - DRV4: [1,2] | ||
| + | - W7: [1,2] | ||
| + | - D7HB: [5,2] | ||
| + | - | ||
| + | - DC-IN: [1-2] | ||
| + | - W1: [1-2] | ||
| + | - SMR-5: [1-2] | ||
| + | - | ||
| + | - D7HB: [1-2] | ||
| + | - W2: [1-2] | ||
| + | - SMR-5: [1-2] | ||
| + | - | ||
| + | - SMR-5: [3,4] | ||
| + | - W3: [1-2] | ||
| + | - SBC: [1-2] | ||
| + | - | ||
| + | - D7HB: [3,4] | ||
| + | - W4: [1,2] | ||
| + | - Track: [1,2] | ||
| + | */ | ||
| ==== Peripherals ==== | ==== Peripherals ==== | ||
| Line 177: | Line 267: | ||
| switch_left = " | switch_left = " | ||
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| - | time.sleep(0.10) | + | time.sleep(0.05) |
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| elif (int(switches[0], | elif (int(switches[0], | ||
| switch_left = " | switch_left = " | ||
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| - | time.sleep(0.10) | + | time.sleep(0.05) |
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| if (int(switches[0], | if (int(switches[0], | ||
| switch_right = " | switch_right = " | ||
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| - | time.sleep(0.10) | + | time.sleep(0.05) |
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| elif (int(switches[0], | elif (int(switches[0], | ||
| switch_right = " | switch_right = " | ||
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| - | time.sleep(0.10) | + | time.sleep(0.05) |
| response = send_cmd(sock_cmd, | response = send_cmd(sock_cmd, | ||
| # | # | ||