Pokaż wiadomości

Ta sekcja pozwala Ci zobaczyć wszystkie wiadomości wysłane przez tego użytkownika. Zwróć uwagę, że możesz widzieć tylko wiadomości wysłane w działach do których masz aktualnie dostęp.


Wiadomości - Touny

Strony: [1]
1
And of course the inverter for the Teloc, wich I thanks so much again for the Collegue! :-)

Can we get more information about that inverter, please? I'm still struggling to get it working properly.

2
Since I'm not good electrician and I didnt want to mess up my arduino with timers and interrupts I gave up on experimenting and searched for ESCs. I've discovered VESC via GreatScott! on Youtube. It is primarly for BLDC motors but in FOC mode it produces sine waves and you can control PMSM (BLAC) motors. Original VESC is quite expensive but since It is fully open source there are cheaper variants - Flipsky FSESC (42€/1150CZK).

I've hooked it up with with 24V power supply - I dont have Hasler but Metra Blansko mechanical speedometer. Except the voltage they are pretty much similar. I've managed to get the motor spin nice and smooth only in setup mode when measuring flux llinkage. When i tried Duty cycle control It just wobbled. I could not experiment more yet because of vacation. Surely will continue later.

I'm very curious how others managed to get their speedometer ticking. Topic for Haslers would be nice.

3
EU07 Simulator English forum / Odp: Maszyna with Arduino
« dnia: 10 Lipca 2020, 00:21:18 »
Problems solved. Thanks a lot!

From this (https://eu07.pl/forum/index.php/topic,13529.msg524782.html#msg524782) there was bit shift already included, I suppose.
bitWrite(doPC[0], 7, !digitalRead(41));         // przycisk CA/SHPto this
bitWrite(doPC[4], 7, digitalRead(41));         // przycisk CA/SHP
And it works!

4
EU07 Simulator English forum / Odp: Maszyna with Arduino
« dnia: 09 Lipca 2020, 21:59:44 »
I knew Problem 1 will take longer! :D
I'm trying other switches (byte, bit combination) still same result.
Although thanks for that! I'm getting into that slowly but surely.

Cytuj
10th bit of the data package
Since byte has 8 bits (0-7). Am I right then, that to send 10th bit, do I need to write it like this?
bitWrite(doPC[1], 2, !digitalRead(33));
Does that mean, that switch group equals byte in brackets? [ ]
If yes, then in Maszyna UART xml doc "Numer bajtu struktury" should work for inputs. But for outputs, column "Nr bajtu transmisji danych" works just fine. (atleast for me) Is this right? I find it rather confusing (maybe because i dont understand Polish much). I was looking into column "Nr B danych" and was confused why 0 was used here. bitWrite(doPC[0], 7, !digitalRead(41));         // przycisk CA/SHP

5
EU07 Simulator English forum / Maszyna with Arduino
« dnia: 09 Lipca 2020, 20:35:22 »
Greetings everyone. I'm missing english version of topics "Nastawnik/Pulpit do komputera" and "MaSzyna z portem COM" so i decided to create this topic.
---------------------

My question:

I've managed to get communication to work thanks to this: https://eu07.pl/forum/index.php/topic,13529.msg529872.html#msg529872
My RX and TX LEDs are blinking, output from Maszyna - CA/SHP LED works fine. However, I can't get any input to Maszyna. For input I tried this: https://eu07.pl/forum/index.php/topic,13529.msg524782.html#msg524782 so then the whole code in Arduino looks like this:

volatile uint8_t zPC[52] = {0}; // standardowe bajty przekazywane do kodu Arduino
volatile uint8_t doPC[20] = {0xEF, 0xEF, 0xEF, 0xEF, 0}; // standardowe bajty przyjmowane z kodu Arduino

void setup()
{
pinMode(48, OUTPUT); //ustawienie pinu 48 (wbudowana w Arduino dioda LED) jako wyjście cyfrowe
digitalWrite(48, LOW); //ustawienie stanu niskiego na pinie 48

pinMode(33, INPUT_PULLUP);

Serial.begin(115200); //nawiązanie komunikacji z prędkością 115200b/s
Serial.setTimeout(10);
while(!Serial){}; //czekanie do nawiązania komunikacji z komputerem
}

void loop()
{

digitalWrite(48, (bitRead(zPC[8], 7))); // lampka CA/SHP
bitWrite(doPC[0], 7, !digitalRead(33)); // przycisk CA/SHP

while (!Serial.available()) {};
Serial.readBytes((char*)zPC, 52);
Serial.write((char*)doPC, 20);

}

Problem 1: When I press the button (33), RX and TX LEDs stop blinking and Arduino does not respond until simulator restart. (CA/SHP LED keeps turned on, etc.)

Problem 2: Also I'm very confused by the bytes and bits layouts. Understanding output layout was easy with this (UART xml): https://eu07.pl/forum/index.php/topic,28460.msg430131.html#msg430131 but I cant understand the input - combination of switch group, bytes and bits exceeding number 7 in input-uart.ini. Solving problem 1 will surely help solving problem 2 by trial and error.

Strony: [1]