Posts

Showing posts from July, 2021

Software_Servo/Motor controller service

Image
I am going to cover both Servo and Motor controller services in this post since they are quite similar internally and have similar functionalities. Starting with the servo controller service, its responsibilities are to find the servo control unit port by sending the "query" command and assessing the response, connect to the servo_ctrl queue, connect to the servo controller through serial, read incoming messages from the servo_ctrl queue and to send them to the controller unit using serial. It also has a separate thread constantly checking to see if the port is still accessible and to stop the service throwing an exception if it is not, and a simple mechanism for stopping the service if a few consecutive commands send to the controller were missed (a simple implementation of the leaky bucket counter pattern). As you can see: servo_controller_service   this part consists of serial command, responsible for sending commands through serial to controller, which has a serial connec...

Software_Architecture

Image
My initial goal is to build a remotely controllable robot able to roam around the house and interact with my pets through voice or video (despite the fact that don't have any for the time being). I want to be able to see the environment through the camera of the robot while controlling it. The next phase would be to change and improve the controlling mechanism, controlling it via voice command, maybe using brain waves to control it and finally using AI and image processing to make it at least partially autonomous . Finally adding other controllable components to the house environment and making them able to interact with each other. Although it might seem like a very high-level description, but I am going to try to extract the actual requirements (architecturally significant requirements) from it. First there is the obvious need for acceptable mobility on a presumably slightly uneven floor, which is more or less addressed by the physical structure of the cub mentioned in the previo...

Electronics_Motor controller (hardware and firmware)

Image
 As mentioned before changing the original brushed DC motor with a gear-box brushed DC motor eliminated the need for controlling the rotation speed. The max speed is low and it does not really make sense to lower it. So to just changing the direction will suffice. More in DC motors I designed a simple part for it to be able to control the motor direction or to turn it off using serial:   Arduino nano   One channel relay control module x2 LM2596S DC-DC 4.5-40V Adjustable Step Down Power Supply Module   DC motor rotation control The functionality is simple. There are two relays that can have 4 states overall: 00 the motor is off 11 the motor is off 10 the direction is x 01 the direction is ~x  The assembled part is like this: The rotation controller Relays Final part   the source for the controller firmware can be found here: serial_motor_rotation_controller  It is a small and highly readable piece of code and does not need much elaboration. It reads ...

Electronics_Servo controller (hardware and firmware)

Image
We need to control multiple servo motors in this project. For example steering system is directly hooked into a servo, or possibly for a camera that we are going to need to rotate, etc. A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.  More on servomotors   The type of servos I am going to use are mostly Futaba s3003 . I have assembled a controller for multiple (up to 15) servos. Using Arduino, I have wrote a small simple program to control them using serial. The devices I have user for this part are: IIC servo controller (which is a replica of Adafruit PCA9685 PWM servo driver) Arduino nano LM2596S DC-DC 4.5-40V Adjustable Step Down Power Supply Module  The circuit is easy t...