RE: Faller Car Drehscheibe

#1 von moppe , 16.06.2019 22:38

Hier ein kleines Video von meiner letztere Entwicklung.

Ein Faller Car "Drehscheibe".

https://youtu.be/UHAaZNi1aVE

Es ist nicht der fertige Projekt, sondern "proof of concept" - und ja, es kann lassen sich zu tun ein Faller Car Drehscheibe zu bauen, mit 2 Servos, 2 Magneten, 1 Foto Taster, 1 Arduino und ein kleines Display.


Klaus


"Meine" Modellbahn:http://www.modelbaneeuropa.dk
Dänisches Bahnforum: http://www.baneforum.dk
PIKO C4 "Horror Gallery": http://moppe.dk/PIKOC4.html


 
moppe
Trans Europ Express (TEE)
Beiträge: 9.191
Registriert am: 07.08.2011
Homepage: Link
Ort: Norddeusche halbinsel
Gleise Roco, PECO, Märklin/Trix, PIKO,
Spurweite H0, H0e, N, Z
Steuerung Z21, Lenz, MpC Gahler+Ringsmeier, Games on Track/Faller
Stromart AC, DC, Digital, Analog

zuletzt bearbeitet 05.04.2022 | Top

RE: Faller Car Drehscheibe

#2 von hans-gander , 16.06.2019 23:37

Hallo Klaus,
sieht gut aus. Aber wozu ist die obere Mechanik, mit dem zweiten Servo?
Fragende Grüße
Hans


 
hans-gander
CityNightLine (CNL)
Beiträge: 1.816
Registriert am: 16.10.2007
Gleise Tillig Elite
Spurweite H0, H0m
Steuerung Lenz mit Railware
Stromart DC, Digital


RE: Faller Car Drehscheibe

#3 von V 200 , 17.06.2019 00:00

Hallo Hans,ich tippe,damit wird per Magnet der RedKontakt geschlossen damit das Auto die Drehscheibe verlässt.
Gruss ECKI


TEE RAM


V 200  
V 200
InterRegioExpress (IRE)
Beiträge: 464
Registriert am: 26.10.2007


RE: Faller Car Drehscheibe

#4 von moppe , 17.06.2019 00:13

Zitat

Aber wozu ist die obere Mechanik, mit dem zweiten Servo?



In der Brücke is ein Stoppmagnet.

Um der Magnetfelder dieser Stoppmagnet zu schwächen drehen ich der zweite Magnet ein bis die erste und „saugt“ der Magnetfelder weg von der Auto.


Klaus


"Meine" Modellbahn:http://www.modelbaneeuropa.dk
Dänisches Bahnforum: http://www.baneforum.dk
PIKO C4 "Horror Gallery": http://moppe.dk/PIKOC4.html


 
moppe
Trans Europ Express (TEE)
Beiträge: 9.191
Registriert am: 07.08.2011
Homepage: Link
Ort: Norddeusche halbinsel
Gleise Roco, PECO, Märklin/Trix, PIKO,
Spurweite H0, H0e, N, Z
Steuerung Z21, Lenz, MpC Gahler+Ringsmeier, Games on Track/Faller
Stromart AC, DC, Digital, Analog


RE: Faller Car Drehscheibe

#5 von hans-gander , 17.06.2019 20:55

...vielen Dank für eure informative Rückmeldung.

Grüße
Hans


 
hans-gander
CityNightLine (CNL)
Beiträge: 1.816
Registriert am: 16.10.2007
Gleise Tillig Elite
Spurweite H0, H0m
Steuerung Lenz mit Railware
Stromart DC, Digital


RE: Faller Car Drehscheibe

#6 von moppe , 17.06.2019 22:25

Hier die code fürs Arduino

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
 
 /* FallerCar turn around unit
* Input detecs a car and is blinded until sequence is finish
* FallerCar drives onto turntable.
* Turntable turns 180 degress and the car starts again
* Second servo moves a magnet close to the stop magnet in the table to neutralize it.
* After one second the turntable goes back to initial position and "unblinds" the sensor.
*
* LCD shows status of the sequence.
* Serial port sends status of the sequence.
*
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
*
*
*/
 
#include <Servo.h> // include the library code for servo:
Servo Turnservo; // create servo object to control a servo
Servo Startservo; // create servo object to control a servo
 

