I am currently using a 6WD Wild Thumper chassis as an autonomous mapping robot (in progress). I am really struggeling with the PID controller as I often get a humming noise instead of motor turn at low PWM values.
Is there a way I could possible get smooth speeds with low PWM values. Possibly by pulsing the PWM as suggested by @OddBot in another forum. I am not experience with microcontrollers but I really need help with this (instructions on how to pulse with another PWM). Even if the speed is not completely smooth it is better than what I am currently getting. Also I have to work with what I currently have.
I am using a T'Rex controller, I am using the H-bridges on the controller to drive the motors. I have bought 34:1 motors with built in encoders. I am powering the controller with a 7.4V Li-po Battery 2200mAh. I am reading the encoders with another controller (arduino Leonardo) to enable the use of quadrature encoders.
Please let me know if there is any other information required.
Most motors have problems Most motors have problems with low PWM values. Because of friction and other losses in the system, the motor just won’t run or won’t run right under a certain voltage. PWM effectively changes the voltage for the motor.
Why can’t the TRex handle the encoders? You can read it at 2x by just using A channel interrupts.
If you really need another processor to read the interrupts, I would look at the Teensy 3.1 or the Teensy-LC, or a mini-Maple clone from ebay because of the price. All of these have a small form factor that fits on a breadboard and uses ARM chips which have better interrupt handling than most Arduinos.
Also if you’d link to OddBot’s post in the other forum we could read and make more pertinent suggestions.
Here is @OddBots post: “A technique I developed for low speeds was to have a second PWM at an even lower frequency. For example, lets say that PWM values less than 45 will not move the chassis (on a flat surface with no obstacles). Then what you do is choose a level above that as your change over point. In this case we will use a PWM value of 100 to allow for a slight slope or mildly rough terrain.
When your PWM values are 100 or more then drive the motors normally as you do now.
When your PWM value falls below 100 then toggle your motor PWM between that value and 100 at a relatively low frequency of say 50Hz. Perhaps the simplest way to do this to toggle a value in you main loop. When that value is true set the motor PWM to 100, when it is false set it to the lower value. If your main loop runs very quickly then you may want to use a timer to determine a roughly 50Hz toggle frequency.
The end result is that below a certain speed you start pulsing the motors to prevent them stalling. You will need to experiment with the upper pulse level (100 in my example) and the toggle frequency as a lot will depend on the weight of your robot and the terrain.
It was the only way I could control the chassis at very low speeds to pick up the servo and shot glass. If you listen carefully you can hear the low frequency pulsing of the motor. Gareth has also used this tequnique with a Mr. Tidy for low speed maneuvering without stalling.”
The encoders work fine on the arduino so I dont really have an issue with that. Just maybe a suggestion about how I would implement the technique stated above, that would help greatly,
Ok I understand the alternative of PWM values. I think my problem does lie with the PID parameters, Ive played around with the values as much as I can but cant seem to get decent results.
My encoder resolution is 16 transitions per revolution.
Im am using Robot operating system (ROS) for the system, which includes the PID controller. The way I have set it up is the encoders are read through the leonardo and published. the PID controller then subscribes to the encoder cound and publishes the analog PWM value which is sent to the T’Rex to drive the motors.
Why wouldnt the alternating PWM value work with encoders, wont it just pulse the power to get the motors going, but I suppose it will disturb the PID controller.
I suppose I will just have to find the righ PID parameters:/
16 transitions on the motor revolution. The encoders are on the center two motors. So the motor command is sent to the three left wheels and the three right wheels.
I think I just need to tune the PID algorithm, the commands go straight to the T’Rex from the PID algorithm, so there might be some delay but not too long it seems to react fast enough to the motor command, but the motor command sent to the T’Rex doesnt increase fast enough when the motors are humming. Hopefully I can tune the integral term to react faster.
The gear ratio on the motors with encoders are also 34:1 I made sure of that. I kind of got it working with PID tuning as well as the motor speeds that are converted to analog signals are just at a higher minimum. For example it used to send a linear velocity of 0.3m/s but it now sends atleast above 0.5m/s.
Thanks for the help.
You guys should get into working with ROS, its really a pain in the beginning but is definitely worthwhile in the end.
I am working on a similar project, and would like to discuss some details with you at some point. Start a new thread regarding Wild Thumper, TRex, and ROS if you are willing to share some of your experiences. =)
I might have shorted my T’rex controller with a Lipo. The controller works perfectly besides when I try drive the motors, both the fault LEDs come on and it makes a type of humming sound. Is there anyway I could test to see if it is actually buggered so I dont spend unnecessarry money?
Is it possible that its a fuse somewhere ? What could I do?