RC PWM input (Could you please help me set the brake function)

Hello, GPIO3 and GIPO4 are used as PWM inputs, and RC remote control is used to control two 6374 motors. In the middle position of the remote control, the motor is stationary. Push forward the motor of the remote control to turn in the positive direction, and push back the motor of the remote control to turn in the other direction.Could you tell me how to set it so that if the remote control is pushed forward, it will go forward, and if it is pushed in the other direction, it will stop the brake motor instead of reversing the motor?
odrv0.config.gpio3_pwm_mapping.min = -87000
odrv0.config.gpio3_pwm_mapping.max = 87000
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes

odrv0.config.gpio4_pwm_mapping.min = -87000
odrv0.config.gpio4_pwm_mapping.max = 87000
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes


Please help me how to set the brake function. I have seen the video above and it seems that the brake function can be used. I used the hall control as well.Please help me!(Using hardware version 3.6, firmware is 0.4.11)

I don’t think the existing firmware can do this. However, I have a simple patch for it that I wrote for my e-Bike mod.
I’ll post it when I have more time.

Thanks for your reply. It seems that the brakes are implemented in the video of the author’s controlling the shopping cart with the remote control in Hall mode.May I ask when will you release the firmware of E-Bike mod?I’d like more chances to try it. Thank you

Maybe in the video they are using velocity control. If you set the velocity setpoint to zero, it will brake the motor.
I am using torque control for my EBike, which is why I needed to change the firmware. I hadn’t planned to release any code as I was just playing about.

I also used speed control, and I tried to set the parameters as follows.

odrv0.config.gpio3_pwm_mapping.min = 0
odrv0.config.gpio3_pwm_mapping.max = 87000
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes

But after saving and rebooting, the motor starts spinning while the remote is still in the middle.
Or do you need to change it from the source code?

I think all you need to do is set min to -87000 and the 50% mark will be zero.

I was unable to change any of the Settings of the remote control (it was purchased) and set min to -87000, as shown below
odrv0.config.gpio3_pwm_mapping.min = -87000
odrv0.config.gpio3_pwm_mapping.max = 87000
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes

odrv0.config.gpio4_pwm_mapping.min = -87000
odrv0.config.gpio4_pwm_mapping.max = 87000
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes

Mark will be zero in 50% of the source code,Do you do that?
Thank you for your reply

You don’t need to change the code. Try with those settings.
I meant that when the transmitter sends 50%, it will be interpreted as zero, because zero is half-way between -87000 and +87000.

1 Like

The above Settings have been tried, min setting -87000, Max setting 87000.The remote control is in the middle position and the motor is at rest.Push the motor forward in the positive direction and the motor backward in the remote control in the other direction.What I want is that if I push the remote in one direction, the motor turns, and if I push the remote in the other direction, it stops the motor, not the other way around.

Is the 0.4.11 firmware still unavailable, or is it useful to update the latest firmware?Or are existing firmware releases unable to do so?Thank you for your help. Please reply to me.