Ideas for 0-5vdc motor control

Some interesting results:
The DAC is inverting

Stick Centered
Yellow trace - SERVO1 output (PWM 0% duty cyc)
Blue trace - DAC output (5V)


Stick offset 50%
Yellow trace - SERVO1 output (PWM ~50% duty cyc)
Blue trace - DAC output (~2.5V)


This is where it gets interesting
Yellow trace - SERVO1 output (PWM ~50%)
Blue trace - Opto-Isolater PIN6 - Note the signal gets inverted, followed by non-inverted amplification by the op-amp, followed by low-pass filtering.

I’m using this circuit

If you look at the internal circuit of the opto coupler the signals are as expected.
If pin 2 is low → led is off → pin 6 is pulled up by R2
If pin 2 is high → led is on → internal transistor is switched → pin 6 is tied down

Yes sir, totally agree

AP doesn’t offer an inverted signal option for this output type. You could just put an inverter in front of your existing hardware.

1 Like

or just connect the led side of the opto from ground to pwm instead of pwm to +5

1 Like

That’s why I used the second opto as an inverting amp and have a complimentary output.

you don’t need an inverter. You can have normal or inverted output by simply altering how the opto led is connected. But do it whichever way you prefer.

The pulse is positive going so reversing the opto LED it will be reversed biased and not illuminate

pin 2 of optocoupler led to (+)
pin 3 of optocoupler led to PWM
will do the job

Still have not had the free time to start the the integration to the mower. Mainly because I do not have a garage, it been raining, nearly 100 degree F, etc…

I have been able to play with how I might hook up the driver/circuit to the mower. My main plan is to do as little wire cutting as possible and remove the Flight Controller (FC) when not needed. One plan is to have a remote relay in a box near the control arms and connected between the male/female plug going to it. By default, it will be set to the control arms (manual). It will connect to the FC by Ethernet cables that will unplug. When plugged in, I can switch it to remote.

I plan on having ethernet ports (left side and right side) on the mower and FC box. So I will just plug it in like connecting to a network.

The design right now has the diver/circuit with the FC. Thinking about doing a version with it in the box with the relay. It my be more universal that way.

First prototype of the relay box. Thinking it is going to be 2 version.

  1. Four (4) relay for the left with drive control and neutral

  2. Six (6) relay for the right with drive control, neutral, mower, and lights.

Plan on making the driver a stackable board to mount on top of the relays

The empty port is for the ethernet cable to connect to the flight controller.

Yes, I am probably overthinking it…

1 Like

You’re definitely adding many more components than I did. If you scroll up to jun 16 you’ll see where I just put everything in one box.
But you do whatever you’re most comfortable with.

The main thing is that you’re having fun enjoying your hobby. It will work fine I am sure.

1 Like

I kinda put some parameters and restrictions to this build/play…

Plug and Play
Able to unplug and move to another machine or store.

As few wire cutting a possible
Try and not splice wires if possible. Less of an OOOPPS factor, which I can easily do…

Design
Need to work my brain and do some 3d design and prints. etc…

Play and have Fun
Learn a few things in the process.

The requirement to be able to move this between machines might be hard (but not impossible). The main issue I am concerned about is that the drive electronics (used for navigating to waypoints to high precision) are configured/tuned to account for weight of the machine and its mechanical limitations, as well as the geometry of satellite antenna locations an other electronics on the mower.
I am sure the configuring/tuning would be different between machines. By tuning, I mean setting the parameters for the specific machine to get proper performance. However you could save the parameters for each machine (once you determined them, and load up the correct set).

1 Like

This thread is amazing! I have built the circuits designed by johnharlow and attached to my 48V Ryobi ZT mower. I am stuck in the setup phase trying to get reverse for one of the wheels. I have tested the circuits and see that they work as expected. I assume I have a parameter messed up but don’t know what to change at this point. I am working with a Flysky-FSi6 mode 2 radio. I have throttle and roll on the centering stick. I have attached my paramlist; if someone could review to see if it is a MP setting that I have messed up, I would appreciate it.

paramlist.param (13.9 KB)

ryobigood.param (19.9 KB)

If it helps here is my working param file, you can do a diff in MP

Thank you - your list helped me to see that my list is ok. I reexamined the motor test, and noticed that I did have reverse on both sides, but on one it would max out at about 15% in reverse.
I have back stabbed the connectors on the accelerators to connect to the DAC. Using the Oscope I could see that on the one side the signal was being clipped in one direction. The fix was to unplug the connectors from the accelerator.

I do have one wheel that has quicker acceleration and is faster than the other. Makes me wonder about the condition of the gearboxes. Hopefully, I can tune this out today.