Cov txheej txheem:

Thrustmaster Warthog Slew Sensor I2C Hloov Kho: 5 Kauj Ruam
Thrustmaster Warthog Slew Sensor I2C Hloov Kho: 5 Kauj Ruam

Video: Thrustmaster Warthog Slew Sensor I2C Hloov Kho: 5 Kauj Ruam

Video: Thrustmaster Warthog Slew Sensor I2C Hloov Kho: 5 Kauj Ruam
Video: Hardware Review: Delta Sim Electronics Thumbstick Upgrade für Thrustmaster HOTAS Warthog 2024, Kaum ib hlis
Anonim
Thrustmaster Warthog Slew Sensor I2C Hloov Kho
Thrustmaster Warthog Slew Sensor I2C Hloov Kho

Nov yog cov lus qhia ntxaws txog yuav ua li cas cuam tshuam nrog I2C raws tu qauv siv ntawm ThrustmasterWarthog lub qhov muag tua lub qhov muag. Qhov no tuaj yeem siv los hloov kho los ntawm cov txheej txheem tsis muaj txiaj ntsig zoo ministick mus rau qee yam zoo dua, Tab sis tseem siv tus qauv USB tswj hwm hauv chav kaw qhov rooj. Qhov no yog ua los ntawm thawj qhov kev tshaj tawm ntawm:

forums.eagle.ru/showthread.php?t=200198

Kev nkag siab yooj yim yog tias I2C raws tu qauv xav tias feem ntau ntawm cov hauv qab no, rau kev piav qhia zoo mus rau:

learn.sparkfun.com/tutorials/i2c

Txhua yam lus nug tshwj xeeb, xav nug kuv, thiab kuv yuav sim ntxiv rau qhov tsis yooj yim rau yav tom ntej nrog cov ntaub ntawv cuam tshuam ntau dua. Qhov no tsis yog txhais tau tias ua tiav, tab sis yuav tsum yog qhov pib zoo.

Qee qhov demo Arduino code tau muab tab sis thov tsuas yog siv qhov no raws li qhov qub 5V Arduino ib txwm tsis tuaj yeem siv tsis tau hloov kho.

Kauj Ruam 1: Cov Ntsiab Lus Tseem Ceeb

Tseem muaj cov ntsiab lus Sensor
Tseem muaj cov ntsiab lus Sensor

Tus ministick tua lub sensor uas los nrog Thrustmaster Wathog throttleis paub zoo tias yog ib qho ntawm qhov tsis muaj zog tshaj plaws nrog lwm yam khoom lag luam zoo. Muaj ntau qhov kev sim los ntawm tib neeg los hloov nws nrog qee yam zoo dua nyob rau xyoo, tab sis feem ntau tau tawm tsam qhov nyuaj ntawm kev cuam tshuam nrog cov txheej txheem digital I2C siv los ntawm nws.

Qhov ntsuas pom tseeb siv hauv Warthog qhov ntsuas cua yog N35P112 - EasyPoint, uas siv AS5013 cov cuab yeej ua kom pom tseeb IC ua los ntawm AMS.

Cov ntaub ntawv:

ams.com/eng/Products/Magnetic-Position-Sens…

Qhov txaus siab rau chav nyob ib zaug muaj raws li kev tawm tsam los ntawm Sparkfun:

www.sparkfun.com/products/retired/10835

Lub ntsuas ntsuas tau txhais rau kev siv hauv kev siv khoom xws li lub xov tooj ntawm tes, thiab yog qhov pheej yig heev. Hauv kuv qhov kev xav tsis lees paub hauv qee yam uas raug nqi ze li $ 500.

Kauj ruam 2: Pinout

Pinout
Pinout

Lub ntsuas hluav taws xob txuas rau PCB hauv sab tes xis lub tog raj kheej ntawm micro 5 tus pin txuas.

Pinout yog raws li hauv qab no:

  1. Vcc +3.3VDC (

    Kev tswj hwm ib cheeb tsam los ntawm 5V los ntawm tus tswj kab tawm ntawm lwm sab ntawm lub rooj tsavxwm, tsuas yog tom qab lub txuas, yuav tsum zoo rau puag ncig 20mA, tab sis kuv tsis muaj txoj hauv kev sim qhov no)

  2. I2C SDA
  3. I2C TSI
  4. GND
  5. Khawm 1 (Feem ntau siab, sab hauv 5V rub tawm)

Kauj Ruam 3: Cov lus piav qhia raws tu qauv

Cov lus piav qhia raws tu qauv
Cov lus piav qhia raws tu qauv

Lub sensor ua haujlwm ntawm I2C chaw nyob 0x41 - txhua qhov sau lossis nyeem cov lus txib pib nrog qhov chaw nyob no.