#include <LiquidCrystal.h> // include the library code for LCD:
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; // initialize the library by associating any needed LCD interface pin
LiquidCrystal lcd(rs, en, d4, d5, d6, d7); // with the arduino pin number it is connected to
 
// Variabels for the first servo, that controls the turntable
int pos = 0; // variable to store the servo position
int MinPos = 10; // minimum servo angle in degrees
int MaxPos = 180; // maximum servo angle in degrees
int ServoSpeedLoad = 25; // delay in servospeed under load
int ServoSpeedEmpty = 25; // delay in servospeed empty
 
// Variables for the second servo, that controls the start magnet.
int SSpos = 0; // variable to store the stopservo position
int SSMinPos = 20; // minimum servo angle in degrees
int SSMaxPos = 90; // maximum servo angle in degrees
int SSServoSpeed = 25; // delay in servospeed
 

// I/O pins:
const int inputPin = 8; // the number of the input pin
int InputState = 0; // variable for reading the input status
const int ledPin1 = A0; // the number of the LED1 pin (sequence running)
const int ledPin2 = A1; // the number of the LED2 pin (table turning)
const int ledPin3 = A2; // the number of the LED3 pin (pause)
 

int FCInPause = 2000; // Pause for Faller car entering turntable
int FCOutPause = 1000; // Pause for Faller car leaving turntable
 

void setup() {
 
pinMode(inputPin, INPUT_PULLUP); // initialize the input pin as an input with pullup:
pinMode(ledPin1, OUTPUT); // initialize the LED1 pin as an output:
pinMode(ledPin2, OUTPUT); // initialize the LED2 pin as an output:
pinMode(ledPin3, OUTPUT); // initialize the LED3 pin as an output:
 
Serial.begin(9600); // start serial port
Serial.println("Startup"); // Send status to serial port
 
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print(" Faller Car "); // Print start up message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 2
lcd.print(" Turntable "); // Print start up message to the LCD.

Turnservo.attach(9); // attaches the servo on pin 9 to the servo object
Turnservo.write(MaxPos); // tell servo to go to reference position
delay (1500); // wait 1,5 second
Turnservo.detach(); // detach servo to supress stutter

Startservo.attach(10); // attaches the servo on pin 10 to the servo object
Startservo.write(SSMaxPos); // tell servo to go to reference position
delay (1500); // wait 1,5 second
Startservo.detach(); // detach servo to supress stutter

digitalWrite(ledPin1, HIGH); // turn off LED1 (sequence running)
digitalWrite(ledPin2, HIGH); // turn off LED2 (table turning)
digitalWrite(ledPin3, HIGH); // turn off LED3 (pause)

lcd.clear(); // clear LCD

}
 

