Asked
— Edited
Can you show me some examples in Javascript of how to Setashome for V21? Can you also show me some examples in Javascript of how to Calibrate V22?
Related Hardware EZ-B v4
Related Controls
Stepper Servo
Inverse Kinematic Arm
I think I know why your sentences appear as one run-on paragraph. Your sentences do not end in punctuation. The auto-formatting of the forum will create separate sentences and paragraphs based on punctuation. If you do not use punctuation, all the sentences blur together into one long run-on sentence that I cannot understand. Punctuation ends sentences, such as periods, question marks, or exclamation marks.
Anyway, good news: I tested the firmware and stepper motor skill with a limit switch...
Calibrate works on power-on.
Calibrate works with the ControlCommand being sent.
Some suggestions...
When you send the calibrate command, I recommend looking at your wiring and ensuring the limit switch is not grounded (shorted to ground).
The stepper Arduino firmware has PULL_UP set on the limit switch pin. That means it uses the internal pull-up on the Arduino micro. You might want to check what kind of Arduino you're utilizing and see if it has an internal pull-up resistor. If it does not, you will need to add a pull-up resistor. But do not add one without knowing. Check with the manufacturer or datasheet.
I'm sure you'll figure it out! good luck
Oh, I think you might also be able to put a volt meter on GND and Pin #6 when the Arduino is powered on to see if there are 3.3 volts on it. If so, then the micro has a pull-up resistor on the i/o. Otherwise, you don't know if it's GND or floating numbers.
If you don't have a pullup, you'll have to add a resistor then. I'm guessing 10k ohm or something?
Yes, that is very good news that it works on your end. I use Arduino Uno for the slaves and the mega for the master. Thanks.
I use an uno for the test, and it works. The mega shouldn't have any issues with pull_up either. Ensure your limit switch is not closed (shorted) when calibrating is set. Otherwise, it won't do anything. It calibrates (moves) until the switch is closed (shorted to ground).
So the calibrate will work if your switch is open (not shorted to ground). I'm sure it'll be something simple that you'll notice.
10k pull-up from pin6 to 5v to stop floating. Wire from pin 6 to switch opp side of switch to gnd. Switch closes and it shorts to gnd is that everything? Makes sense.
I think Arduino is 3.3v. So you'd want a 10k pull-up from pin 6 to 3.3v.
That does make sense. How long is the wire leading to the switch? Maybe the internal pull-up on the micro is too small, so you need the external 10k pullup. Worth a shot!
As much as I would like to say that I got it to home or calibrate... just cannot get it to work. Did you use an actual stepper when you were testing it? A simple way that I've been testing it is to move V21 to 1500. I then tell it to Home. Then I tell it to move V21 to 1 and it's not supposed to move because it's already supposed to be at location 1, but it moves the 1500 steps. Have tried doing same thing with calibrate but no success with that one either. To keep things simple I was using a wire to go from pin 6 to ground on the Arduino. The wire to the switch on the bot will be 18' away eventually. Tried adding a pull-up 10k to 3.3v to avoid any floating but that didn't help either. For now I just get it into an acceptable starting location, turn off power and it's at location 1. Other than that my big bot is doing all kinds of cool things. Will be loading a pallet with various items, probably start with 50lbs bags of sand, boxes etc. There are 4 big 6" suction cups on the end effector that I was using for moving 3/4 plywood. Will have to scale back to 2 for the bags of sand.
Yes. That is exactly what I did and it works.
CHeck that you're sending the correct commands. Look at your debug log. Look at your errors. Look at your project and make sure it works. Try with a basic empty project with only the stepper skill and your script. Your script should only have one command in it for homing.
Ensure you are sending the correct command. Use the cheatsheet to see that you're sending the correct command.