Have a skid steer rover with 2 brushed motors with relay (relay sets direction, pwm sets speed).
Due to mounting I have to reverse the direction of one of the motors.
However if I reverse the servo the trim is set to maximum on reboot and the motor spins full speed (even in Failsafe!).
If I start without reverse and change it to reverse during operation it works as expected (because trim is still minimum until next reboot)
How do I reverse only the direction relay?
You can reverse most brushed motors by changing the motor cable order. The behaviour you describe is what is expected. The motors stop with low PWM and run with high PWM. If you reverse the output, it goes high, the motor runs. If you have a standard bidirectional RC ESC, you can reverse the output, because the neutral output stays at 1500us PWM.
You are right, but I forgot to mention the motor driver is built into the motor so this is very hard to do. So I both have to use the brushed-with-relay mode and cannot swap the motor wires.
So all I need is to invert one of the relay outputs. I could do this with a single channel inverter electronically.
But what is strange is if I start the rover without motor reverse. Then reverse one of the motor direction during operation, it works as needed, pwm is still low to high on both motors but the relay output is inverted. I was wondering if there is a parameter for this?
However after I restart the rover the pwm gets reversed (as well as SERVO_TRIM goes to max).
Separate the motor and controller and swap the motor wires. Otherwise reverse the servo channel in ardurover,
Its hard to understand what you have there, is your motor/controller set for 1000us - full reverse and 2000us - full fwd, 1500us stopped? Or something else like 1000us stopped, 2000us full speed and separate fwd reverse relay control?
This picture shows what I have. I am using brushed with relay, that apart from the reverse direction works as expected.
The motor driver is not easy to access in this unit. On servo channel (connected to blue wire, pwm for speed control) I am using 1000-2000 where 1000 is stop and 2000 is full speed. If I reverse the servo channel the motor goes full speed as it reverses the pwm out.
However it does also reverse the relay pin! So (white wires) connected to aux 5-6 functioning as expected, when I reverse the servo signal the relay pin output is inverted too.
What I am trying to say is that is there some way to invert the relay pin only and not the pwm signal?
This only applies to brushed-with-relay motor setup…
I see more clearly what you mean, so what did you connect the white wire to? And how have you set up this fwd rev output?
White wires are connected to AUX 5-6 which is relay 1 and 2 when brushed-with-relay is used.
The rover is skid steer, I am using SERVO1 and 2 for the motor pwm (blue), I don’t have yellow (encoder pulses) connected as this is not quadrature.
This works fine, but as it is a skid steer rover when I move forward one side goes forward and the other side back. the rover goes forward on a turn-on-spot movement. So one side is reversed (as expected since both motor move CW and CCW together but mounted facing outwards).
Next I reversed the servo output on left motor. Everything worked great, until I restarted the autopilot. It seems that relay gets inverted without restart but servo output inversion only applied after restart when also SERVO_TRIM is applied to be 2000 so the motor goes forward at full speed without throttle.
I used an electrical component a single channel inverter on the line to solve this.
It would be great to have a way to invert relay signals (lik eI think for camera relay CAM_RELAY_ON param does this).