Servers by jDrones

Pololu trex jr dual motor controller dmc02

I am working on a skid steer rover for indoor use with wheel encoders and a pixracer for a flight controller, running ardurover dev 4.0.1. I am uisng outputs 1 and 2 for throttle left and right. Output 3,4 are wheel encoder right and outputs 5,6 are wheel encoder left. I have read through the manual for the motor controller here I have removed the channel mix jumper so motor 1 and motor 2 can be controlled by the controller separately I have attached the 1,2 outputs from pixracer to channel 1,2 on the motor driver and left the RC/analog jumper left to RC on the trex. I cannot for the life of me figure out how to get anything to work when connected to the pixracer. I have plugged in motor 1,2 from trex jr to a servo tester and can get the wheels to spin then but not when connected to the pixracer. I have made sure and set thr brd_count to 2 to allow two PWM outputs on pin 1 and 2.

Does anyone have knowledge of setting up a pololu trex jr motor controller?

I have read through these posts here, here, and here but have not figured it out quite yet.

I think the most likely cause is a conflict between the wheel encoder input (on channels 3,4,5,6) and the servo/motor output (on channels 1,2). Could you try disabling the wheel encoders (WENC_TYPE = 0, WENC2_TYPE = 0) and put BRD_PWM_COUNT = 6 and check if the wheels moves?

If you’ve got a dataflash log that might help too in case it’s something completely different (like the vehicle isn’t armed or the SERVO1/2_FUNCTION parameters haven’t been set correctly.

So I have managed to get them working forward and reverse left/right although its a bit touchy and hard to control. I have also managed to keep it working even with wenc enabled and brd_count set to 2 but I do not see any rpm feedback in status screen in MP. I have the ground and power for the encoders powered from the power module connected to the battery running 4s which the encoder power can handle up to 24v here is a link to some logs and parameter files as well as rlog files although im not sure they go with the DF logs. Can’t wait to get this thing fully operational!!!

Appreciate all the help!

@Matt_C,

Great news. Re the RPM message not working, I think this is a change in Rover-4.0, there is a wheel-encoder message but perhaps that’s not showing up in MP (unless the Ctrl-F Mavlink Inspector is used). We also need to update the wiki it seems to make this clear.

Cool I will use that and see if they are working I would assume they are. just trying to get it tuned down a bit as it quite touchy on the throttle and left and right turning, have driven it up the wall a couple times hahaha. Is it still RPM in mavlink inspector or is it distance traveled? Found the Wheel_distance and mine are working on the pixracer, awesome!!! Now time for some tuning
To get this to work with two sepreate motor outputs I removed the jumper circle, and connected throttle left and throttle right to the first two signal pins shown in red box. I left mot_pwm_type to normal. To get both forward and reverse working I had to raise and lower throttle left/right servo values to 900 and 2000 with 1750 as mid point it now goes both forward and backward, albeit a bit to fast for my liking hahaha. The other two jumpers not circle are for analog/rc (jumper nearest the red circled one) and the other jumper is to provide power on the signal pins.

Sounds like progress. Having to set the mid point to 1750 is a bit unusual. It should be 1500 normally.

I see above there’s a link to some logs, are those still valid or have things changed much since these logs were produced?

I believe those are older logs. When the pwm values were set to 1100 min 1500 mid 1900 max I could only get the rover to go in one direction and you could hear the motors having a constant load on them when stick was centered. I saw the motor output light show that it was switching directions but never would move in reverse. After setting pwm values to 900 min 1750 mid 2000 max the motors stopped constantly having a load on them and I was then able to go in reverse! I will post a file here in a cpl days, as its finals week here so have a few presentations to do. and hopefully weather stays nice so I can go to a parking lot and have more space might see if the university will let me go in gym.

1 Like
Servers by jDrones