Documentation > Instruction Manuals
Starter Controller - 2.01.004
Introduction
The Starter Controller (2.01.004) is an USB controller that has 2 servo motor ports (track switch motors, decoupler, boom barrier motors, etc.), one light port (traffic light or level crossing light) and one train detection sensors port. It allows to connect and control motors, lights and sensors with your computer.
Installation
Configuring the Controller
From firmware version 2019.01.1 onward, the starter controller has two communication protocols: a binary one and ASCII one. Older versions of the controller only have the binary communication protocol. The binary one is used by nControl™ to communicate with the controller. The ASCII protocol is fully documented and can be used to integrate the quad sensor controller into a your own custom software application.
This section is only useful if you want to integrate the controller in your own software. It's not relvant in case you're using the controller with nControl™
The information on this page is intended for personal, non-commercial, use only. Commercial use without prior written approval by 4DBrix LLC is prohibited.
Connecting to the Controller
You can communicate with the starter controller over a serial connection. The default baud rate is 38400. Keep in mind that the controllers start up using the digital communication protocol, so you need to switch them to the ASCII protocol before you can use the commands listed in this manual.
To connect to your controller, make a serial connection using 38400 baud and then send the command:
mod,asc;
to switch the controller to the ASCII protocol. Once that's done, you're ready to start using the controller.
ASCII Commands
Auxiliary Device Commands
cmd,port,data;
Send serial data to an auxiliary device. This command can only be used if the port has been configured as a serial out port.
  • port specifies the port of the controller.
  • port specifies the data string that has to be sent to the auxiliary device.

Controller Info
get,serial;
Request the serial number of the controller.
get,type;
Request the type of the controller.
get,version;
Request the firmware version of the controller.

LED Commands
led,port,led,on;
Switch an LED on.
  • port specifies the port of the controller.
  • led specifies the LED that as to be controlled. [1, 2]
led,port,led,off;
Switch an LED off.
  • port specifies the port of the controller.
  • led specifies the LED that as to be controlled. [1, 2]
led,port,led,power;
Set the brightness of an LED.
  • port specifies the port of the controller.
  • led specifies the LED that as to be controlled. [1, 2]
  • power specifies the power of the LED. [0.. 255]

Communication Mode
mod,asc;
Switch the controller to the ASCII communication protocol.
mod,bin;
Switch the controller to the binary communication protocol.

Port Configuration
prt,port,serwri,baud;
Configure the specified port as a serial out port. This mode allows to send serial data over the third pin of the port.
  • port specifies the port of the controller.
  • baud specifies the baud rate for the serial communication.
prt,port,sen;
Configure the specified port as a sensor port. This is the default, this command only has to be executed to return to sensor port mode after the port had been configured as a serial out port.
  • port specifies the port of the controller.
prt,port,srv;
Configure the specified port as a servo port. This is the default, this command only has to be executed to return to servo port mode after the port had been configured as a serial out port.
  • port specifies the port of the controller.

Sensor Commands
sen,port,off;
Switch sensor feedback off. The controller will no longer return any feedback from the specified sensor port.
  • port specifies the port of the controller.
sen,port,cont,interval;
Request continuous sensor feedback.
  • port specifies the port of the controller.
  • interval specifies the interval between two consecutive data samples, expressed in milliseconds.
sen,port,above,interval,threshold;
Request continuous sensor feedback only if the value is above the specified threshold value.
  • port specifies the port of the controller.
  • interval specifies the interval between two consecutive data samples, expressed in milliseconds.
  • threshold specifies the value above which sensor feedback has to be provided. [0 - 1023]
sen,port,cross,threshold;
Request sensor feedback only if the value crosses, goes above or below, the specified threshold value.
  • port specifies the port of the controller.
  • threshold specifies the threshold value. [0 - 1023]

Servo Motor Commands
srv,port,off;
Switch the servo motor off. It's advisable to switch the motors off once they are in position. Keeping the motors on for an extended amount of time can overheat and ultimately damage them.
  • port specifies the port of the controller.
srv,port,on;
Switch the servo motor on. When the motor is switched on it will move to the last requested angle, in case the motor is not already in that position. When the controller is powered up the default angle is set to 90 degrees. If that doesn't work for you application, you have to change the angle before switched the motor on.
  • port specifies the port of the controller.
srv,port,angle;
Set the angle of the servo motor.
  • port specifies the port of the controller.
  • angle specifies the angle in degrees: 0-180.
srv,port,get;
Request the current servo angle from the controller. This will only work after the angle has been set, it does not retain the angle when the controller is powered down.
  • port specifies the port of the controller.

Controller Settings
set,baud,rate;
Change the baud rate of the serial communication. The new baud rate is stored in the EEPROM of the controller and will be used next time the controller boots.
  • rate specifies baud rate.
Example
Motor
Use the following procedure to switch a servo motor on port 1 to 45 degrees:
  • Make a serial connection to the controller using 38400 baud.
  • Send the command mod,asc; to switch the controller to ASCII mode
  • Send the command srv,1,on to switch the motor on
  • Send the command srv,1,45 to move the motor to the 45 degree position
  • Wait to give the motor time to move to the requested position, e.g. wait 300ms
  • Send the command srv,1,off to switch the motor off
Light
Use the following procedure to set the brightness of the LED:
  • Make a serial connection to the controller using 38400 baud.
  • Send the command mod,asc; to switch the controller to ASCII mode
  • Send the command led,3,1,128 to define the brightness of the LED
  • Send the command led,3,1,on to switch the LED on
Sensor
Use the following procedure to get a sensor value from port 1 every 100 milliseconds:
  • Make a serial connection to the controller using 38400 baud.
  • Send the command mod,asc; to switch the controller to ASCII mode.
  • Send the command sen,1,cont,100 to get sensor feedback.
You should now get a message with the port number and sensor value, every 100 milliseconds.
Versions
2017.03.1
  • Support for nControl™ (digital communication protocol)
2018.08.1
  • Added support for ASCII communication protocol
  • Added support for auxiliary serial devices
2019.01.1
  • Improvement of the ASCII command sen,4,cross