1 Introduction

The mobile robots are preferred to human beings to tackle some dangerous environment situations in nature such as military purpose, mines detection, space exploration and transport in unstructured environment. Legged mobile robots as compared to wheeled robot have greater flexibilities in terms of agility on rough and irregular terrains. Most of the two-legged robots are based on serial kinematic structure with six degrees-of-freedom (DOF) [1,2,3,4,5]. There are some other walking machines with linkage mechanisms [6, 7]. The SpaceClimber-1 six-legged bio-inspired and energy-efficient robot was developed for surface exploration in space [8]. Nowadays, many quadruped walking robots have been developed. MIT Cheetah Robot was developed by bio-mimetic robotics laboratory at Massachusetts Institute of Technology [9]. CHEETAH [10] and WildCat [11] were developed by Boston Dynamics Lab. These robots can replicate the driving characteristics of a quadruped animal. The crab-like structure of hexapod robot has been developed for walking on natural terrain containing uneven surfaces [12]. Many researchers worked a lot on the walking mechanism of the quadruped robot by using different link mechanisms. The Theo Jansen mechanism for walking consists of a number of links with internal elliptical gaits [13]. A number of researchers have studied several characteristics of the Jansen mechanism. The additional up-down motion has introduced in the extension of the Jansen mechanism for generating new gait cycles for avoiding obstacles [14]. The forward kinematics of the Jansen mechanism has been analyzed by using the combination of the vector loop and geometric method with CAD software [15]. The process of optimization of the leg geometry of Jansen mechanism using (GA) genetic algorithm is proposed [16]. The work shows the stability limits while authenticating the kinematic models with hardware prototype. The neural network-based machine learning algorithm was proposed by [17] for the autonomous walking robot. For exact neural network classification, the pressure sensor data is used. The factors such as mean square error, error gradient and learning time, etc, have best results due to 25–30 numbers of hidden neurons. Further, the proposed results will be incorporated into a next-generation FPGA-based artificial intelligence chip development for biped robot movement control. The compliant leg-based design of a four-legged robot has been proposed in [18]. The rack-mounted mass acts as a controller for controlling the motion of the robot during walking. The effectiveness of the proposed controller is validated through experimental work. The turning and obstacle avoidance application are not considered in the work. The single artificial muscle wire concept has been used to build the hexapod type robot with each leg control [19]. Neural network IC has been used to control the mechanical structure of the robot. The results show the stable walking at 27 mm/min.

One of the key tasks for mobile robots is the detection and obstacles avoidance during the navigation task. For the solution of the above challenge, researchers introduced many algorithms and methods. To perform local and global navigation, path planning and steering control of a fuzzy logic (FL)-based mobile robot are used in [20]. For optimization of the fuzzy logic controller for path planning of mobile robot, Taguchi method is used in [21]. Two fuzzy logic controllers are implemented to track the path of the intelligent vehicle with the control direction [22]. The preference-based fuzzy logic system has been implemented for navigating the mobile robot in [23]. This method allows the robot to navigate through cluttered situations. To reduce the large numbers of fuzzy rules, a simple and effective control scheme is used into the controller, and this scheme consists of multiple reactive behaviors using fuzzy logic [24]. The vision-based fuzzy logic controller to avoid the obstacle for a humanoid robot is proposed in [25]. The vision system is used to capture the nearest object, and electronic compass is used to measured robot heading angle; these are inputs to the fuzzy logic controller to optimize the appropriate motion of the robot in unknown situations. The combination of FL and ANN (Artificial neural network) is used to navigate the autonomous mobile robot and learn the surrounding environment and reach the desired goal [26].

The SimMechanics MATLAB toolbox is a graphical representation of system dynamics that are used for development of the robotic arm [27]. It is difficult to model the complex robotic arm; therefore, it is directly imported from CAD software to the Simulink model. The CAD model of three Mecanum wheels-based mobile robot is developed and simulated in the MATLAB environment [28]. The SolidWorks and MATLAB/SimMechanics based modeling of multi-spindle drilling SCARA robot is developed [29].