void loop() {
InputState = digitalRead(inputPin); // read the state of the pushbutton
if (InputState == LOW) { // check if the pushbutton is pressed. If it is, the InputState is LOW:
digitalWrite(ledPin1, LOW); // turn on LED1 (sequence running)
Serial.println("Car detected - Sequence start"); // Send status to serial port

digitalWrite(ledPin3, LOW); // turn on LED3 (pause)
Serial.println("Car entering turntable"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Car entering "); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 1
lcd.print("turntable "); // Send status message to the LCD.
delay(FCInPause); // wait for FallerCar to enter the turntable
digitalWrite(ledPin3, HIGH); // turn off LED3 (pause)
 

Turnservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.println("Table turning"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Table turning "); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 1
lcd.print("Pos: "); // Send status message to the LCD.
 


{
digitalWrite(ledPin2, LOW); // turn on LED2 (table turning)
for (pos = MaxPos; pos >= MinPos; pos -= 1) { // goes from maximum servo angle to minimum servo angle in 1 degree steps
Turnservo.write(pos); // tell servo to go to position in variable 'pos'
delay(ServoSpeedLoad); // waits XXms for the servo to reach the position
Serial.print("Pos = "); // Send status to serial port
Serial.print(pos); // Send position to serial port
Serial.println(" deg."); // Send status to serial port
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(" "); // Clear field for position
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(pos); // Send actual position to LCD
}

digitalWrite(ledPin2, HIGH); // turn off LED2 (table turning)
Turnservo.detach(); // detach servo to supress stutter
}

Startservo.attach(10); // attaches the servo on pin 10 to the servo object
Serial.println("Table turning"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Start servo turn"); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 1
lcd.print("Pos: "); // Send status message to the LCD.
 


{
for (SSpos = SSMaxPos; SSpos >= SSMinPos; SSpos -= 1) { // goes from maximum servo angle to minimum servo angle in 1 degree steps
Startservo.write(SSpos); // tell servo to go to position in variable 'SSpos'
delay(SSServoSpeed); // waits XXms for the servo to reach the position
Serial.print("Pos = "); // Send status to serial port
Serial.print(pos); // Send position to serial port
Serial.println(" deg."); // Send status to serial port
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(" "); // Clear field for position
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(SSpos); // Send actual position to LCD.
}

Startservo.detach(); // detach servo to supress stutter
}
 

digitalWrite(ledPin3, LOW); // turn on LED3 (pause)
Serial.println("Car leaving turntable"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Car leaving "); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line
lcd.print("turntable "); // Send status message to the LCD.
 

delay(FCOutPause); // wait for FallerCar to leave the turntable
digitalWrite(ledPin3, HIGH); // turn off LED3 (pause)
 

Startservo.attach(10); // attaches the servo on pin 10 to the servo object
Serial.println("Start servo turn"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Start servo turn"); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 1
lcd.print("Pos: "); // Send status message to the LCD.


{
for (SSpos = SSMinPos; SSpos <= SSMaxPos; SSpos += 1) { // goes from minimum servo angle to maximum servo angle in 1 degree steps
Startservo.write(SSpos); // tell servo to go to position in variable 'SSpos'
delay(SSServoSpeed); // waits XX ms for the servo to reach the position
Serial.print("Pos = "); // Send status to serial port
Serial.print(SSpos); // Send position to serial port
Serial.println(" deg."); // Send status to serial port
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(" "); // Clear field for position
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(SSpos); // Send actual position to LCD.
}
Startservo.detach(); // detach servo to supress stutter
 

Turnservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.println("Table turning"); // Send status to serial port
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Table turning "); // Print first line
lcd.setCursor(0, 1); // Goto pos 0 line 1
lcd.print("Pos: "); // Print second line
}

{
digitalWrite(ledPin2, LOW); // turn on LED2 (table turning)
for (pos = MinPos; pos <= MaxPos; pos += 1) { // goes from minimum servo angle to maximum servo angle in 1 degree steps
Turnservo.write(pos); // tell servo to go to position in variable 'pos'
delay(ServoSpeedEmpty); // waits XX ms for the servo to reach the position
Serial.print("Pos = "); // Send status to serial port
Serial.print(pos); // Send position to serial port
Serial.println(" deg."); // Send status to serial port
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(" "); // Clear field for position
lcd.setCursor(9, 1); // Goto pos 6 line 1
lcd.print(pos); // Send actual position to LCD.
}
Turnservo.detach(); // detach servo to supress stutter
digitalWrite(ledPin2, HIGH); // turn off LED2 (table turning)
}

digitalWrite(ledPin1, HIGH); // turn off LED1 (sequence running)
Serial.println("Sequence end"); // Send status to serial port
lcd.clear(); // clear LCD
}

else {
lcd.setCursor(0, 0); // Goto pos 0 line 0
lcd.print("Waiting for next"); // Send status message to the LCD.
lcd.setCursor(0, 1); // Goto pos 0 line 2
lcd.print("car to turn "); // Send status message to the LCD.
}
}
 



Klaus


"Meine" Modellbahn:http://www.modelbaneeuropa.dk
Dänisches Bahnforum: http://www.baneforum.dk
PIKO C4 "Horror Gallery": http://moppe.dk/PIKOC4.html


Wusel hat sich bedankt!
 
moppe
Trans Europ Express (TEE)
Beiträge: 9.191
Registriert am: 07.08.2011
Homepage: Link
Ort: Norddeusche halbinsel
Gleise Roco, PECO, Märklin/Trix, PIKO,
Spurweite H0, H0e, N, Z
Steuerung Z21, Lenz, MpC Gahler+Ringsmeier, Games on Track/Faller
Stromart AC, DC, Digital, Analog


   


  • Ähnliche Themen
    Antworten
    Zugriffe
    Letzter Beitrag
Xobor Einfach ein eigenes Forum erstellen
Datenschutz