Author Topic: Help with switching PWM signals  (Read 2050 times)

0 Members and 1 Guest are viewing this topic.

Offline SethGITopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Help with switching PWM signals
« on: May 20, 2017, 07:01:54 pm »
Hello,

I am working on a robot which is driven by 4 brushless motors controlled by ESCs. A pwm signal is sent to the ESCs by an arduino. We need to have a kill switch to immediately shut off power to the motors. We have a kill switch which is at 5v when activated. Since we don't have space to have large relays to switch all the power, the idea is to instead have some circuit (?) which switches the ESC from receiving the PWM from the main arduino to a secondary arduino which generates a constant 1500hz signal (the don't move one). I've had a few ideas for how to do this (Mosfets,BJTs, mux ics, Tri-state buffers), but really have no clue of how to go about actually executing. I attached a screenshot of one simulation which ~works~, but I'm not sure if it would be the best solution. In this case, the top (40hz) signal represents normal operation and the bottom is the kill state. The switch in the middle is the kill switch.

Thanks for the help!

« Last Edit: May 20, 2017, 07:34:59 pm by SethGI »
 

Offline FreddyVictor

  • Regular Contributor
  • *
  • Posts: 164
  • Country: gb
Re: Help with switching PWM signals
« Reply #1 on: May 20, 2017, 09:47:14 pm »
what's stopping you from just having a kill switch on the main arduino which immediately sets pwm to 'stop' ?

I'm not sure that I see any point in the idea of switching to a secondary pwm generator

you're refering to hz all the time but that is just the pwm frequency and does not control the motor speed

if this is normal radio-control rc pwm signals, then pwm pulse length is 1->2ms
With the motors being reversible, this would mean 1.5ms (or 1500us) is the 'stop' position
some ESC's will automatically stop if they don't receive any pwm signal after a short while
you can use watchdog timer to force stop should your code get stuck in a loop
 

Offline SethGITopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: Help with switching PWM signals
« Reply #2 on: May 21, 2017, 02:32:02 am »
It's a requirement that there is a hardware level kill. That's why we need the secondary pwm generator.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13119
Re: Help with switching PWM signals
« Reply #3 on: May 21, 2017, 03:35:24 am »
I would not call substituting a control pulse requesting zero speed a hardware level kill.   Adding another MCU to generate it is crazy.  Do you then add yet another MCU to supervise the zero speed pulse one?  Turtles all the way down . . . . |O

Look carefully at the ESC design.  Configurable behaviour on loss of control pulse may be an existing firmware option - obviously you want motor shutdown as fast as possible, but again I wouldn't care to rely on that to implement a HARDWARE kill switch.

 It may well be possible to reset the ESC's MCU and hold it in reset.  You'll have to be absolutely certain that the MOSFETs in the three phase H-bridge have gate bias resistors that will hold them in the off state or bad things will happen. 

Otherwise review your design - you only need ONE relay to disconnect the motor supply battery, or possibly a beefy TRIAC crowbar circuit to blow the battery fuse.
 

Offline orin

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: us
Re: Help with switching PWM signals
« Reply #4 on: May 21, 2017, 04:54:45 am »
At least in the robotics competitions that I've done tech inspection, a kill switch is literally a physical switch between the battery and the motor(s).

What _exactly_ do the rules say?

In our case, I'd probably let a software PWM modulation scheme through for a league competition with a warning that it would probably be disallowed at any higher level.

Edit: Remember, the purpose of a kill switch is to immediately stop a robot that's run amok.  There's no better way than mechanically removing the power with a good old fashioned switch.
« Last Edit: May 21, 2017, 04:58:26 am by orin »
 

Offline SethGITopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: Help with switching PWM signals
« Reply #5 on: May 24, 2017, 11:16:02 am »
So it's a small competition and the rules are pretty vague, but this would be allowed.

A physical switch is kinda hard because it's an autonomous underwater competition so just jamming a switch in the middle doesn't help unless it's waterproof, which is super expensive.

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13119
Re: Help with switching PWM signals
« Reply #6 on: May 24, 2017, 11:48:53 am »
Waterproof is *NOT* super-expensive.  Use a reed switch to supply the gate of a suitable power MOSFET, with a resistor gate-source to bleed off the gate charge if the reed switch is open.  Locate the reed switch next to your enclosure wall (which must be non-ferrous at that point), and use a high power magnet to actuate it.  How you attach the magnet is up to you - 3M do some industrial hook and loop fasteners that are basically Velcro on steroids.   Its worth epoxy dipping the magnet before attaching the hook & loop tape so it doesn't corrode.   

You can also do it the other way round - attach magnet to short the MOSFET gate to source to disconnect the load, but that is far more likely to fail ON
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf