PID Tuning and Choosing the right mode

5 years 8 months ago #29533009 by Annem
List of equipment i am using: Super Mega Bot (Inspector bots) - 2 Roboteq HDC2450 Motor controllers, 4 Incremental Encoders(AMT102V CUI INC encoder)(Currently only 1 motor controller is being used and 1 encoder is connected).
The Supermegabot will have a 70kg (155lb) load.

The goal is to be able to move the whole setup at about 5 meters/sec very accurately. I am not sure which particular closed loop mode to be able to achieve highly accurate speed/position of the equipment. What do you suggest?

The remaining part of the setup is on linux so preferably i don't want to have to use windows to change every little thing. The remaining setup will send the command velocity to the controller via ROS. What is the best plan of action to achieve that?

The second thing is the PID tuning. Is it worth doing PID Tuning without the load attached because we are only gonna be running the experiments with the load?
Also, after selecting the mode, while PID tuning according to the manual, what is the parameter that I should optimize? Is it the range(Max-Min) of the Motor RPMs?

With Closed loop speed position mode at P=2.0 as suggested in the manual, the motors oscillated loudly and I had to shut off the whole bot. Why did that occur? And how do i avoid it?

Thank you

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29533012 by blake
You can simply use closed loop speed mode. You will find the configuration and tuning instructions for this mode in our user manual. Our closed loop speed modes use the rotational velocity of the motor shaft in RPM, so you will need to do the math specific to your wheels to calculate the linear velocity relative to the angular velocity in RPM. How accurate the speed control depends specifically on the resolution of your encoders (in PPR).

You should do all of your PID tuning under load. The PID gains may differ when unloaded vs when loaded. In closed loop speed mode begin with PID = 0,1,0 and work from there. The Integral gain will be most important and hold the highest value. If you need to add any Proportional gain it should be only very small increments such as 0.1 or 0.2.

We do have a brand new Linux API. We have not yet published this on our website, if you wish to use it please email me at This email address is being protected from spambots. You need JavaScript enabled to view it. and I will be happy to send it to you.
The following user(s) said Thank You: Annem

Please Log in or Create an account to join the conversation.

5 years 8 months ago - 5 years 8 months ago #29533013 by Annem
Thank you for the super quick response, blake. I have a couple of follow up questions.

1. When it comes to pid tuning, i have been checking the range of error for different target command velocity and try to minimize it. Is this a good game plan or should i do something else?

2. Would it be ideal to also connect the other controller and the remaining 3 encoders and put the load on and then do pid tuning? If so, i would need to run the controllers in RoboCAN mode(right?). Would i be able to look at the errors of all the 4 loops and then try to PID Tune it? If so, if i finally run it would i need to use roborun(windows) to set it up every time i wanna run it in closed loop?

3. What are all the capabilities of the Linux api? I am gonna dig deep into it but just want to have an idea of what all i can do with it.

4. I realized that there are many different CAN modes. What would be the best mode for my setup which is 2 motor controllers(HDC 2450) connected to a linux laptop which is getting velocity commands via ROS?

5. I see that a microcomputer can be connected to one of the controllers in ROBOCAN mode but a CAN-USB adapter needs to be used to add a laptop to the network. If I am not using a microcomputer can i just add the laptop to the network via USB?

6. The PPR on my encoders are 2048 and they are able to run upto 7500 rpm. But in closed loop mode i was only able to bump up the command rps to 1000 and also that is only the shaft rpm and the wheel's rpm is about 60. How can i increase the rpm to a much higher value?

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29533016 by blake
1. Yes this is the best approach

2. Theoretically, if all four motors/encoders are the same model then all four should have the same PID gains. So first tune the gains on a single motor and then apply the same gains to all four and test, then fine tune if needed.

3. API Documentation is attached

4 & 5. You can simply use RoboCAN in Master/Slave Configuration. One controller would be the master controller, the second would be the slave. The master controller would be connected to your pc via RS232 or USB and then you will be able to send serial commands to both controllers from your Linux environment on your PC. A CAN Adapter is not needed, simple usb or serial connection to your pc from the master controller is adequate. You can see a practical example of this type of setup here: dev.roboteq.com/dev1/index.php/support/s...tfaq/401-robocan-faq

6. You can configure the max RPM of each motor channel from the Configuration tab of Roborun+. By default it is set to 1000RPM, you can increase this to as high as 65535RPM. If unclear please contact me via email, it will be easier for me to include screenshots that way.

File Attachment:

File Name: RoboteqAPIDoc.zip
File Size:826 KB
Attachments:
The following user(s) said Thank You: Annem

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29533018 by Annem
Thank you for the quick response.

I will do all those and let you know if i run into any issues.

Please Log in or Create an account to join the conversation.

5 years 8 months ago - 5 years 8 months ago #29533022 by Annem
Edit: I realized the effects of PID are not that apparent.
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.105 seconds