Hi every one i have been member for a while now and have finally collected all the parts needed to complete fritz start here robot.
Every thing is the same apart from im using a 28x2 picaxe instead of the 28x1 picaxe,also using the ultrasonic sensor pictured below (in attachments instead of the SRF05.
A part number for that sensor --I/we need a data sheet so we can figure out what that extra “out” pin is and what it does. A CLEAR IN FOCUS picture of your wiring would help a lot too.
First off, I dunno 'bout this “out” pin. Man, I would like to see a data sheet. Skip it for now, I guess.
One thing I did see is maybe your connector. It appears to be a 2x5 or 2x6 ribbon connector. Is this correct? If so, you need to do some double checking on your pin-outs. If indeed it is what I think it is, you have 2 rows of holes and are using one row to connect to the sensor. When looking at the top of the connector (where the ribbon cable would go) you would be connecting to every-other pin. Even numbered connectors will be one row and odd will be the other.
Easiest way to check here would to do a simple continuity test to be sure you are connected to the correct pins.
Yes, that is a curious connector to use. Looks like a leftover 10-pin ISP plug. Other than that it looks fine. So you say nothing happens. Does the debug window pop on your monitor or is there truly nothing at all?
i have now replace the connector that jax and chris have both noticed,with female to female conectors
jax this is the program from the fritz walk through iv been using,when run i get the debug window start up an i get slight twitch on the servo. after this nothing but the debuy counting upwards, in the very right hand conner next to the debug word.???
could the problem be ccaused as im using a 28x2 picaxe in stead of the 28x1 ?? as i have noticed on there data sheets that they have different pin name (please bare in mine if this is stupid comment i am very new to all this lol)
symbol trig = 3 ‘ Define output pin for Trigger pulse symbol echo = 6 ‘ Define input pin for Echo pulse symbol range = w1 ‘ 16 bit word variable for range
main: pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS) pulsin echo,1,range ‘ measures the range in 10uS steps pause 10 ‘ recharge period after ranging completes ‘ now convert range to cm (divide by 5.8) or inches (divide by 14.8) ‘ as picaxe cannot use 5.8, multiply by 10 then divide by 58 instead let range = range * 10 / 58 ‘ multiply by 10 then divide by 58 debug range ‘ display range via debug command goto main ‘ and around forever
Don’t quote me on this but I think you need to define what port you are using. If you look at the pinout of the x2’s, you will notice that the pins are numbered but each “bank” of pins gets a letter too. Check the pinouts, check the lables, you may need to add these letters to your code.
Instead of trig = 3 it might be trig = B.3 or C.3
Instead of echo = 6 it might be echo = B.6 or C.6
Note that we are using a decimal here. These are NOT B1 as in byte-one, it is B-point-one, which declares a pin.
I have no idea if this is going to make a difference --It is worth a shot though.
now in the debug window i get readings in the b2 on the left hand side an readings in the w1 boxs on the right hand side which both go up an down when i move hand infront of the sensor?
In terms of robot brains and code and computers and the like, you got yourself some bytes. A byte is made up of 8 bits, each of which can be either on or off. With these 8 bits, the maximum number of combinations you can make is 256. Therefore, a byte can contain (be) a number between 0 and 255. In the picaxe world, bytes are b0, b1, b2 etc. —Now, if you need a bigger number, you can move up to a word. A word is made up of (2) bytes and thus, 16 bits. Same rule applies --the number that the word contains (is) can be as large as the number of different combinations that you can make with the bits. It works out to 0-65,535.
To cut to the chase, W0 or “word variable, number zero” is made from b0 and b1 (“byte variable, number zero and byte variable number one”). When you are looking at your debug window, ALL of the picaxe variables are being shown. You can see both the word variable --where you are storing the sonar range, but ALSO you can see the 2 byte variables that that word is “made” from.
With what you are doing now, I would pay no attention to the byte values shown in the debug window --do however, note their existance --in the future you will need to learn how to work with them.
One more thing to note is where the “debug” command is within your code. If the debug is after the pulsin but BEFORE the *10/58 stuff, the debug window will show the raw range data. If the “debug” command comes AFTER the *10/58 stuff, you will see the range after its conversion --the debug window will show your range in inches or CM or whatever you are converting to. --This is assuming that your aftermarket sonar sensor is spitting out numbers that are close to the SRF05’s numbers. I would assume they are pretty close but do some testing with the debug window, a book or something for a “target” and a tape-measure.
All the numbers I quoted above --the 0-255 thing and the 0-65,535 thing. These numbers pertain to the picaxe. Other chips allow for even bigger numbers, numbers with decimals and negitive numbers --some/all of these things can affect the “range” of values you can work with.
Looks like JAX and CtC have got you steered towards a solution on your sensor.
I have a question for you on another topic. I see your robot has four motors. The Picaxe board can drive two motors. How are you connecting your motors?
i had noticed that all the start here robots have only 2 motors conected to the A and B ports, and i noticed that theres not enough ports for more motors.
so i connected them in series, so two motors run to gether of the A port (Right side of robot) and 2 run together of the B port (Left side of robot) when turning to miss objects it turns nicely on the spot even on carpet an in garden on gravel.
have had no problems with this set up,but as you all know i am new to all thiswould this cause any problems with the picaxe or with the power used?
thanks for all the earlier info on the ultrasonic sensor, bytes (0-255) etc i understood all that thanks
right as for the motors
Am i correct in thinking :
Parallel - twice the current, same voltage as for one motor (so you need larger capacity cells). Series - Twice the voltage (twice as many cells) same current draw as one motor
If you have two identical motors in series, and you put 6V across them, they only get 3V each and the same current passes through both. If you place them in parallel, each gets 6V, and the current for each will be determined by the resistance of the motor. Ideally, each motor in parallel will draw the same (separate but equal) current. In practice, the motors will differ slightly, so one may draw a bit more than the other.
I don’t know what batteries you are using. You can separate out V1 and V2 on the Picaxe board so you can use a higher voltage battery pack for the motors on V2, and not fry your electronics on V1. Keep in mind that the motor driver on the board drops about 1.5V itself. So if you are only giving it 4.5V (3xAA alkaline batteries) you are down to 3V for your motors already. If you split that across your motors in series, what will happen?