Open Source Joystick FFB / DIY FFB Joystick - Page 17 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 09-17-2017, 04:47 PM   #161
avidflyer
Junior Member
 
avidflyer's Avatar
 
Join Date: Apr 2014
Posts: 41
Reputation power: 4
avidflyer is on a distinguished road
Default FFB with sidewinder 2

Hello,

Regarding Sokols post the guy who have made the Yoke work on a stick solution. He is looking for a programmer who helps him to create a software provide options for the forces. He had established a homepage.

Regards Christian

http://vrflightsim.forumotion.com/
https://vrflightsim.wixsite.com/mysite/in-progress

Last edited by avidflyer; 09-17-2017 at 04:50 PM.
avidflyer is offline   Reply With Quote
Old 09-24-2017, 04:37 PM   #162
crow0827
Junior Member
 
Join Date: Jul 2016
Location: Japan
Posts: 46
Reputation power: 2
crow0827 is on a distinguished road
Default

good evening!
I'm programing sensor part with MLX90333 for my FFB.
Has anyone done programing Arduino Micro & MLX90333?
MLX90333 communicate through SPI Communication function with Arduino.
it is hard about SPI TIMING…
Please teach me how can I get data from the IC.

from Datasheet(https://www.melexis.com/en/documents...sheet-mlx90333)
MLX90333 SPI COMM procedure is blow
1. Chip Select Pin - LOW
2. Start Byte Read - Read must be 0xFF
3. Axis X Data Read - 16bit angular
4. Axis Y Data Read - 16bit angular
5. Error Data Read - 16bit Error Code
6. SUM Read
7. Chip Select Pin - HIGH

I want to know if it needs delayMicroseconds() between each steps.
My code was already coded delay (). but any data doesn't appear.
if I delete delay() from code, maybe angular was outputted at Error Code timing(but it is "broken data") .
other data looks like random.

I think that this is problem of timing.

Does anyone know how to solve this problem?
please contact me.

thanks
crow0827 is online now   Reply With Quote
Old 09-24-2017, 05:46 PM   #163
MetalGear_Honk
Junior Member
 
MetalGear_Honk's Avatar
 
Join Date: Nov 2015
Posts: 63
Reputation power: 2
MetalGear_Honk is on a distinguished road
Default

Hi
I am mostly guessing. as we didn't get all needed infos.

if you use the Arduino IDE than you should use the Library for the SPI.
if you are using any other IDE please read the SPI Specification again.

there is no Delay needed as it is carried with the CLK line. that will make your timings.
other than that we would need to see your code to get a better understanding what is not working properly.


MetalGear_Honk
MetalGear_Honk is offline   Reply With Quote
Old 09-24-2017, 10:57 PM   #164
Sokol1_br
Senior Member
 
Sokol1_br's Avatar
 
Join Date: Apr 2007
Posts: 2,499
Reputation power: 26
Sokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of lightSokol1_br is a glorious beacon of light
Send a message via MSN to Sokol1_br
Default

A guy there is experimenting with MLX90333 - this and next post.

http://simhq.com/forum/ubbthreads.ph...er#Post4371390
Sokol1_br is offline   Reply With Quote
Old 09-25-2017, 12:11 AM   #165
crow0827
Junior Member
 
Join Date: Jul 2016
Location: Japan
Posts: 46
Reputation power: 2
crow0827 is on a distinguished road
Default

thanks metalgear, Sokol!
but it is MLX90333 with analog output.
I'm using MLX90333 with SPI output.
IDE is Arduino IDE.

deleted source code, because post becomes too long.

Last edited by crow0827; 09-26-2017 at 05:21 PM.
crow0827 is online now   Reply With Quote
Old 09-25-2017, 08:53 AM   #166
MetalGear_Honk
Junior Member
 
MetalGear_Honk's Avatar
 
Join Date: Nov 2015
Posts: 63
Reputation power: 2
MetalGear_Honk is on a distinguished road
Default

Ok
I haven't studied the full Datasheet for your MLX90333.
But you need to set _SS one time to high to begin with.
And the line
Datasheet Page 36:
To
synchronize communication, the Masterdeactivates /SS high for at least t5 (1.5 ms)

"SPI.beginTransaction(settingMLX);"
Needs to go in the Setup.


Next Point is where/how have you connected the Clock line (CLK)?
What is the Value of this "SPI_CLOCK_DIV128" ?
Couldn’t find the declaration.


The Delays are not necessary as they areafter a Data Package was send.
The Timings refer to the Clock Timings.


I haven't looked up your Transfair Values but it is suspicios that X value and Y Values would have the same comand line.


MetalGear_Honk
MetalGear_Honk is offline   Reply With Quote
Old 09-25-2017, 11:14 AM   #167
crow0827
Junior Member
 
Join Date: Jul 2016
Location: Japan
Posts: 46
Reputation power: 2
crow0827 is on a distinguished road
Default

Set SS pin, HIGH in setup() - DONE
SPI.beginTransaction(settingMLX); is changed position to setup() - DONE
Remove delays - DONE

SPI_CLOCK_DIV128 = 0x03 is defined by SPI.h.
It is my coding miss. CORRECTED
0x03 is too low Freq, so it makes Freq 125[kHz].
Because I wanted to set Freq 125[kHz], it is same behavior.

I have connected CLK LINE as same as Datasheet Figure21, Page40.
Arduino Micro SCK Pin → R4 100[Ω] → MLX90333 SCLK Pin & R5 20[kΩ] → R5 connect to GND

"I haven't looked up your Transfair Values but it is suspicios that X value and Y Values would have the same comand line."
Are you talking about the value in SPI.transfer(value)?
I understood that MLX90333 only works as output.
and couldn't find any command to send.
So, I set the value to 0xff by referring to the Datasheet Figure17, page37.

thank you for advise, metalgear

P.S.
deleted source code, because post becomes too long.
I have solved this problem.
If anyone needs source code, please contact me.
I will correct error between wanted axis data and input data.
After of correction, I'll post or upload source code again.
Good Day!

Last edited by crow0827; 09-25-2017 at 04:21 PM.
crow0827 is online now   Reply With Quote
Old 09-26-2017, 05:09 PM   #168
crow0827
Junior Member
 
Join Date: Jul 2016
Location: Japan
Posts: 46
Reputation power: 2
crow0827 is on a distinguished road
Default

I have adjusted input data.
Please watch this video.



There is room for improvement.
But I was satisfied for first success.
After hardware design, I will set sensor dead zone.
This time, it has vibration of value ±0.5°(if my calculation is correct).
I believe that the cause is holding a magnet with hand .
If magnetic noise of Motor is low, It will be good solution for this project!

Until today, I had never thought of flying an airplane with a magnet instead of a flight stick! lol.

Thanks for reading and watching video.
Good Day!

Last edited by crow0827; 09-26-2017 at 05:18 PM.
crow0827 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:13 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.