As literature stated above regarding quadruped robot modeling, obstacle avoidance and simulation tools, the work proposed in this research article is a physical modeling of the quadruped robot based on Jansen mechanism using SolidWorks and MATLAB/SimMechanics toolbox. This type of work is not reported in the literature as per our knowledge. Each leg of the quadruped robot is controlled by separated DC motor. Also, the prototype model of the quadruped robot-based on Jansen mechanism is developed. The proposed quadruped robot is used for obstacle avoidance. The Fuzzy logic-based controller is proposed to avoid the obstacle in a closed environment (arena). The simulation results of the path traced by the robot are validated with experimentation work.

The paper is organized as follows: In Sect. 2, the physical modeling of the quadruped robot based on Jansen mechanism is presented using Simulink Simscape Toolbox. In Sect. 3, the prototype model of a complete quadruped robot with a specification table is presented. The proposed model of the robot is validated for the obstacle avoidance application in Sect. 4. Also, the fuzzy logic controller is developed for the quadruped robot. Finally, concluding comments are presented in Sect. 5.

2 Physical Modeling of Quadruped Robot

2.1 Modeling of Jansen Linkage

The diagram of the Jansen linkage is shown in Fig. 1. Input torque is given to the link 1 that acts as driving link. A pair of two links is connected using the revolute joint. All the links are connected as shown in the CAD model of Fig. 1. The whole mechanism is connected to the fixed frame that acts as chassis of the robot.

Fig. 1
figure 1

CAD model of Jansen linkage

The analytical model of the Jansen linkage based on the circle intersection method [16] is described in this section. The schematic representation of the Jansen linkage is shown in Fig. 2a. The trajectory of the node 8, \( \left( {x_{8} ,y_{8} } \right) \), is derived as a function of the crank angle of \( {\theta} \). The lengths of links are represented by vector \( \mathbf{L} = \left[ {L_{0} , \, L_{1} , \, L_{2} , \, L_{3} , \, L_{4} , \, L_{5} , \, L_{6} , \, L_{7} , \, L_{8} , \, L_{9} , \, L_{10} , \, L_{11} } \right] \) where \( L_{1} \) represents the distance between the \( \left( {x_{0} ,y_{0} } \right) \) and \( \left( {x_{1} ,y_{1} } \right) \). The crank radius \( r \) is taken as constant and rotates about the center point \( \left( {x_{0} ,y_{0} } \right) \). The angle between L0 and the horizontal line is represented by \( \gamma \). In this case, the value of the \( \gamma = 0 \), i.e., the coordinates \( \left( {x_{0} ,y_{0} } \right) \) and \( \left( {x_{10} ,y_{10} } \right) \) are in-line with the x-axis. The coordinates of node 10 that is pivoted on chassis are given by:

$$ x_{10} = x_{0} + L_{0} \sin \gamma $$
(1)
$$ y_{10} = y_{0} + L_{0} \cos \gamma $$
(2)
Fig. 2
figure 2

Path traced by various joints of Jansen mechanism a schematic diagram, b CAD model and c prototype model

The positions of the various nodes of the linkage can be represented as vector of points and are given by

$$ \varvec{N}_{\varvec{0}} = \left[ {\left( {x_{1} ,y_{1} } \right),\left( {x_{2} ,y_{2} } \right),\left( {x_{3} ,y_{3} } \right),\left( {x_{4} ,y_{4} } \right),\left( {x_{5} ,y_{5} } \right),\left( {x_{8} ,y_{8} } \right)} \right] $$
(3)

Considering Node 1, the kinematic equations are

$$ x_{1} = x_{0} + r \, \sin\varvec{\theta} $$
(4)
$$ y_{1} = y_{0} + r \, \cos\varvec{\theta} $$
(5)

The position of Node 2 is determined by the intersection of the arcs made by link 1 around \( \left( {x_{0} ,y_{0} } \right) \) and the arc of link 10 around point \( \left( {x_{10} ,y_{10} } \right) \). These are all known quantities, so position of node 2 is computed as:

$$ \left( {x_{2} - x_{1} } \right)^{2} + \left( {y_{2} - y_{1} } \right)^{2} = \mathop L\nolimits_{2}^{2} $$
(6)
$$ \left( {x_{2} - x_{10} } \right)^{2} + \left( {y_{2} - y_{10} } \right)^{2} = \, \mathop L\nolimits_{10}^{2} $$
(7)

Simplifying Eqs. (6) and (7) in terms of \( x_{2} \), we get:

$$ x_{2} = x_{1} \pm \sqrt {\left( {L_{2} } \right)^{2} - \left( {y_{2} - y_{1} } \right)^{2} } $$
(8)
$$ x_{2} = x_{10} \pm \sqrt {\left( {L_{10} } \right)^{2} - \left( {y_{2} - y_{10} } \right)^{2} } $$
(9)

The trajectory of any nodes can be determined in the reference frame using circle intersecting methods [16]. The coordinates of the center of two circles are given as \( \left( {x_{01} ,y_{01} } \right) \), \( \left( {x_{02} ,y_{02} } \right) \) and radii are \( r_{1} \) and \( r_{2} \). The coordinates of the points of intersection of the two circles can be calculated as follows:

$$ x_{{p_{1} }} = x_{01} + r_{1} \cos \left( {\theta + \alpha } \right) $$
(10)
$$ y_{{p_{1} }} = y_{01} + r_{1} \sin \left( {\theta + \alpha } \right) $$
(11)
$$ x_{{p_{2} }} = x_{01} + r_{1} \cos \left( {\theta - \alpha } \right) $$
(12)
$$ y_{{p_{2} }} = y_{01} + r_{1} \cos \left( {\theta - \alpha } \right) $$
(13)
$$ \theta = \tan^{ - 1} \left( {\frac{{y_{02} - y_{01} }}{{x_{02} - x_{01} }}} \right) $$
(14)
$$ D = \sqrt {\left( {x_{02} - x_{01} } \right)^{2} + \left( {y_{02} - y_{01} } \right)^{2} } $$
(15)

where \( \left( {x_{p1} ,y_{p1} } \right) \) and \( \left( {x_{p2} ,y_{p2} } \right) \) are the intersection points and \( D \) is the distance between two circle center points. Figure 2a shows the trajectory followed by all nodes when crank rotates.

The input motion is given to the link 1, and the path traced by the various joints is shown in Fig. 2. Figure 2b shows the motion analysis of the CAD model, while link 1 is rotating. The CAD software is used to develop the Jansen linkage mechanism and motion analysis of the model. Figure 2c shows the prototype model of the Jansen linkage and path traced by the various joints. The path traced by the prototype model is quite in a similar fashion as path traced by CAD model. Also, same Jansen mechanism is used to building the other legs of the robot (Table 1).

Table 1 Link lengths used in Jansen mechanism

Figure 3 shows the CAD model of the quadruped robot based on the Jansen mechanism. The CAD model is developed in SolidWorks software.

Fig. 3
figure 3

CAD model of the quadruped robot

2.2 Simulink Model of the Quadruped Robot

In this section, the Simulink model of the quadruped robot based on Jansen mechanism is developed. In Simulink, the Physical modeling approach is used [27,28,29]. Physical models are three-dimensional representations of reality. Two types of physical models exist: mock-ups and virtual prototypes. The first type of physical model is designed to show how a product or a structure will look. The second type of physical model is a virtual prototype. A virtual prototype is a working model of a system, assembly or a product. In this work, the second type of physical model is made using Simscape toolbox. Simscape™ enables anyone to rapidly create models of physical systems within the Simulink® environment. With Simscape, one builds physical component models based on physical connections that directly integrate with block diagrams and other modeling paradigms. The CAD model is imported to the SimMechanics Matlab/Simulink toolbox. First of all, the Simulink model of the single leg is developed. Figure 4 shows the detailed Simulink model of the single leg system. The solver configuration, world frame and mechanism configuration blocks are used to build the robot model under Simscape environment. The solver configuration block specifies the solver parameters that your model needs before you can begin the simulation. Each topologically distinct Simscape block diagram requires exactly one solver configuration block to be connected to it. The global reference frame in a model is presented by solver block. This frame is the inertial frame. Frame axes are arranged according to the right-hand rule. This block provides mechanical and simulation parameters to a mechanism, i.e., a self-contained group of interconnected Simscape™ Multibody™ blocks. Parameters include gravity and a linearization delta for computing numerical partial derivatives during linearization. These parameters apply only to the target mechanism, i.e., the mechanism that the block connects to. In this model, the parameters for the mechanism configuration are [0, 0, − 0.98] m/s2. The signal builder acts as input to the mechanism. The output of the signal builder is the input to the revolute joint of link 1 which is further connected to the links 2 and 3. The link 1 acts as crank that actuates the Jansen mechanism. The link 1 is grounded with chassis of the robot body. Revolute 2 joint is attached to the link 4 which is triangular in shape. One end of the link 3 is attached to revolute joint 1 and other to revolute joint 5. The link 7 is attached to the joints 5 and 6. The link 5 and link 6 are always parallel to each other in the mechanism. The link 8 is attached to the link 7 and is connected to the ground surface. The link 8 is a roller element and moves on the ground surface. The Simulink model is imported from CAD model of the single leg.

Fig. 4
figure 4

Simulink model of the single leg

The full model of quadruped robot is presented in Fig. 5. The schematic arrangement of the legs with the robot body is shown in Fig. 5a. The forward motion of the robot is in X direction and lateral movement in Z direction. The comprehensive Simulink model of the quadruped robot is presented in Fig. 5b. The ground surface is connected to the solver configuration, world frame, and mechanism configuration blocks. The 6-DOF block is connected to the robot model that allows the robot to move in three directions (X, Y and Z) and to rotate about axis X, Y and Z. The single leg mechanism is connected to the robot body frame and is shown in Fig. 5b. The sphere to plane force contact library block is used to develop the friction model for ground surface.

Fig. 5
figure 5

a Schematic diagram of complete robot, bSimulink model

2.2.1 Foot Ground Contact Model

The model of the contact with the ground is a vital part of the robot’s simulation model. When the robot’s leg end point touches the walking surface, it develops some force. According to Newton’s third law, ground exerts a force on the foot of equal intensity and opposite direction. The effort of the body on a ground is attained due to this action–reaction couple. The Simscape Multibody Contact Forces Library block “Sphere to Plane Contact Force (3D)” is used to develop the foot–ground contact model of the robot. Figure 6 shows the details of the block. This block implements a contact force between a sphere and a plane. The foot of the robot acts as sphere, and road surface is considered as a plane. The link 8 acts as sphere and ground surface acts as plane. The force is active above and below the plane. The values of contact stiffness and damping are adjusted so that robot moves smoothly on the surface. The stick–slip continuous friction law is used in the sphere to plane block. The plane length parameter value of block depends upon the dimension of the ground surface.

Fig. 6
figure 6

Foot–ground contact force model (sphere to plane force block)

3 Prototype Model of Quadruped Robot

In this section, the prototype model of the quadruped robot is developed. Figure 7 shows the prototype model of the quadruped robot. The aluminum material is used to construct the legs of the robot. The square section channel is used to build the chassis of the robot. The four-geared DC Johnson motor (60 rpm) is used to drive the leg mechanism. The Arduino mega controller is used to control the motion of the robot. The motor driver L298 is used to control the motors. Three ultrasonic HC-SR04 sensors are mounted on the front part of the robot and are used to detect the obstacles and for mapping the surroundings. 12 V and 3 A power supply is used to drive the motors. The laptop is connected to the controller via USB cables.

Fig. 7
figure 7

Prototype model of the quadruped robot a top view, b front view

4 Obstacle Avoidance Control

The proposed model of the quadruped robot is used for the application of the obstacle avoidance. The fuzzy logic controller for obstacle detection and avoidance of obstacles is proposed in this section.

4.1 Block Diagram

The block diagram of the fuzzy-based obstacle avoidance system is shown in Fig. 8. The input to the controller is the distance from target and obstacles. The controller on the basis of the rules decides the angular motion of each motor shaft. The target (x, y) position is known to the system which is pre-defined. The fuzzy memberships are discussed in Sect. 4.2.

Fig. 8
figure 8

Block diagram of navigation and obstacle avoidance system

4.2 Fuzzy Membership Functions

Two inputs (Fig. 9a, b) and one output (Fig. 9c) membership functions are developed for the fuzzy controller. The input membership functions are a distance of robot from target and distance of robot from obstacles. As such, overlapping denotes uncertainty in participation of members of the set to a particular set. If they do not overlap, the members do not carry any uncertainty. When the membership functions of a fuzzy controller have overlap, a smooth and continuous (i.e., no sudden change) control signal near the boundaries of the membership functions can be obtained. The smooth change of the input signals is analogous to the gradual change of seasons, i.e., springs comes slowly after the winter, and there, is a mixing period of two seasons similar to the overlapping of two fuzzy membership functions to avoid jerky system responses. In this context, overlapping fuzzy membership functions, i.e., distance from target and distance from obstacle are considered. There are overlapping membership functions of the obstacle distance for membership functions between Near and Medium, Far and Medium (Fig. 9b). As well as, overlapping membership functions of the robot’s distance from the target for membership functions between Small and Medium, Large and Medium are considered (Fig. 9a). The ultrasonic sensors are used to compute the distance of the robot from the obstacles. The output function is the angular velocity of the motor. Figure 9 shows the input and output membership functions. The set of 22 rules are developed to control the performance of the controller. The rules are mentioned in Table 2.

Fig. 9
figure 9

Fuzzy membership functions a distance from target, b distance from obstacle and c output membership function

Table 2 Fuzzy rules for obstacle avoidance

4.3 Obstacle Avoidance in Closed boundary environment

The closed boundary environment is considered for validation of proposed fuzzy-based obstacle avoidance controller for quadruped robot. Figure 10 shows the setup for obstacle avoidance application. Figure 10a shows the simulation environment model of the closed boundary in SimMechanics Matlab/Simulink software and robot. Figure 10b shows the prototype setup for the experimentation work. In this scenario, the robot has to enter into a closed boundary and has to reach the target without colliding with the walls of the boundary. The fuzzy-based controller is used for avoiding walls of the boundary by the robot.

Fig. 10
figure 10

Setup for obstacle avoidance application

Figure 11a–c shows the results of the robot displacement in X, Y, and Z directions. From Fig. 11a, it is clear that robot travels the distance of 2.7 m approximately in the negative X direction. This means that robot travel in a forward direction. The vertical movement of the robot body is shown in Fig. 11b. As depicted in Fig. 11b, the vertical movement of the robot is quite less up to simulation time of 30 s. During turning the robot body, vertical movement is unstable due to change in velocity of the robot legs. The lateral movement of the robot is shown in Fig. 11c.

Fig. 11
figure 11

a Displacement in X direction, b displacement in Y direction, c displacement in Z direction, d path travelled by the robot in closed boundary in simulation and experimentation work

Figure 11d shows the comparisons of the simulation and experimental result of the path traced by the robot during obstacle avoidance in a closed boundary environment. Figure 12 shows the results such as velocity and angles (yaw, pitch and roll) of the robot body. As depicted in Fig. 12a–c, the trend of the velocities plots along directions X, Y and Z is changed after 5 s of the simulation run. This states that the robot starts to take a turn inside the closed boundary. From Fig. 12e, it is depicted that the robot varies the angle (yaw) from − 0.3 to 0.3 rad during whole obstacle avoidance process. The probable range of the pitch and roll angle is varying from − 0.06 to 0.06, and this is quite acceptable for smooth walking motion of the quadruped robot. Figure 13 shows few snaps of experimental results of quadruped robot walking in the closed boundary environment. The simulation parameters are mentioned in Table 3.

Fig. 12
figure 12

Simulation results of quadruped robot during obstacle avoidance a velocity in X direction, b velocity in Y direction, c velocity in Z direction, d pitch angle, e yaw angle, f roll angle

Fig. 13
figure 13

Snapshots of experimental results

Table 3 Simulation parameters

5 Conclusions

The modeling of quadruped robot based on Jansen walking mechanism was proposed in this paper. The CAD model of the quadruped robot is developed and is imported into SimMechanics Matlab/Simulink model. The path traced by the joints of the Jansen mechanism-based leg model is validated with the prototype model of robot leg. The prototype model of the complete Jansen system-based quadruped robot is fabricated. Further, the proposed model of the quadruped robot was used for the obstacle avoidance application. The fuzzy logic controller was developed for the robot to avoid the obstacles (preferable static in nature). The proposed controller was implemented on the prototype model. The closed boundary environment was considered for validation of the obstacle avoidance controller. The path traveled by the robot in the simulation was compared with experimentation work, and this was quite satisfactory. The future scope of the work includes the dynamic obstacle avoidance along with trajectory tracking for the Jansen mechanism-based quadruped robot model.