Ziro Logo

Home

Modules UDP Scripts Unity

Examples

Mobile: IMU Cloud: Alexa Arduino: PIXY Arduino: Sensors

Motor Modules

Each Ziro kit has a 3-digit KitID that is used as a identity marker. The modules form a Wifi network with a parent module on the top of the tree. The Modules belonging to the KitID publish an SSID which is of the format "Modules-xxx-0y", where 'xxx' is the Kit ID and 'y' is the module number in the tree. The parent module, denoted by 'Module-xxx-00', broadcasts the incoming message packet to all the children modules in the network to control them.

As developers, any application developed for Ziro motor modules needs to only interface with this parent module: Module-xxx-000. This parent module will broadcast the message to the subsequent motor module. As shown in the image below from the network setting page of a mobile phone, 4 Modules of KitID 163 are available for connection.

Password: zirokits 

Each Motor module in the kit is associated with a color. The chronological order of the colors are VIBGYO - Violet, Indigo, Blue, Green, Yellow and Orange.

The modules in the kit understand messages in the packet format of JSON strings of pTypes. The pTypes are sent to the motor modules using UDP WiFi Protocol. Please refer to the UDP section for more information. The pType for the kit follows the same chronological order with respect to the VIBGYO. A typical pType message has the following structure:

 {pType:7,m_T:[20,30,60,70,40,80],m_M:[1,2,0,0,0,0]};  

The pType consists of three elements - the pType number, motor modes and the motor targets. m_T: represents the target value for the motor. This value in angular mode can be the angle it needs to got to or in wheel mode the value of the rpm. m_M: The mode of motor module that needs to operate in. The mode are as follows -

   Motor Modes
   m_M : 0 - Coast Mode
   m_M : 1 - Continous clockwise rotation
   m_M : 2 - Continous anti-clockwise rotation
   m_M : 3 - Angular 90 clockwise motion
   m_M : 4 - Angular 90 anti-clockwise motion
   m_M : 5 - Angular 180 clockwise motion
   m_M : 6 - Angular 180 anti-clockwise motion
  

The m_T: values can range from -160 to +160 for angle mode and -100 to +100 for the rpm mode. This is directly correlated to the fact that motor modules can go from angles -160 to +160 . Whereas the rpm is a % representation. So 100 would mean full throttle or 50 would mean 50% throttle.

The above image represents the range of motion for the modules. In the angle mode, with the hinge attached we recommend the motion of the module to be +90 to -90 where the center position of the module is the 0. Similarly the wheel mode has two modes - clockwise (represented in blue) and anti-clockwise (represented in green).