Thaum lub qhov hluav taws xob txuas rau lub khoos phis tawj, muaj cov lus hais ua ntej ntawm 250ms ntawm I2C npav mus rau qhov chaw 0x40, Kuv xav tias qhov no yog rau lub ntsuas qhov sib txawv lossis qee yam zoo sib xws, tab sis nws tsis cuam tshuam rau peb.

Cov ntaub ntawv xa mus rau I2C npav hauv ib txwm siv yog hauv qab no, qhov no yuav tsum tau simulated los ntawm peb lub microcontroller los tham nrog lub qhov muag.

Teeb tsa - Cov ntaub ntawv no xa ib zaug, ib ncig 500ms tom qab USB txuas nrog, txhawm rau teeb tsa lub cim xub thawj rau siv.

Tswv Sau: 0x0F (Tswj Sau Npe 1)

Cov ntaub ntawv: 0x02 0b0000 0010 (pib kho dua tshiab)

Tswv Sau: 0x0F (Tswj Sau Npe 1)

Master Nyeem: 0xF1 0b1111 0001 (rov pib dua rau 11110000, lsb 1 qhia tau tias cov ntaub ntawv raug siv tau npaj los nyeem.

Tswv Sau: 0x2E (Tswj Sau Npe 2)

Cov ntaub ntawv: 0x 86 (qhov no tsuas yog teeb tsa kev taw qhia ntawm cov hlau nplaum hauv thawj qhov ntsuas)

Tswv Sau: 0x0F (Tswj Sau Npe 1)

Cov ntaub ntawv: 0x 80 0b1000 0000 (Teeb lub cuab yeej rau hom tsis ua haujlwm (ntsuas nws tus kheej, tsis nyob hauv lub zog qis))

Loop: Qhov no tau rov ua dua ntawm ib puag ncig 100Hz kom tau txais cov ntaub ntawv sensor.

Tswv Sau: 0x10 (X sau npe)

Master Nyeem: (qhev xa X cov ntaub ntawv, 2 qhov ua tiav 8 tus nqi me ntsis)

Tswv Sau: 0x11 (Y sau npe)

Master Nyeem: (qhev xa Y cov ntaub ntawv, 2 qhov ua tiav 8 tus nqi me ntsis)

Ib feem tseem ceeb ntawm cov txheej txheem pov tseg los ntawm kev ntsuas tus lej:

Teeb Sau rau [0x82] + ACK

0x0F + ACK

0x02 + ACK

Teeb Sau rau [0x82] + ACK

0x0F + ACK

Teeb Nyeem rau [0x83] + ACK

0xF1 + NCO

Teeb Sau rau [0x82] + ACK

0x2E + ACK

0x86 + UA

Teeb Sau rau [0x82] + ACK

0x0F + ACK

0x80 + UA

Teeb Sau rau [0x82] + ACK

0x10 + ACK

Teeb Nyeem rau [0x83] + ACK 0xFC + NAK

Teeb Sau rau [0x82] + ACK 0x11 + ACK

Teeb Nyeem rau [0x83] + ACK 0xFF + NAK

Kauj ruam 4: Arduino Code

Arduino Txoj Cai
Arduino Txoj Cai

Cov kab ntawv txuas nrog Arduino tuaj yeem siv los ntsuas lub ntsuas.

Thov nco tseg: Feem ntau Arduino cov laug cam khiav ntawm 5V, qhov no xav tau 3.3V sib xws lossis hloov kho lub rooj tsavxwm kom ua haujlwm kom tsis txhob puas rau koj lub joystick.

Kauj ruam 5: Calibration

Calibration
Calibration

Thaum koj lub sensor tshiab tau teeb tsa, lub qhov muag yuav xav tau ntsuas.

Txhawm rau ntsuas koj lub raj cua koj yuav lub twj tso kua mis ntsuas qhov ntsuas qhov ntsuas. Qhov no tuaj yeem rub tawm los ntawm ntau qhov chaw xws li:

forums.eagle.ru/showthread.php?t=65901

Tsis txhob siv qhov ntsuas qhov rai.

Txhawm rau kom tau txais txiaj ntsig zoo tshaj plaws ntawm qhov kev hloov pauv koj yuav tsum hloov qee qhov txiaj ntsig hauv koj li kev teeb tsa cov ntawv teeb tsa.

Hloov qhov:

Standard_DZ_SX = 0x10;

Standard_DZ_SY = 0x10;

Kab hauv A10_calibration.txt rau:

Standard_DZ_SX = 0x01;

Standard_DZ_SY = 0x01;

Qhov no yuav hloov mus rau thaj tsam tuag ntawm kev tua los ntawm 10 txog 1, thiab muab kev tswj kom zoo dua qub. Koj tuaj yeem ua si nrog qhov teeb tsa no thiab tom qab ntawv rov suav dua thiab pom yam koj nyiam tshaj plaws.

Pom zoo: