PID control on CORE2-ROS

Hello, I am creating a skid-steering drive robot (4WD) and I will be using the CORE2-ROS controller. I would like the have an automatic feedback system which would keep track of the speed of the wheels. I would like to have a proportional, derivative, and integral controller (PID) and create it in Matlab/Simulink.

My question is, how does the the PID controller run on the CORE2-ROS?

I’m doing similar. Look at the code for their self-balancing robot on Github. Is uses PID control. However, you won’t be able to create in Simulink and run on the device. I’m working with the Mathworks folks on a very similar project. You can certainly model and simulate in Simulink, but there is no real time support for Husarion. I doubt there ever will, the market is simply too small. Arduino and Raspberry Pi, yes. GitHub - husarion/self-balancing-telepresence-robot: Embedded firmware and web user interface for self balancing telepresence robot

Did you create a PID control for your 4WD, and if so can I see it? Also, if I model and simulate it in Simulink how would I be able to use those values with the CORE2-ROS.
I will be using this Arduino motor driver module (Large Current Motor Driver Module BTS7960 - 43A [BTS7960-Modules] - US $12.00 : HAOYU Electronics : Make Engineers Job Easier) due to the voltage of my motors. How should I integrate the two systems together?

I’m not building a 4WD, I’m building a robotic rocket that uses PID control. Look for my post here on the forum. I already posted the link to the code that I am using, I’m using the telepresence robot code. Did you review it? The PID tuning parameters are in the code, you could use the same values as generated from PID tunining in Simulink. And you want to stack an Arduino on top of the Husarion module? Have you even got that working? I suppose you could feed the PWM output of the Husarion into the Arduino PWM input and reverse engineer the signal. You’ll need a USB oscilloscope to get it done easily. I’ve done this exact process previously. Why not just use the servo module from Husarion?

You don’t need the additional Arduino board, you only need two resistors to adapt the signal from H-bridge to the driver based on BTN7970 ICs:

It could be done better, but this simple circuit should work fine.

Agreed, no Arduino needed! Apologies, I was talking about PWM control, and you are asking about motor voltages, my bad. Such a circuit should work though. And here is the PID control in the self-balancing robot self-balancing-telepresence-robot/RobotController.cpp at master · husarion/self-balancing-telepresence-robot · GitHub and mentioned here Fresh look at self-balancing robot algorithm | by Dominik Nowak | Husarion Blog | Medium

Hello n_jak,

Regarding the 4WD skid-steering drive, we already have it implemented in ROSbot.
I understand that your platform may have different dimensions and speed, but our code is configurable.
You can find it in ROSbot class in hFramework repository. The PID controllers are internally used in a Wheel class.

You may also be interested in ROS tutorial 3 - simple kinematics - you can find there explained mathematical model for skid-steering robot.


Thank you all for your replies, they are really helpful!