Hi all,
Has anyone used this hardware instrument? If so, some questions:
1. Is there no option to select VID66-06 type stepper from the GUI? If so I sure don't see it.
2. When using a pin with a sensor to calibrate to a known position, is that pin expecting to toggle to ground when the sensor is tripped? just like a pushbutton would?
3. Does anyone have example code of doing this?
Thanks in advance.
Wet / Magnetic Compass With hardware Calibration
-
- Posts: 32
- Joined: Tue Jan 08, 2019 8:28 pm
- Keith Baxter
- Posts: 4674
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Wet / Magnetic Compass With hardware Calibration
Hi,bmooneyhan wrote: ↑Fri Mar 31, 2023 7:09 pm Hi all,
Has anyone used this hardware instrument? If so, some questions:
1. Is there no option to select VID66-06 type stepper from the GUI? If so I sure don't see it.
2. When using a pin with a sensor to calibrate to a known position, is that pin expecting to toggle to ground when the sensor is tripped? just like a pushbutton would?
3. Does anyone have example code of doing this?
Thanks in advance.
You found this not? Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 32
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass With hardware Calibration
Hi KB,
Yes I have installed and have the compass turning, trying figure out the calibration.
Thanks.
Yes I have installed and have the compass turning, trying figure out the calibration.
Thanks.
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass With hardware Calibration
bmooneyhan wrote: ↑Fri Mar 31, 2023 8:13 pm Hi KB,
Yes I have installed and have the compass turning, trying figure out the calibration.
Thanks.
Handled natively in AM :
https://siminnovations.com/wiki/index.p ... d#VID66-06
Code: Select all
Example
-- Initiate stepper motor with:
-- 2048 steps
-- 10 rpm speed
id = hw_stepper_motor_add("My stepper motor", "VID66-06", 2048, 10)
-- Set position
hw_stepper_motor_position(id, 0.5)
Code: Select all
-- We have a sensor halfway of our stepper motor
-- When this input is high, the stepper motor will be set to virual position 0.5
hw_input_add("ARDUINO_NANO_A_D6", function(state)
if state then
hw_stepper_motor_calibrate(id, 0.5)
end
end)
-
- Posts: 32
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass With hardware Calibration
So I see your screenshot of the GUI, and then I see the code that is in the hardware. Is this to illustrate that the GUI configuration elements work together with the line configured as "VID66" in the hardware code? Currently I have my stepper coded in the hardware, pin bindings and all, with nothing configured in GUI.
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass With hardware Calibration
Hey, if one were applying the sample found on the wiki on our own, we were already seeing this is done only with binding ourselves manuallybmooneyhan wrote: ↑Sat Apr 01, 2023 5:56 pm So I see your screenshot of the GUI, and then I see the code that is in the hardware. Is this to illustrate that the GUI configuration elements work together with the line configured as "VID66" in the hardware code? Currently I have my stepper coded in the hardware, pin bindings and all, with nothing configured in GUI.
Just screenshot and scripts are totally de-correlated, the screenshot is showing what we see with an available hardware instrument from the Online Store, nothing to do with the VID66-06 itself
Just did at the moment for you ...
-
- Posts: 32
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass With hardware Calibration
Thanks very much! I will get this working!
-
- Posts: 32
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass With hardware Calibration
Good morning all,
I always try and circle back to let those who helped out know, I got this compass working. I had mistake in my code (stepper ID) and now it's good. It tracks the in-game wet compass and auto-calibrates using an optical sensor. I'm using the x27 168 stepper motor with the A4988 stepper driver. My binding for the stepper controller pins and the calibration pin is done in the code, not in the GUI. There may be a little fine-tuning left to do, and I haven't tried micro-stepping yet to see if it's much smoother.
As always, thank you everyone for your support. The Wiki and support forums are my favorite AM features.
Buddy
I always try and circle back to let those who helped out know, I got this compass working. I had mistake in my code (stepper ID) and now it's good. It tracks the in-game wet compass and auto-calibrates using an optical sensor. I'm using the x27 168 stepper motor with the A4988 stepper driver. My binding for the stepper controller pins and the calibration pin is done in the code, not in the GUI. There may be a little fine-tuning left to do, and I haven't tried micro-stepping yet to see if it's much smoother.
As always, thank you everyone for your support. The Wiki and support forums are my favorite AM features.
Buddy