Hi,

I am building (slowly) a 2 wheel hanging pendulum robot that uses 2 26" Bicycle wheels and Kelly reversing controllers.

The problem I have is that the controllers use a pot or 0-5 volt input for a throttle and not PWM pulse width.

While I am initially configuring the robot I would like it to be testable with an RC radio system only.

And for this what I would like to do is provide the simplest hardware conversion of the RC receivers PWM output directly to a 0 - 5 volt throttle signal.

The typical - simple RC filter approach for converting PWM to a voltage level won't work because the Radio Control PWM output signal is not a zero to 100% PWM pulse.

Rather it is a long low pulse with a short but variable high pulse the second half of which defines the 0-100% state of the PWM.

This is probably doable but complicated in discreet components (Op amps, pots and capacitors), but messy and is not something I think would be worthwhile to undertake.

Certainly it is doable to edit the Pixhawk code to allow it to drive a digital pot or D/A from I2C and that is what I am planning on doing eventually in any case.

But if anybody knows of an existing (module) specifically designed to accept a radio control style PWM signal as input and provide a variable voltage as output that is what I would very much like to implement at this stage.

I have looked but been unable to find anything online that can actually deal with a radio control style PWM input.

There are plenty that will take a zero to 100% style PWM input (including a simple RC circuit) but none that will deal appropriately with a radio control style PWM.

Any help appreciated.

Failing this I will simply start with either my Pixhawk or - more likely - my Beagle Bone Black.

Best Regards,

Gary

Views: 6701

Replies to This Discussion

Hey

I know there are a lot of ways to do it, but here is one I use, and you might like

When I want to power things, there is a great thing called a LED PWM dimmer, which has a knob.

Then as you turn the knob it is basically a 555 timer and an opamp driving a MOSFET.

Its great to have for just the thing you need! There are 8A versions but you can easily upgrade the NFETS or whatever for more power.

And then you attach the knob to a servo from the RX. With tape or glue or a plastic tube coupling.

I already made a few and they are fine with 90 degree servos but I would get 180.

I don't know where to get cheap 180 degree servos so I just use the 90 if you can help me find a 180 for $3 or so then I will make a few of those things because they do come in handy.

Hi Chrisa,

In fact driving a plain old 5K pot with a servo would work, but I am hoping to find an all electronic solution.

The PWM LED dimmer circuit itself is designed to work with a classic zero to 100% PWM pulse not the highly modified PWM pulse that is produced by our RC transmitters and receivers.

Hi Joe,

I am aware of the numerous Arduino implementations and you may be right.

If I can't find an already dedicated module, it may be worthwhile to roll my own that way, I'm eventually going to have to in any case.

Don't need any drive to speak of, normally just a 5K pot to the Kelly controller.

There are a ton of specialized modules that go the other direction producing radio control style PWM out so you can drive assorted servo applications.

It's just surprising I can't find a dedicated one for radio control style PWM in applications.

Best Regards,

Gary

Hi Evilmacaw,

I'm afraid this won't work unless you know something I don't.

I looked at DC ESCs as a possible solution, the problem is that I don't think any of them actually output a voltage.

They output a chopped signal (square wave) with the duration of the "high" pulses equivalent to percent motor speed required.

This is great for directly driving a DC motor, but not so much for an application looking for 0-5 volts DC input.

However, that said, what you are getting is something a lot more like a classic PWM which can be turned into a 0 - 5Volt signal with a simple RC circuit.

Some of these circuits work by increasing the on time of each pulse and some work by increasing the number of same width on pulses per unit time.

But both of them could be turned into a zero to X volts signal using an RC circuit.

I will revisit the possibility of using a DC ESC as the basis for the initial drive test circuit.

Thank you for making me think about this in a bit more depth.

I should have mentioned that the bicycle wheel motors themselves are brushless and the Kelly brushless reversing controllers designed to drive them are designed for a simple 5K pot type (throttle).

You cannot use regular RC type Brushless ESCs to drive this type of motor because they are Hall device feedback controlled.

Best Regards,

Gary

I would do this with an Arduino pro mini (the clones are dirt cheap).

Attached is a program I wrote to do this exact thing.

connect the RC signal to pin 3

connect pin 9 to the the PWM input of your controller

Have fun.

Phillip

Attachments:

If you want tips on how to get an Arduino to read Servo RC, you could look at our Jeep Rover Project's homebrew steering servo code: https://github.com/shimniok/diyrovers/tree/master/JeepServo

oh I know what you are doing now

5-10 minute job:

Take a servo and convert it to continuous by taking out the pot. then use the motor wires as the output, and the pot is now the biasing resistor which allows you to set the 0 point.

If you want to do all that, might be worth it or not.. I used cheap servos and sometimes they drift but that's fixed with a little bigger circuit. You could also just use resistors to change any and all the levels.

nice thanks I hope to see it work

If you need a more analog signal, then switching the output to either pins 5 or 6 will increase the PWM update rate from 490Hz to 980Hz (without effecting duty cycle).  Then a weak RC filter should be able to remove a reasonable amount of the "choppiness".

This line:

int PWM_Pin = 9; // PWM output pin

changes to:

int PWM_Pin = 5; // PWM output pin

Phillip

Is the controller from http://kellycontroller.com ?  Because , they seem to have set-up software tools and often there are multiple choices for the type of throttle input..  such as  PWM 0 - 100%   ,  PWM 50/50  , voltage input  etc.

A PWM throttle input control would be more resistant to EMF & noise.

Hi Philip,

The problem isn't the update rate, the problem is that the radio control PWM signal is very different than the classic PWM signal.

In classic PWM pulse width simply varies from zero to 100% and a simple RC circuit can easily convert this from a 0 to X volt output.

The type of PWM output from our radio control systems however is completely different.

For a given update rate it has a fixed low period followed by a high pulse of which the first millisecond of which is equivalent to servo low position then at 1.5 milliseconds servo center position and 2 milliseconds servo right position or for our use 1 millisecond would equal zero volts and 2 milliseconds would equal 5 volts.

This means that not only do we have an in-determinant time before we get a positive pulse, but also the first millisecond of a maximum 2 millisecond pulse is just to get to zero.

A simple RC circuit can't make that work.

Attachments:

Hi Chris,

Yes it is, but this particular controller only has 0-5 volt (5K pot) input or Hall device input which is simply a pulse rate input for a hall device on a pedal sprocket to apply power only when pedaling and for which I have not been able to get any actual information as to rate duration = speed.

The controller is programmable for a number of options (and quite easily with the supplied PC program), but the throttle control options are only those listed above.

I agree that PWM in would have advantages.

Best,

Gary

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service