Shop OBEX P1 Docs P2 Docs Learn Events
PULSOUT doesn't produce any signal — Parallax Forums

PULSOUT doesn't produce any signal

YanroyYanroy Posts: 96
edited 2005-07-19 14:36 in BASIC Stamp
Hi,
I'm sure this is just something absolutely stupid I'm doing wrong, but I can't get PULSOUT to work!· I'm trying to run an IFI Victor speed controller (but you can consider it a servo, since it takes the same signal).· I had this circuit working once before, a long time ago, so and I've re-checked it, so I know it's not a wiring problem.· I've also moved my stamp off the circuit and onto a breadboard, still no luck.· I've put debug statements on both sides of the PULSOUT instruction and I see them in the debug window, so the instruction must be executing.· The victors don't recognize the signal... small wonder, considering my scope says there isn't any signal.· It sits at low all the time.· Here's my pulsout instruction:

··· FOR n = 0 TO NumPulseOutputs - 1
········ DEBUG DEC ? n
········ PULSOUT n, PulseRate(n) << 4
········ DEBUG DEC ? (PulseRate(n) << 4)
··· NEXT

The debug window shows n = 0 through 6 (as expected) and PulseRate(n)*16 is 1200 for all n (as expected).· I'm using a BS2sx, so that should correspond to a pulse width of 1.5ms.· Any light you can shed on this would be greatly appreciated.

