Shop OBEX P1 Docs P2 Docs Learn Events
100hz fixed frequency variable pwm — Parallax Forums

100hz fixed frequency variable pwm

sport270sport270 Posts: 82
edited 2013-09-30 17:42 in BASIC Stamp
i have been bouncing around different solutions to a problem. I have been trying to make a variable frequency & variable duty cycle driver for 12vdc proportional solenoid. I have come to the conclusion that i only need adjustable duty cycle with a fixed 100hz frequency. The variable duty cycle is really only to set a % of flow for a proportional electrohydraulic pump control. Once i get it to the output i need, it will stay fixed, except ramping up & down to start & stop it. i have need for three of these signals to control one piece of off road equipment. And i need them to be very stable.
i was going to use some simple 555 based, but i also need serial lcd screen to show RPM of the shaft speed these pumps control. I have Quickstart propeller, Bs2, PWMPAL, DV103H, all at my disposal. Can anyone help with a absolute for sure way to do this, as i have been trying all of these and getting no where. Have to have this completed by end of weekend... :) Thanks for any help

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-30 08:45
    It's past the weekend, but, If I were doing this project (3 x 100Hz PWM, stable, straightforward), I'd use a BS2 and the PWMPAL. The PWMPAL generates the PWM signals (up to 4) on a "set it and forget it" basis and it's simple to interface to the BS2. The PWMPAL also can count pulses, like from a Hall-effect sensor for the shaft RPM and the BS2 has plenty of time to read the count, convert it to RPM and send that to the display. You'll need some kind of switching transistor between the PWMPAL's outputs and the 12V power for the solenoids.
  • sport270sport270 Posts: 82
    edited 2013-09-30 11:22
    like Irf740, Irf540
  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-30 11:44
    The IRF740 and IRF540 are really terrible logic-switched MOSFETs. They specify a gate threshold voltage of 2-4V, but they barely switch on with 5V logic level signals. How much current does your solenoid take?
  • sport270sport270 Posts: 82
    edited 2013-09-30 12:54
    max or full opening is 1800ma
    i just tested a circuit that was like 344hz at 39 % duty cycle and output 4.24vdc, and that worked perfect.
  • sport270sport270 Posts: 82
    edited 2013-09-30 12:55
    with high side Irf4905 driver
  • sport270sport270 Posts: 82
    edited 2013-09-30 13:22
    i am wondering if i cant just use an analog voltage to do this. since i am only turning this unit on to a set point and not changing it, except to ramp up & down. I shou;d only need the pwm signal if i was varying the output, so to avoid valve stiction. but since i am just going to a set point or 4.24 vdc why would it not work to just use a bs2 and output an analog voltage. mabye even have it watch the shaft signsl and vsary the voltage to keep shaft rpm within a set window. what would be the simplest bs2 code to just output 4.0 vdc and what external parts woukd i need to buffer it.
  • sport270sport270 Posts: 82
    edited 2013-09-30 13:26
    and by the way, thanks for your time in helping me create a signal generator. I tried to use a DRV103H , have u ever used this chip. it should have worked flawlessly but maybe the fact i was trying to get it to operate below 500hz caused the problems. could not get it to output enough.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-30 17:42
    The PWM statement is intended for generating an analog voltage with a little bit of passive filtering. There are examples of the simple coding needed and typical filter values in the chapter on the PWM statement in the downloadable Basic Stamp Syntax and Reference Manual or the equivalent help files of the Stamp Editor.
Sign In or Register to comment.