User Tools

Site Tools


traincontrol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
traincontrol [2021/10/15 00:38]
dpisuperadmin [Hardware and Wiring]
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.  We set the PWM frequency to 50 Hertz to give better low speed control of the engine.  A better solution to low speed control might be the LC filter described in the Next-Steps section below. 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.  We set the PWM frequency to 50 Hertz to give better low speed control of the engine.  A better solution to low speed control might be the LC filter described in the Next-Steps section below.
  
-The track switches are left and right hand three-wire switches from Atlas.  These switches have a common wire and two coil wires.  Energizing a coil causes the switch to change position.  These coils must be energized only long enough to switch.  They will overheat and be damaged if the coils remain energized for an extended time.  Switching only takes 100 ms or so. Since we are using open-drain drivers we have to tie the common line to a positive voltage.+The track switches are left and right hand three-wire switches from Atlas.  These switches have a common wire and two coil wires.  Energizing a coil causes the switch to change position.  These coils must be energized only long enough to switch.  They will overheat and be damaged if the coils remain energized for an extended time.  Switching only takes 50 ms or so. Since we are using open-drain drivers we have to tie the common line to a positive voltage.
  
 One problem with our chosen hardware is that at power up the open-drain driver outputs are at ground.  This is a problem since the switch coils could overheat if the system does not come up fast enough.  Recall that one of our goals was to build this system quickly and we did not want to add more hardware to the system.  We found a simple solution using the available hardware. The engine control only uses one H-bridge, and the power up state of the H-bridge is ground.  Since the H-bridge can handle seven amps we connected the common (positive voltage) of the track switches to one output of the second H-bridge.  We turn the H-bridge on after system boot and so do not risk overheating the switch coils. One problem with our chosen hardware is that at power up the open-drain driver outputs are at ground.  This is a problem since the switch coils could overheat if the system does not come up fast enough.  Recall that one of our goals was to build this system quickly and we did not want to add more hardware to the system.  We found a simple solution using the available hardware. The engine control only uses one H-bridge, and the power up state of the H-bridge is ground.  Since the H-bridge can handle seven amps we connected the common (positive voltage) of the track switches to one output of the second H-bridge.  We turn the H-bridge on after system boot and so do not risk overheating the switch coils.
Line 267: Line 267:
             switch_left = "l"             switch_left = "l"
             response = send_cmd(sock_cmd, b'dpset out4 outval d \n')             response = send_cmd(sock_cmd, b'dpset out4 outval d \n')
-            time.sleep(0.10)+            time.sleep(0.05)
             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')
         elif (int(switches[0],16) & 8 == 0) and (switch_left != "s") :         elif (int(switches[0],16) & 8 == 0) and (switch_left != "s") :
             switch_left = "s"             switch_left = "s"
             response = send_cmd(sock_cmd, b'dpset out4 outval e \n')             response = send_cmd(sock_cmd, b'dpset out4 outval e \n')
-            time.sleep(0.10)+            time.sleep(0.05)
             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')
         if (int(switches[0],16) & 4 == 4) and (switch_right != "r") :         if (int(switches[0],16) & 4 == 4) and (switch_right != "r") :
             switch_right = "r"             switch_right = "r"
             response = send_cmd(sock_cmd, b'dpset out4 outval b \n')             response = send_cmd(sock_cmd, b'dpset out4 outval b \n')
-            time.sleep(0.10)+            time.sleep(0.05)
             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')
         elif (int(switches[0],16) & 4 == 0) and (switch_right != "s") :         elif (int(switches[0],16) & 4 == 0) and (switch_right != "s") :
             switch_right = "s"             switch_right = "s"
             response = send_cmd(sock_cmd, b'dpset out4 outval 7 \n')             response = send_cmd(sock_cmd, b'dpset out4 outval 7 \n')
-            time.sleep(0.10)+            time.sleep(0.05)
             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')             response = send_cmd(sock_cmd, b'dpset out4 outval f \n')
         #print("switches : ", switch_left, switch_right)         #print("switches : ", switch_left, switch_right)
traincontrol.1634258312.txt.gz ยท Last modified: 2021/10/15 00:38 by dpisuperadmin