Yanroy

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-15 20:34
    You must set your pin to the resting state before using PULSOUT; if you want a high-going pulse, then use LOW to set the pin that direction before using PULSOUT.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • YanroyYanroy Posts: 96
    edited 2005-07-15 20:37
    Even if I had the polarity wrong, I should see a pulse, either negative or positive, right?· I'm not seeing any activity at all.· The line on the scope is almost perfectly flat even at really high sample rates and really low volts/div.· It never moves more than a few mV, never mind up to +5.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-07-15 20:39
    Can you say:

    MyVar VAR BYTE

    MyVar = 5

    PULSOUT MyVar, 100

    in order to get a pulsout on pin 5? I didn't think so.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-15 20:40
    What's in the pulseRate() array?· A PULSOUT of 0 doesn't generate a pulse.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-15 20:42
    Nope, PULSOUT allows a constant, variable, or expression in the pin parameter.
    allanlane5 said...
    Can you say:

    MyVar VAR BYTE

    MyVar = 5

    PULSOUT MyVar, 100

    in order to get a pulsout on pin 5? I didn't think so.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • YanroyYanroy Posts: 96
    edited 2005-07-15 21:01
    As I indicated in my original post, PulseRate(n) = 75, thus PulseRate(n) << 4·= 1200, which shuld be 1.5ms on the BS2sx.· the debug statements shown in my code snippet report this is the case.· Thanks for the help so far... but it still doesn't work.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-07-15 21:18
    Yanroy -

    Do you have both the Stamp and the IFI Victor speed controller respective grounds connected together at some point for a common ground? If not, you will need to do so. Presuming that's the problem, "absolutely stupid" - no, absolutely simple - YES! smile.gif

    Regards,

    Bruce Bates
  • YanroyYanroy Posts: 96
    edited 2005-07-16 19:18
    Yes, the grounds are connected together when I have them connected to the stamp.· Even if there was a problem with that ground connection, when I attached the oscilloscope, the ground connection is known to be good because I at first thought it was a problem with the scope and starting poking other parts of the circuit... they all checked out ok.· It's almost like the stamp is just ignoring me.· Or maybe the output drivers of the pins are dead somehow?· I can't think of anything that might have caused that... the other pins on the stamp are fine.· I guess I should have tried manually setting them high or low and seeing if they change that way... I didn't think of it being a stamp hardware problem until just now.· Guess I'll have to try that on monday when I go back to work.
  • YanroyYanroy Posts: 96
    edited 2005-07-18 13:45
    Ok, I think I may have figured out my problem... it's not good at all.· I decided to manually make a waveform by setting OUTS to $FFFF and 0, alternating every 250ms.· Of the first 7 pins, only P6 shows the wave correctly.· The signal seems to be extremely noisy, but in·a very uniform way (if that makes any sense).· It appears as a wide fuzzy bar on my scope and shows very rapid oscillations when I turn the sample speed up.· It's almost like the high/low I have in my code is modulating some very high frequency signal.· Could·I be seeing the oscillator on the stamp?· Another odd thing... P3 shows this "fuzzy bar" when it's in the·low state, but shows a smooth ground when it's supposed to be high.· P1, P2, P4, and P4 all output a smooth ground all the time.· The other pins from P7 onward work as expected, outputting this wave (but it's also the "fuzzy" wave).

    Is my stamp dead?· I have no idea how it could have been damaged... I doubt it died of old age, despite being about 4 years old.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-18 13:47
    I have Stamps far older than that that are still working fine, despite the abuse I put them through. It would be very helpful for you to post a schematic and complete code -- fragments and descriptions sometimes leave things a little short.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-07-18 14:02
    Do you have any terminating resistors for the signal? What are your I/O pins tied to?
  • YanroyYanroy Posts: 96
    edited 2005-07-18 14:16
    Ok, if you really think there's a chance the stamp isn't dead, I'll post the schematic and code.· It for some silly reason won't let me upload the schematic in autotrax format: "You cannot upload files that use MIME type : application/schdpl32".· I think it might be confusing autotrax's .sch file format with microsoft schedule+?· The icon is still messed up on my comp because they use the same file extension.· It also won't let me upload the file in SVG format, which is the only graphics format that autotrax will export in...· I did manage to cause an internal server error by trying to upload it [noparse]:)[/noparse]· So, it's attached as a JPG screenshot of internet explorer displaying the SVG image!· I hope it helps.
  • ForrestForrest Posts: 1,341
    edited 2005-07-18 15:04
    I was surprised to see no electrolytic caps across the input sides of the LM7805 and the LM7812 - typically 10 to 100 uF. Also missing were the (4) 0.1 uF capacitors which should be connected to the MAX232A chip.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-18 15:07
    You may in fact·have a bad Stamp -- I ran the attached program on my PDB and it works fine.· That said, be sure to double-check your Vss connections between the Stamp and the rest of your circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • YanroyYanroy Posts: 96
    edited 2005-07-18 15:18
    Thanks, Jon.· I ran the program and it worked as expected on the pins that I said seemed normal in my last post.· The ones that were dead before were still dead this time around.· I think I'm going to pronounce it dead.· Or at least brain-damaged.

    Forrest - That's not a MAX232A, it's a MAX233A.· It has internal caps.· As for the caps on the voltage regs, I've never been told to put them on the input side.· I was always told to put them on the outputs.· I've never had any problems.· Why would they be needed on the input side?
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-07-18 15:46
    Yanroy,

    I'm interested in the "Winter Bot" you are making. Can you tell us more about this robot? Gas or electric, runs on snow? Uses tracks? I'm interested in what it's all about after seeing the schematic. I'm really wondering about the robot use, drivetrain and mechanics.

    Thanks,

    Ken Gracey
  • ForrestForrest Posts: 1,341
    edited 2005-07-18 16:43
    re. MAX233A - hmm, it's time to clean my glasses!

    The caps on the input side of the voltage regulator help smooth out the voltage - which is really important if you're using an unregulated AC-DC power supply. The value of the caps is determined by how much current is required in your setup. Check the data sheetd on the LM7805 and LM7812 for more info.
  • YanroyYanroy Posts: 96
    edited 2005-07-18 18:01
    Well, I'm not sure just how much I'm allowed to post on the net, since it's a project for the Army Corps of Engineers...·but they did have me make up a website with a lot of info on it (which is yet to be posted) so I don't think I'll be overstepping my bounds by telling you and posting a pic.

    I'm in my 3rd year of college.· I've been working on this project over summer break since I was a junior in highschool.· I was lucky enough to be hired along with 4 other students from the local FIRST robotics team to help one of the team's coaches with his job at the US Army Corps of Engineers Engineer Research and Development Center Cold Regions Research and Engineering Lab (that's a mouthful!· we call it CRREL for short [noparse][[/noparse]how many times can you use variants of "engineer" in one name?]).· The project was started to verify a mathematical model on over-snow vehicle mobility.· Back in the 70's, some data had been collected on a large swedish snow cat type vehicle (~2000kg), so we used the Bekker model to scale this vehicle down to a 25kg robot.· The robot is instrumented with sensors to measure the same mobility parameters as the original vehicle so that we can verify the correctness of the Bekker model predictions.· We measure snow resistance to forward motion (because of the compaction) by using hall effect current sensors on the motors, we have an ultrasonic sensor to measure how far the robot sinks into the snow, etc.· Many different pieces of information can be derived from knowing a few basic facts about how the robot is moving and then the details of the robot itself, such as ground pressure.· Unfortunately, I don't have an in-depth understanding of all of this; I mainly focus on the electrical and software side of the robot.

    In addition to performing data-gathering tasks, in the second year of the project we decided we were going to expand the robot to a new mission: testing soil on army test-firing ranges for explosives contamination.· This is important because the bits of unexploded ordinance get into the ground water.· In order to properly treat the range for sustainable use, the concentration of explosive residue must be measured.· Because some of the unexploded ordinance may still be live, this is very dangerous for a human to do, not to mention boring (taking a small dirt sample every foot or so in a grid pattern over many hundreds of feet).· The circuit and code that have already been posted are for the control system of this robot.· It's designed to perform the snow mobility tests, but also do autonomous sampling of weapons test ranges using GPS.

    It's a simple tracked chassis.· Each track is powered by 1 motor.· The power source is 4 li-ion batteries that are 16.8V each, used in parallel to supply a peak current of 40A.

    For reference, the tracks are 5" wide.· I've attached pics of the robot when it's being used for a "tractor pull" sort of traction testing in snow and also a pic of the robot when it's set up for use in soil sampling (you can see the giant hollow drill on the front that dumps into the plexiglass enclosure).· Despite the cords shown in both these pics, the robot normally operates completely wirelessly.· These cords are for charging and debug info.

    Forrest - the input to the voltage regulators is direct off the batteries of the bot.· It looks quite clean on the scope.

    Post Edited (Yanroy) : 7/18/2005 6:09:21 PM GMT
    1395 x 871 - 551K
    1456 x 1014 - 375K
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-18 19:23
    Wow! That is a very cool robot base.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-07-18 20:55
    Yanroy,

    That's exactly what I was interested in seeing - thanks for making the post. The Swedish snowcat you mentioned your robot is modelled after is called a BV Haaglund troupe carrier. They're a powerful, high speed snowcat which perform well in moderate snow conditions. A few of these wound up in the U.S. but my impression is that they weren't as well suited for our variety of snow terrain compared to that found in Sweden.

    I'm also interested in over-the-snow robotics, but for avalanche prediction, exploration, search and rescue and gear transport. It's one field of robotics where few have gone and the complications are quite high. When I finish my current project (designing the small Penguin robots) I'm going to build a snowcat robot. My plan is the following:
    • 24-36 HP Honda V-twin engine, running a pump and alternator
    • Dual 151" snowmobile tracks with standard snowmobile running gear
    • Aluminum chassis
    • Hydraulic drive system for hydrostatic steering (engine => pump => proportional two-way valves for each track => fluid storage => heat dissipator closed-loop system)

    Efficient full-size snowcats designs have a weight ratio less than 1 lb/in2. And they can still get stuck in soft snow, especially when coupled with an incline.·For this reason·you will often see a single snowcat design equipped with tracks ranging from 8' to 12'·in width for local snow conditions.

    For my robot, I plan on·designing for·less than .4 lb/in2, which is less than a skier. This is critical in the Sierra Nevada mountains, where annual snowfall can be 400 inches per winter. Sometimes the stuff lands like cement and sets up fast; other times it will be as soft as Utah snow (for a·day anyway).

    I'm motivated by your project. Now, if I can just get this boring business stuff off of my desk I can again concentrate on my snow robot. Keep up the good work and continue to post pictures. It's tough to think about snow right now since it's going to be 105 F at Parallax this afternoon, but we've still got some hanging around in the mountains from a huge winter.

    If anybody else is working on similar robots I'd sure like to hear about it.

    Ken Gracey
    Parallax, Inc.
  • YanroyYanroy Posts: 96
    edited 2005-07-18 20:59
    Well, this robot was designed to have less than 0.2psi groundpressure.· It can travel over deep snow (I don't know if you know that term - it's a technical term meaning "snow that's so deep no effect from the ground is felt", whereas shallow snow would be snow that is compacted against the ground) and only sinks to a max of 4 inches.· I may be able to get you more technical data from our previous snow tests if you'd like it.· After all, a lot of what we do around here is figuring out how stuff moves in snow [noparse]:)[/noparse]
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-07-18 21:10
    Yanroy:

    Huh? What does it weigh? You must be counting the bottom of the chassis in your calculation, not just the treads. Is this the case?

    - Ken
  • ForrestForrest Posts: 1,341
    edited 2005-07-18 23:19
    Yanroy, that's an a great looking bot.
  • YanroyYanroy Posts: 96
    edited 2005-07-19 14:36
    We have two tracks * 5 inch wide tracks * 24 inches long (that's the flat part of the tracks, not counting the leading edge) = 240in^2 of ground contact

    It weighs ~25kg with the sampler.· Without the sampler, it's ~22kg, which is 48.4lbs.

    48.4lbs / 240in^2 = 0.202psi

    I hope these calculations are clear.· It doesn't include anything but the bottom of the tracks in the ground pressure calculation.· We made it with such a low ground pressure because the amount of sinkage in the snow isn't proportional to the size of the vehicle.· A smaller vehicle will sink further, proportionally, because where the larger vehicle may be feeling an effect of the ground under the snow to hold it up (shallow snow), a small vehicle does not (deep snow), thus letting it sink further.· It is actually for this reason that the army is interested in small robotic vehicles of this sort - they can drive ahead of a larger vehicle and not worry about falling into a crevasse because the snow bridge on top of it won't break under the small pressure.· The robot can then use ground-penetrating radar to advise the larger vehicle to avoid the crevasse (our·bot·was intended to carry a radar payload much like it carries the sampler payload, but that never was actually done).
Sign In or Register to comment.