Page 5 of 5 FirstFirst 12345
Results 101 to 120 of 120
  1. #101
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    With information above I've succesfully finished my first trip yesterday without any errors and in fact without ABS, DPS and with my own LCD in cluster -> no limp mode off course .

    Without nanny this is a drift beast. TBH it's better for drifting than normal riding. For uneven roads it's constantly a bit wobbly with passanger present. For drifting it's pure fun.

    So, let's start technical.

    After removing motor from DPS to remove any resistance in steering system I've had to pretend there is working DPS by constantly putting message 0x330 with data 0x00, 0x99, 0x99, 0x00, 0xFF, 0xFF, 0x00, 0x00 to can bus and it works. No DPS and no errors

    Because ABS was also partly fauly (all can bus data correct but going into error above 10km/h), I've had to remove any traces of errors going from ABS. To do that ABS in on separate CAN bus and messages are forwarded to main bus but with removed errors. This also is succesfull.

    Unfortunately after key is turned there is a delay between ABS working and my program which causes errors in ECM. To clear errors I'm sending diagnostic messages after 5s from when key is turned:

    msg_error_clear[0].id = 0x713;
    msg_error_clear[1].id = 0x71C;
    msg_error_clear[2].id = 0x710;
    msg_error_clear[3].id = 0x715;
    msg_error_clear[4].id = 0x717;
    msg_error_clear[5].id = 0x715;
    msg_error_clear[6].id = 0x715;

    uint8_t tmp_buf_0[8] = { 0x04, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_1[8] = { 0x0D, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_2[8] = { 0x01, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_3[8] = { 0x06, 0x03, 0x14, 0xFF, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_4[8] = { 0x06, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_5[8] = { 0x06, 0x02, 0x10, 0x89, 0x00, 0x00, 0x00, 0x00 };
    uint8_t tmp_buf_6[8] = { 0x06, 0x02, 0x10, 0x81, 0x00, 0x00, 0x00, 0x00 };

    There is also a matter of menu button which must be pressed before every ride. I'm sending 0x519 together with 0x402:

    0x591: 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    0x402: { /* three types of data */
    { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
    { 0x03, 0x21, 0x13, 0x61, 0x20, 0x11, 0x09, 0x00 },
    { 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00 }
    }

    Below is the code for can bus commmunication which sends, changes and retrieves data to/from can bus:

    Code:
    #pragma once
    
    #include <FlexCAN_T4.h>
    #include <globalVar.h>
    
    extern void can_changer_modify(CAN_message_t &msg);
    
    FlexCAN_T4<CAN1, RX_SIZE_1024, TX_SIZE_32> can1; // internal
    FlexCAN_T4<CAN2, RX_SIZE_1024, TX_SIZE_32> can2; // external
    
    CAN_message_t msg1;
    bool hasMsg1;
    
    CAN_message_t msg2;
    bool hasMsg2;
    
    #define msg_changer_id 0xAA
    CAN_message_t msg_changer0; // b0 - 0/1/2 no action/change/new,  b1 b2 - message id, b3 len, b4 type - 0/1/2/3 set exactly/set/reset/toggle
    CAN_message_t msg_changer1; // b0-b7 - toggle
    CAN_message_t msg_changer_new;
    
    uint16_t ready_delay_ms = 5000; // delay for isok message and error cleaning
    
    CAN_message_t msg_dps;
    CAN_message_t msg_lcd[3];
    uint8_t msg_lcd_cnt;
    CAN_message_t msg_isok;
    CAN_message_t msg_error_clear[7];
    uint8_t msg_error_clear_repeat_cntdn = 2;
    uint8_t msg_error_clear_cnt;
    
    uint8_t btn_buf_prev;
    
    void can_setup()
    {
        can1.begin();
        can1.setBaudRate(500000);
    
        can2.begin();
        can2.setBaudRate(500000);
    }
    
    void can_calcCrc8(CAN_message_t &msg)
    {
        switch (msg.len)
        {
            case 8: msg.buf[7] = msg.buf[0] ^ msg.buf[1] ^ msg.buf[2] ^ msg.buf[3] ^ msg.buf[4] ^ msg.buf[5] ^ msg.buf[6]; break;
            case 7: msg.buf[6] = msg.buf[0] ^ msg.buf[1] ^ msg.buf[2] ^ msg.buf[3] ^ msg.buf[4] ^ msg.buf[5]; break;
            case 6: msg.buf[5] = msg.buf[0] ^ msg.buf[1] ^ msg.buf[2] ^ msg.buf[3] ^ msg.buf[4]; break;
            case 5: msg.buf[4] = msg.buf[0] ^ msg.buf[1] ^ msg.buf[2] ^ msg.buf[3]; break;
            case 4: msg.buf[3] = msg.buf[0] ^ msg.buf[1] ^ msg.buf[2]; break;
        }
    }
    
    void can_incCounter0F(CAN_message_t &msg)
    {
        // assumption that if counter exists, it is before last byte
        msg.buf[msg.len - 2]++;
        if (msg.buf[msg.len - 2] == 0x10)
            msg.buf[msg.len - 2] = 0x00;
    }
    
    void can_changer_modify(CAN_message_t &msg)
    {
        if (msg_changer0.buf[3] > 8)
            msg.len = msg_changer0.buf[3] & 0xFF;
        else
            msg.len = 8; // default to 8
    
        if (msg_changer0.buf[4] == 0)
        {
            msg.buf[0] = msg_changer1.buf[0];
            msg.buf[1] = msg_changer1.buf[1];
            msg.buf[2] = msg_changer1.buf[2];
            msg.buf[3] = msg_changer1.buf[3];
            msg.buf[4] = msg_changer1.buf[4];
            msg.buf[5] = msg_changer1.buf[5];
            msg.buf[6] = msg_changer1.buf[6];
            msg.buf[7] = msg_changer1.buf[7];
        }
        else if (msg_changer0.buf[4] == 1)
        {
            msg.buf[0] |= msg_changer1.buf[0];
            msg.buf[1] |= msg_changer1.buf[1];
            msg.buf[2] |= msg_changer1.buf[2];
            msg.buf[3] |= msg_changer1.buf[3];
            msg.buf[4] |= msg_changer1.buf[4];
            msg.buf[5] |= msg_changer1.buf[5];
            msg.buf[6] |= msg_changer1.buf[6];
            msg.buf[7] |= msg_changer1.buf[7];
        }
        else if (msg_changer0.buf[4] == 2)
        {
            msg.buf[0] &= ~msg_changer1.buf[0];
            msg.buf[1] &= ~msg_changer1.buf[1];
            msg.buf[2] &= ~msg_changer1.buf[2];
            msg.buf[3] &= ~msg_changer1.buf[3];
            msg.buf[4] &= ~msg_changer1.buf[4];
            msg.buf[5] &= ~msg_changer1.buf[5];
            msg.buf[6] &= ~msg_changer1.buf[6];
            msg.buf[7] &= ~msg_changer1.buf[7];
        }
        else if (msg_changer0.buf[4] == 3)
        {
            msg.buf[0] ^= msg_changer1.buf[0];
            msg.buf[1] ^= msg_changer1.buf[1];
            msg.buf[2] ^= msg_changer1.buf[2];
            msg.buf[3] ^= msg_changer1.buf[3];
            msg.buf[4] ^= msg_changer1.buf[4];
            msg.buf[5] ^= msg_changer1.buf[5];
            msg.buf[6] ^= msg_changer1.buf[6];
            msg.buf[7] ^= msg_changer1.buf[7];
        }
    }
    
    /*void can_testchange_401(CAN_message_t &msg)
    {
        switch (msg.buf[0])
        {
            case 1:
                msg.buf[1] = 0;
                msg.buf[2] = 3;
                msg.buf[3] = 0xe7;
                msg.buf[4] = 0;
                msg.buf[5] = 0;
                msg.buf[6] = 0;
                msg.buf[7] = 0;
                break;
            case 3:
                msg.buf[1] = 0;
                msg.buf[2] = 0;
                msg.buf[3] = 6;
                msg.buf[4] = 149;
                msg.buf[5] = 13;
                msg.buf[6] = 107;
                msg.buf[7] = 0;
                break;
            case 4:
                msg.buf[1] = 0;
                msg.buf[2] = 0;
                msg.buf[3] = 6;
                msg.buf[4] = 204;
                msg.buf[5] = 19;
                msg.buf[6] = 170;
                msg.buf[7] = 0;
                break;
        }
    
    }*/
    
    void can_send_changer_new()
    {
        msg_changer_new.id = msg_changer0.buf[2];
        msg_changer_new.id = msg_changer_new.id << 8;
        msg_changer_new.id += msg_changer0.buf[1];
        can_changer_modify(msg_changer_new);
    
        can1.write(msg_changer_new);
    }
    
    void can_save_msg_keys(CAN_message_t &msg)
    {
        if (btn_buf_prev == msg.buf[1])
            return;
    
        // store bits changed to 1
        uint8_t tmp = (btn_buf_prev ^ msg.buf[1]) & msg.buf[1];
    
        if (tmp & 0x1)
            key_up = true;
        if (tmp & 0x2)
            key_down = true;
        if (tmp & 0x4)
            key_left = true;
        if (tmp & 0x8)
            key_right = true;
        if (tmp & 0x10)
            key_menu = true;
        if (tmp & 0x20)
            key_set = true;
        if (tmp & 0x40)
            key_back = true;
    
        btn_buf_prev = msg.buf[1];
    }
    
    void can_save_data_cluster_401(CAN_message_t &msg)
    {
        /*                Serial.println(
                    String(msg.buf[1]).append( " ")
                    .append(msg.buf[2]).append(" ")
                    .append(msg.buf[3]).append(" ")
                    .append(msg.buf[4]).append(" ")
                    .append(msg.buf[5]).append(" ")
                    .append(msg.buf[6]).append(" ")
                    .append(msg.buf[7]).append(" "));
        */
        switch (msg.buf[0])
        {
            case 0: 
                break;
            case 1: 
                break;
            case 2: 
                can_triptotal = ((uint32_t)msg.buf[1] << 24) + ((uint32_t)msg.buf[2] << 16) + ((uint32_t)msg.buf[3] << 8) + msg.buf[4];
                break;
            case 3: 
                can_tripa = ((uint32_t)msg.buf[1] << 24) + ((uint32_t)msg.buf[2] << 16) + ((uint32_t)msg.buf[3] << 8) + msg.buf[4];
                break;
            case 4: 
                can_tripb = ((uint32_t)msg.buf[1] << 24) + ((uint32_t)msg.buf[2] << 16) + ((uint32_t)msg.buf[3] << 8) + msg.buf[4];
                break;
            case 5: 
                break;
            case 6: 
                can_acslevel = B1000 - ((msg.buf[2] & B1110) >> 1);
                can_acsheight = ((uint16_t)msg.buf[3] << 8) + msg.buf[4];
                break;
        }
    }
    
    void can_save_data(CAN_message_t &msg)
    {
        switch (msg.id)
        {
            case 0x102:
                can_tempengine = msg.buf[3];
                can_tempair = msg.buf[4];
                break;
    
            case 0x308:
                // B0: bity: low bat, -, -, -, engine hi temp, -, oil switch
                can_islowbat = msg.buf[0] & 1;
                can_i****emp = msg.buf[0] >> 4 & 1;
                can_isoilswitch = msg.buf[0] >> 6 & 1;
                break;
    
            case 0x310:
                can_gearbyte = msg.buf[0] & 0xF; // b0: bieg 1-6, 7 neutral, 8 reverse
                break;
    
            case 0x430:
                can_abspressure = msg.buf[4]; // stosunek 1:33 kpa, 0x3E == 0, 0xFF == 6369 kPa
                break;
        }
    }
    
    void can_send_dps()
    {
        // initialize dps message
        if (msg_dps.id == 0)
        {
            msg_dps.id = 0x330;
            uint8_t tmp_buf[8] = { 0x00, 0x99, 0x99, 0x00, 0xFF, 0xFF, 0x00, 0x00 };
            memcpy(msg_dps.buf, tmp_buf, 8);
        }
    
        // send dps data to both buses
        can1.write(msg_dps);
        can2.write(msg_dps);
    
        // set new values for counter and crc8 bytes
        can_incCounter0F(msg_dps);
        msg_dps.buf[7] = msg_dps.buf[6]; // copy counter to crc because crc in this case is the same as counter
    }
    
    void can_send_lcd()
    {
        // initialize lcd message
        if (msg_lcd[0].id == 0)
        {
            msg_lcd[0].id = 0x402;
            msg_lcd[1].id = 0x402;
            msg_lcd[2].id = 0x402;
    
            uint8_t tmp_buf[3][8] = { 
                { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
                { 0x03, 0x21, 0x13, 0x61, 0x20, 0x11, 0x09, 0x00 },
                { 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00 } };
            
            memcpy(msg_lcd[0].buf, tmp_buf[0], 8);
            memcpy(msg_lcd[1].buf, tmp_buf[1], 8);
            memcpy(msg_lcd[2].buf, tmp_buf[2], 8);
        }
    
        if (msg_lcd_cnt == 11)
            can1.write(msg_lcd[2]);
        else if (msg_lcd_cnt == 10)
            can1.write(msg_lcd[1]);
        else
            can1.write(msg_lcd[0]);
    
        msg_lcd_cnt++;
        if (msg_lcd_cnt == 12)
            msg_lcd_cnt = 0;
    }
    
    void can_send_isok()
    {
        // initialize lcd message
        if (msg_isok.id == 0)
        {
            msg_isok.id = 0x591;
            msg_isok.len = 1;
            uint8_t tmp_buf[8] = { 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
            memcpy(msg_isok.buf, tmp_buf, 8);
        }
    
        can1.write(msg_isok);
    }
    
    void can_send_error_clear()
    {
        // initialize lcd message
        if (msg_error_clear[0].id == 0)
        {
            msg_error_clear[0].id = 0x713;
            msg_error_clear[1].id = 0x71C;
            msg_error_clear[2].id = 0x710;
            msg_error_clear[3].id = 0x715;
            msg_error_clear[4].id = 0x717;
            msg_error_clear[5].id = 0x715;
            msg_error_clear[6].id = 0x715;
    
            uint8_t tmp_buf_0[8] = { 0x04, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_1[8] = { 0x0D, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_2[8] = { 0x01, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_3[8] = { 0x06, 0x03, 0x14, 0xFF, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_4[8] = { 0x06, 0x03, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_5[8] = { 0x06, 0x02, 0x10, 0x89, 0x00, 0x00, 0x00, 0x00 };
            uint8_t tmp_buf_6[8] = { 0x06, 0x02, 0x10, 0x81, 0x00, 0x00, 0x00, 0x00 };
    
            memcpy(msg_error_clear[0].buf, tmp_buf_0, 8);
            memcpy(msg_error_clear[1].buf, tmp_buf_1, 8);
            memcpy(msg_error_clear[2].buf, tmp_buf_2, 8);
            memcpy(msg_error_clear[3].buf, tmp_buf_3, 8);
            memcpy(msg_error_clear[4].buf, tmp_buf_4, 8);
            memcpy(msg_error_clear[5].buf, tmp_buf_5, 8);
            memcpy(msg_error_clear[6].buf, tmp_buf_6, 8);
        }
    
        can1.write(msg_error_clear[msg_error_clear_cnt]);
    
        can2.write(msg_error_clear[msg_error_clear_cnt]);
    
        msg_error_clear_cnt++;
        if (msg_error_clear_cnt == 7)
        {
            msg_error_clear_repeat_cntdn--;
            msg_error_clear_cnt = 0;
        }
    }
    
    void can_handle_msg_post(CAN_message_t &msg)
    {
        switch (msg.id)
        {
            // store message changer data
            case (msg_changer_id+0): msg_changer0 = msg; break;
            case (msg_changer_id+1): msg_changer1 = msg; break;
    
            //case 0x401: can_testchange_401(msg); break;
    
            case 0x102: can_save_data(msg); break;
            case 0x308: can_save_data(msg); break;
            case 0x310: can_save_data(msg); break;
            case 0x401: can_save_data_cluster_401(msg); break;
            case 0x340: can_save_msg_keys(msg); break;
    
            case 0x430: // remove error from vcm message
                can_save_data(msg); break;
                break;
        }
    }
    
    void can_handle_msg_pre(CAN_message_t &msg)
    {
        switch (msg.id)
        {
            case 0x020: // remove error from vcm message
                msg.buf[0] = msg.buf[0] & 0xF0;
                msg.buf[1] = 0x00;
                can_calcCrc8(msg);
                break;
            case 0x430: // remove error from vcm message
                msg.buf[0] = msg.buf[1] = 0x99;
                can_calcCrc8(msg);
                break;
        }
    
        // change message
        if (msg_changer0.buf[0] == 1)
        {
            // match id
            if ((msg.id & 0xFF) == msg_changer0.buf[1] && ((msg.id >> 8) & 0xFF) == msg_changer0.buf[2])
                can_changer_modify(msg);
        }
    }
    
    void can_handle()
    {
        // send custom messages with minimum 1ms offset
        if (event1ms && timer1msCounterStored > 10) // skip first few ms because of -n in checks
        {
            if (ready_delay_ms > 0)
                ready_delay_ms--;
    
            // send dps every 34ms
            if (!((timer1msCounterStored -0) & (0x20-1)))
                can_send_dps();
    
            // send lcd every 128ms
            if (!((timer1msCounterStored -1) & (0x80-1)))
                can_send_lcd();
    
            // send isok every 128ms
            // start sending after moto is ready
            if (ready_delay_ms == 0 && !((timer1msCounterStored -2) & (0x80-1)))
                can_send_isok();
    
            // send error clear every 128ms
            // start sending after moto is ready
            // send only once
            if (ready_delay_ms == 0 && msg_error_clear_repeat_cntdn > 0 && !((timer1msCounterStored -2) & (0x80-1)))
                can_send_error_clear();
    
            // send test message every 128ms
            if (!((timer1msCounterStored -4) & (0x80-1)))
            {
                // new test message
                if (msg_changer0.buf[0] == 2)
                    can_send_changer_new();
            }
        }
    
        // read messages
        hasMsg1 = can1.read(msg1);
        hasMsg2 = can2.read(msg2);
    
        // don't change message going from ecu to external bus
        if (hasMsg1)
        {
            if (msg1.id < 0x700) // skip diagnostic messages
                can_handle_msg_pre(msg1);
    
            can2.write(msg1);
    
            if (msg1.id < 0x700) // skip diagnostic messages
                can_handle_msg_post(msg1);
        }
    
        if (hasMsg2)
        {
            if (msg2.id < 0x700) // skip diagnostic messages
                can_handle_msg_pre(msg2);
    
            can1.write(msg2);
    
            if (msg2.id < 0x700) // skip diagnostic messages
                can_handle_msg_post(msg2);
        }
    }
    Below is code responsible for lcd screen with LVGL library:

    Code:
    #pragma once
    
    #include <lvgl.h>
    #include <types.h>
    #include <globalVar.h>
    #include <gui.h>
    
    
    
    class scr_main : public screen_base
    {
        // styles
        lv_style_t box_style_box;
        lv_style_t box_style_box_checked;
        lv_style_t bar_style_temp;
    
        // controls
        lv_obj_t*  rol_gearpos;
        lv_obj_t*  lbl_tempair;
        lv_obj_t*  lbl_tripa;
        lv_obj_t*  lbl_triptotal;
    
        lv_obj_t*  lbl_tempengine;
        lv_obj_t*  bar_tempengine;
        lv_obj_t*  bar_abspressure;
        lv_obj_t*  lbl_acslevel;
        lv_obj_t*  bar_acsheight;
    
        lv_obj_t*  box_islowbat;
        lv_obj_t*  box_i****emp;
        lv_obj_t*  box_isoilswitch;
    
        uint32_t gui_tripa;
        uint32_t gui_triptotal;
        uint16_t gui_tempair;
        uint16_t gui_tempengine;
        uint16_t gui_acslevel;
        uint16_t gui_abspressure;
        uint16_t gui_acsheight;
    
        lv_obj_t* build()
        {
            lv_obj_t* ret = lv_obj_create(NULL);
    
            //lv_obj_set_style_bg_color(ret, lv_palette_lighten(LV_PALETTE_BLUE, 4), LV_PART_MAIN);
    
            lv_obj_set_style_bg_color(ret, lv_color_black(), LV_PART_MAIN);
            lv_obj_set_style_text_color(ret, lv_color_white(), LV_PART_MAIN);
    
            // create styles
            lv_style_init(&box_style_box);
            lv_style_set_border_color(&box_style_box, lv_palette_main(LV_PALETTE_RED));
            lv_style_set_border_width(&box_style_box, 3);
    
            lv_style_init(&box_style_box_checked);
            lv_style_set_border_color(&box_style_box_checked, lv_palette_main(LV_PALETTE_RED));
            lv_style_set_border_width(&box_style_box_checked, 3);
            lv_style_set_bg_color(&box_style_box_checked, lv_palette_main(LV_PALETTE_RED));
    
            lv_style_init(&bar_style_temp);
            lv_style_set_bg_opa(&bar_style_temp, LV_OPA_COVER);
            lv_style_set_bg_color(&bar_style_temp, lv_palette_main(LV_PALETTE_RED));
            lv_style_set_bg_grad_color(&bar_style_temp, lv_palette_main(LV_PALETTE_BLUE));
            lv_style_set_bg_grad_dir(&bar_style_temp, LV_GRAD_DIR_VER);
    
            // lv_style_set_bg_grad_color(&style_btn, lv_palette_main(LV_PALETTE_GREY));
            // lv_style_set_bg_grad_dir(&style_btn, LV_GRAD_DIR_VER);
    
            lv_obj_t * panel;
            lv_obj_t * obj;
    
            // gear pos
            rol_gearpos = lv_roller_create(ret);
            lv_roller_set_options(rol_gearpos, " \n1\n2\n3\n4\n5\n6\nN\nR", LV_ROLLER_MODE_INFINITE);
            lv_roller_set_visible_row_count(rol_gearpos, 5);
            lv_obj_set_width(rol_gearpos, 40);
            lv_obj_set_pos(rol_gearpos, 0, 0);
    
            // air temp
            lbl_tempair = lv_label_create(ret);
            lv_label_set_text(lbl_tempair, "AIR T");
            lv_obj_set_pos(lbl_tempair, 50, 0);
    
            // Trip A
            obj = lv_label_create(ret);
            lv_label_set_text(obj, "Trip");
            lv_obj_set_style_text_font(obj, &lv_font_montserrat_20, LV_PART_MAIN);
            lv_obj_set_pos(obj, 50, 41);
    
            lbl_tripa = lv_label_create(ret);
            // lv_obj_set_style_text_align(lbl_triptotal, LV_TEXT_ALIGN_RIGHT, 0); // crashing
            lv_obj_set_width(lbl_tripa, 120);
            lv_obj_set_pos(lbl_tripa, 110, 40);
    
            // Total
            obj = lv_label_create(ret);
            lv_label_set_text(obj, "Total");
            lv_obj_set_style_text_font(obj, &lv_font_montserrat_20, LV_PART_MAIN);
            lv_obj_set_pos(obj, 50, 81);
    
            lbl_triptotal = lv_label_create(ret);
            //lv_obj_set_style_text_align(lbl_triptotal, LV_TEXT_ALIGN_RIGHT, 0); // crashing
            lv_obj_set_width(lbl_triptotal, 120);
            lv_obj_set_pos(lbl_triptotal, 110, 80);
    
            // right side bars
            // engine temp
            lbl_tempengine = lv_label_create(ret);
            lv_label_set_text(lbl_tempengine, "ENG T");
            lv_obj_set_pos(lbl_tempengine, 215, 0);
    
            bar_tempengine = lv_bar_create(ret);
            lv_obj_add_style(bar_tempengine, &bar_style_temp, LV_PART_INDICATOR);
            lv_obj_set_size(bar_tempengine, 30, 180);
            lv_bar_set_range(bar_tempengine, 40, 130);
            lv_obj_set_pos(bar_tempengine, 235, 30);
    
            // abs pressure
            bar_abspressure = lv_bar_create(ret);
            lv_obj_set_style_bg_color(bar_abspressure, lv_palette_main(LV_PALETTE_RED), LV_PART_INDICATOR);
            lv_obj_set_size(bar_abspressure, 20, 180);
            lv_bar_set_range(bar_abspressure, 0x3e, 0xCA); // 140 * 33 = 4620kPa
            lv_obj_set_pos(bar_abspressure, 270, 30);
    
            // acs level
            lbl_acslevel = lv_label_create(ret);
            lv_label_set_text(lbl_acslevel, "-");
            lv_obj_set_pos(lbl_acslevel, 295, 0);
            
            // acs height
            bar_acsheight = lv_bar_create(ret);
            lv_obj_set_size(bar_acsheight, 20, 180);
            lv_bar_set_range(bar_acsheight, 250, 650);
            lv_obj_set_pos(bar_acsheight, 295, 30);
    
            // checkboxes
            panel = lv_obj_create(ret);
            lv_obj_set_size(panel, 320, 30);
            lv_obj_set_pos(panel, 0, 210);
    
            lv_obj_set_flex_flow(panel, LV_FLEX_FLOW_ROW);
            lv_obj_set_flex_align(panel, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
    
            box_islowbat = lv_checkbox_create(panel);
            lv_checkbox_set_text(box_islowbat, "Bat");
            lv_obj_add_style(box_islowbat, &box_style_box, LV_PART_INDICATOR);
            lv_obj_add_style(box_islowbat, &box_style_box_checked, LV_PART_INDICATOR | LV_STATE_CHECKED);
    
            box_i****emp = lv_checkbox_create(panel);
            lv_checkbox_set_text(box_i****emp, "Temp");
            lv_obj_add_style(box_i****emp, &box_style_box, LV_PART_INDICATOR);
            lv_obj_add_style(box_i****emp, &box_style_box_checked, LV_PART_INDICATOR | LV_STATE_CHECKED);
    
            box_isoilswitch = lv_checkbox_create(panel);
            lv_checkbox_set_text(box_isoilswitch, "Oil");
            lv_obj_add_style(box_isoilswitch, &box_style_box, LV_PART_INDICATOR);
            lv_obj_add_style(box_isoilswitch, &box_style_box_checked, LV_PART_INDICATOR | LV_STATE_CHECKED);
    
            lv_obj_update_layout(box_isoilswitch);
    
            return ret;
        }
    
        void open()
        {
    
        }
    
        void close()
        {
            
        }
    
        // 100us main 
        void event()
        {
            // only one at a time for optimization purposes starting from highest priority
            if (gui_abspressure != can_abspressure)
            {
                gui_abspressure = can_abspressure;
                lv_bar_set_value(bar_abspressure, gui_abspressure, LV_ANIM_OFF);
            }
            else if (gui_acsheight != can_acsheight)
            {
                gui_acsheight = can_acsheight;
                lv_bar_set_value(bar_acsheight, gui_acsheight, LV_ANIM_OFF); 
            }
            else if (gui_tempair != can_tempair)
            {
                gui_tempair = can_tempair;
                int temp = gui_tempair-60;
                lv_label_set_text(lbl_tempair, String((temp)).append("*C").c_str());
            }
            else if (gui_tripa != can_tripa)
            {
                gui_tripa = can_tripa;
                String tripastr = String(gui_tripa >= 10 ? gui_tripa : 10); // co najmniej 100m zeby bylo co wyswietlac
                String tripadec = tripastr.substring(tripastr.length()-2, tripastr.length());
                tripastr.remove(tripastr.length()-2, 2);
                tripastr.append(",").append(tripadec);
                lv_label_set_text(lbl_tripa, tripastr.c_str());
            }
            else if (gui_triptotal != can_triptotal)
            {
                gui_triptotal = can_triptotal;
    
                String triptotalstr = String(gui_triptotal);
                String triptotaldecstr = triptotalstr.substring(triptotalstr.length()-2, triptotalstr.length());
                triptotalstr.remove(triptotalstr.length()-2, 2);
                triptotalstr.append(",").append(triptotaldecstr);
                lv_label_set_text(lbl_triptotal, triptotalstr.c_str());
            }
            else if (gui_tempengine != can_tempengine)
            {
                gui_tempengine = can_tempengine;
                int temp = gui_tempengine-60;
                lv_label_set_text(lbl_tempengine, String((temp)).append("*C").c_str());
                lv_bar_set_value(bar_tempengine, temp, LV_ANIM_OFF);
            }
            else if (gui_acslevel != can_acslevel)
            {
                gui_acslevel = can_acslevel;
                lv_label_set_text(lbl_acslevel, String(gui_acslevel).c_str());
            }
            else
            {
                lv_roller_set_selected(rol_gearpos, (uint16_t)can_gearbyte, LV_ANIM_OFF);
    
                if (can_islowbat) lv_obj_add_state(box_islowbat, LV_STATE_CHECKED);
                else lv_obj_clear_state(box_islowbat, LV_STATE_CHECKED); 
                
                if (can_i****emp) lv_obj_add_state(box_i****emp, LV_STATE_CHECKED);
                else lv_obj_clear_state(box_i****emp, LV_STATE_CHECKED); 
    
                if (can_isoilswitch) lv_obj_add_state(box_isoilswitch, LV_STATE_CHECKED);
                else lv_obj_clear_state(box_isoilswitch, LV_STATE_CHECKED);
            }
        }
    };
    global variables:

    Code:
    // can bus data
    bool can_islowbat, can_i****emp, can_isoilswitch;
    uint16_t can_tempengine, can_tempair;
    uint16_t can_gearbyte;
    uint16_t can_abspressure;
    uint16_t can_acsheight;
    uint16_t can_acslevel;
    uint32_t can_triptotal;
    uint32_t can_tripa;
    uint32_t can_tripb;
    main loop:

    Code:
    void loop()
    {
    
      // critical code 
      can_handle();
    
      // catch volatile timer
      event1ms = timer1msCounterStored != timer1msCounter;
      if (!event1ms)
        return;
    
      // 1ms code
      timer1msCounterStored = timer1msCounter;
      event4ms = !(timer1msCounterStored & 0x3);
      
      // GUI code every 4ms
      if (event4ms)
      {
        gui_update();
      }
    
    }
    gui_update() basically calls event() on current screen.

    I have two screens:
    - main for brake pressure, trip, ACS height, gear position, temp and some other stuff
    - snake game for playing while my wife goes for shopping


    Last edited by megagame; 05-04-2023 at 05:44 AM.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  2. #102
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    Next step is to finish tube subframe to hold both oil and cooler radiator. It's partly finished but still needs some work to do to hold plastic parts and then zinc plating.

    Final thing will be hand brake lever. Braking with feet is so strange. I have another smaller three-wheeler with hand and foot braking and I never use foot because it's too slow and unpredictable for sudden situations and without nanny everything is sudden situation. I still need to get used to driving this vehicle. It is very strange and unstable. Not sure about newer versions, but mine has very long wishbones which is poor design in my opinion, and after reading about struggles of other people with bump steer, I understand why there are so many safety systems present.
    Last edited by Peter Aawen; 05-05-2023 at 12:31 AM. Reason: to; design
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  3. #103
    Very Active Member Mikey's Avatar
    Join Date
    Sep 2017
    Location
    Durham,Maine
    Posts
    3,028
    Spyder Garage
    1

    Default

    Wow, what do you do in your spare time!! My hat comes off to you sir!! This just shows that if there's a will there's a way around things that drive us crazy. Good job!!!
    2012 RTL , Pearl

  4. #104
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    Quote Originally Posted by Mikey View Post
    Wow, what do you do in your spare time!! My hat comes off to you sir!! This just shows that if there's a will there's a way around things that drive us crazy. Good job!!!
    Thanks . I hope this kind of information will help people with their struggle with fixing things, and maybe encourage new to analyze how things work. There is so much electronics everywhere and quite often no way of fixing it - this drives me crazy. So I'm trying to prove to myself, and a bit to others, that things can be fixed and it makes sense to do it.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  5. #105
    Very Active Member
    Join Date
    Jan 2021
    Location
    Descanso, CA
    Posts
    697
    Spyder Garage
    0

    Talking

    megagame -- thank you very much for this information.

    I had searched for CANBUS information but never discovered your project. Thank you for decoding those messages. I never would have decoded the XOR checksum calculation although I'm only receiving messages not transmitting any.

    Here's some message information I've decoded:

    // Can-Am Spyder uses Keyword Protocol 2000 version of CANbus 2.0a
    // CANbus 2.0a is Standard 11-bit Message Identifiers
    // CANbus 2.0b with Extended 29-bit Identifiers was pre-released 18 Apr 2012
    //
    // ECM = 102h 103h 120h 122h 300h 308h 310h [342h] 343h
    // TCM = 220h [221h 222h 223h]
    // VCM = 020h [021h] 230h 430h
    // WPM/EPB = 460h
    // Cluster = 400h [401h 402h]
    // MSL-MSR/SWM = 340

    // Multi-Function Switch (Left) functions via CANBUS [0x340 message identifier]
    // Reverse: Free-Reverse
    // PTT: Free-Push-to-Talk [Byte 2: 40]
    // Shift: Free-UpShift-DownShift
    // Windshield: Free-UpWindShield-DownWindShield
    // RECC: Free-Up-Down-Left-Right
    // Mode: Free-Mode
    // Set: Free-Set
    // Turn: Free-Left-Right-Cancel [Byte 3: 01=LT, 02=RT, 04=CT]
    //
    // Multi-Function Switch (Left) functions via direct wire
    // Horn: Free-Horn
    // Headlight: Low-High-Pass
    //
    // Multi-Function Switch (Right) functions via MSL via CANBUS
    // Cruise: Off-On-Set-Resume
    //
    // Multi-Function Switch (Right) functions via direct wire
    // Start: Free-Start
    // Run: Stop-Run
    // Hazard: Free-Hazard

    I'm using an Arduino Uno with KS0411 CANBUS Shield. The GitHub CANBUS library was kinda old and patched together so rewrote most of it. I had to learn another language (C++). I'm only using round-robin scheduling -- no events whatsoever. The Duo is a bit cramped for memory but then I'm not using much either.

    To capture the CANBUS messages I used a reader ("sniffer") but it's filter function doesn't work so I'm overwhelmed in messages and picking out the ones of interest is difficult. So again thank you for sharing your decoding work.

    I have two other projects keeping me from completing this project and will create a new topic when I get a chance to finish it.

    PS I have a black cat too.
    Felix on Rosso Grosso.jpg
    Last edited by BertRemington; 05-04-2023 at 11:54 AM. Reason: removed my note to Idaho
    2014 Can-Am Spyder RT-S SE6 Freeway Commuter Pod
    2016 Royal Enfield Classic 500 Fair-Weather Mountain Bike

  6. #106
    Very Active Member
    Join Date
    Jan 2021
    Location
    Descanso, CA
    Posts
    697
    Spyder Garage
    0

    Exclamation CANBUS messages as Word .doc

    I reformatted megagame's CANBUS message decoding HTML table as Word table.

    Thanks again megagame for this valuable information. You're my inspiration to get back to work on my Spyder CANBUS project!
    Attached Files Attached Files
    2014 Can-Am Spyder RT-S SE6 Freeway Commuter Pod
    2016 Royal Enfield Classic 500 Fair-Weather Mountain Bike

  7. #107
    Very Active Member
    Join Date
    Jan 2021
    Location
    Descanso, CA
    Posts
    697
    Spyder Garage
    0

    Default

    megagame -- concur with "long wishbones" leading to steering issues. Rubber bushings contribute. I'm thinking of asking a friend to mill some Delrin bushings. I've identified the material but haven't pushed the Buy button yet.
    2014 Can-Am Spyder RT-S SE6 Freeway Commuter Pod
    2016 Royal Enfield Classic 500 Fair-Weather Mountain Bike

  8. #108
    Very Active Member
    Join Date
    Jan 2021
    Location
    Descanso, CA
    Posts
    697
    Spyder Garage
    0

    Default

    What I see is that within timespan of 12s steering is moved to right, left, right left and so on.
    Data which looks like torque (0x150) changes in first 4s and later is mostly the same.
    There is one bit in 0x150 which changes after 0,5s when steering is sensed, and after 2s it is back to old state.
    megagame, Idaho -- I'm thinking the Cluster uses this information, along with road speed, to determine turn signal cancellation. Having the DPS monitor and perform steering angle movement greatly simplifies Cluster programming requirements. Having tried to replicate the Spyder's turn signal cancellation, this 150h message is a tremendous simplification.

    I'm checking to see if my CANBUS sniffer software has been updated to provide filtering...
    2014 Can-Am Spyder RT-S SE6 Freeway Commuter Pod
    2016 Royal Enfield Classic 500 Fair-Weather Mountain Bike

  9. #109
    Very Active Member safecracker's Avatar
    Join Date
    Sep 2012
    Location
    Stetson, Maine
    Posts
    1,444
    Spyder Garage
    0

    Default

    WOW, what a great job you are doing. Bruce
    RTS 2011 SM5, 95,000 miles


  10. #110
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    Quote Originally Posted by BertRemington View Post
    I reformatted megagame's CANBUS message decoding HTML table as Word table.

    Thanks again megagame for this valuable information. You're my inspiration to get back to work on my Spyder CANBUS project!
    Seeing how this could help someone makes me very happpy . If you have any questions feel free to ask.

    I'm not C++ programmer either . Normally I work on Microsoft erp software - something completely different than microcontrollers, and there is working debugger there. With arduino/teensy it's hard and slow process but once it works, it works forever.
    My personal choice was teensy because of speed. With so many messages it's already almost at it's limit when you need to do some small additional stuff and TX. RX only should be fine though with arduino. The problem with TX is that delay of 1ms will in some cases be too much and ECM will show error with missing device.
    But again, RX only and arduino should be fine.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  11. #111
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    Quote Originally Posted by BertRemington View Post
    megagame -- concur with "long wishbones" leading to steering issues. Rubber bushings contribute. I'm thinking of asking a friend to mill some Delrin bushings. I've identified the material but haven't pushed the Buy button yet.

    If Delrin is POM than it's a very good material, way better than PA. There are some variations of POM, some with better greasing capabilities, but overall, it's very good. Very nice to work with (lathe/milling machine) and very tough. Looking at shore parameters it's similar to harder polyurethane bushings (90 shore) so it should be fine. Also, wishbones are made of steel tubes on Spyder so the whole suspension has some elasticity if bushings were to be too hard.
    Last edited by Peter Aawen; 05-05-2023 at 04:20 AM. Reason: syder - Spyder ;-)
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  12. #112
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    Quote Originally Posted by BertRemington View Post
    megagame, Idaho -- I'm thinking the Cluster uses this information, along with road speed, to determine turn signal cancellation. Having the DPS monitor and perform steering angle movement greatly simplifies Cluster programming requirements. Having tried to replicate the Spyder's turn signal cancellation, this 150h message is a tremendous simplification.

    I'm checking to see if my CANBUS sniffer software has been updated to provide filtering...
    Don't forget there is separate sensor for turn angle below DPS - its message id is 0x0C3. I would assume this is used to sense when steering is straight again.
    You could always disconnect DPS for a moment and check if cancellation still happpens. Unfortunately I will be away for a week because of vacation so I'm not able to check how it works on mine without DPS.
    Last edited by megagame; 05-05-2023 at 08:58 AM.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  13. #113
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    After couple of rides, I've decided to stiffen the front end a little bit. Fox suspension is great, and I wouldn't like to change how it behaves on uneven roads, but there is too much swinging from left to right during normal riding, and especially on long turns. My wife hates it when the Spyder leans so much on turns.

    I've decided to buy a BajaRon Sway Bar, but first I would like to try doing my own. I've bought 42CrMo4 (4140) bar with min. 31HRC. It's already in +QT state so it should be fine as a sway bar with limited movement. It's not spring steel, but it is used in sports where a sway bar has limited movement compared to the OEM. I will probably do some stress tests to check how far it can go without doing permanent damage.

    I will bend it cold, no welding of course. If that will still be too stiff, the center part will be brought down to a lower diameter with carbide tools on a lathe. 4140 is quite cheap ($10USD for a 1m length of 14mm bar) so testing it will not harm my budget.
    Last edited by Peter Aawen; 05-18-2023 at 09:24 AM. Reason: litle; off; caps; & ' 's ;-)
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  14. #114
    Very Active Member KX5062's Avatar
    Join Date
    Aug 2012
    Location
    Central Coast, CA
    Posts
    1,276
    Spyder Garage
    0

    Default

    Amazing work! Keep us all in the loop as you progress.
    2020 RTL SE6

    Previously 2008 GS SM5 and 2014 RT SE6






  15. #115
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    I've made some tests on a standard sway bar. I've checked how much it rotates on its own axis when 10kg is applied at the end. Red square indicates the part which is held by the vice. Green indicates steel plates which are holding the sway bar where the blue lines are. Thicker green line indicates the steel bar which is going under the sway bar and acts as a lever. With that sway bar, it is rotating without any movements away from its axis. When 10kg is applied 50cm from the center of the sway bar, it rotates such that the end of the plate is lowered by 6.5cm. This kind of test is not perfect because not only the sway bar is bending, but the green plate as well. It's not a problem though, because the same test with the same plate will be performed on the new sway bar, thus the error will be the same on both of them and I'm interested in the difference in bending. Based on test 2, I'm expecting around 4cm rotation with the new bar - but we will see .

    I've made an additional test (test 2) to measure how much both bars bend when the force is applied perpendicular to the bar, just to compare later if the bending difference is the same on both tests. The new bar is 14mm in diameter, the old is 13.5mm (it is a tube not a bar/rod). If the same difference is visible during test 1 on the new bar as on test 2, then the new bar will be 50% stronger (which is not that much). TBH, I was expecting 100% but forgot to measure the diameter of the old bar - I was sure it's less than 13mm. I'm quite curious how much stronger BajaRon's sway bar might be. I'm sure it's tougher and it will be hard to buy rod with the same strength without additional heat treatment.
    If I decide to buy from him, I will ask how big of a difference (%) in strength it has compared to standard sway bar. Maybe he will allow me to share that information.

    sway bar test.jpg

    Seeing how much the standard sway bar rotates with just 10kg, it's amazing that BRP allowed that on our Spyders. 6.5cm is more than 2 inches. It's like 1 inch up on one side, 1 inch down on another. 1 inch movement where the sway bar is connected is at least 3 inches where wheel is. Off course, this is 50cm from the center of the sway bar, and the actual value is probably 1/5th of that (from the center of the sway bar to the bar ends), still, it would be more than 0.5of an inch with just 10kg at 50cm from the sway bar. Quite a lot. With a strong wind you could expect to lean that much between left and right and change direction on the road as a result!
    Last edited by megagame; 06-02-2023 at 02:25 AM. Reason: then (time) - than (alternative) ;-)
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  16. #116
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    I've made measurement with new bar with test 1 and it's not as good as I was expecting originally but in line with test 2. Basically it will be around 30% stiffer than original, but still far from 100%. I will try to look for 15mm and 16mm bars online.
    For bending I've used hydraulic tube bender which can be bought for around 100 USD. I've had one already because of other projects so no additional cost there fortunately.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  17. #117
    Active Member
    Join Date
    Mar 2019
    Location
    NEBRASKA
    Posts
    422
    Spyder Garage
    1

    Default

    Just a quick "kudos" to megagame and BertRemmington.....two members that have enriched the last two years of SPYDERLOVERS with their persistence and knowledge in repairing what seemingly would appear to most of us as "lost causes" in the revival of wrecked Spyders. I would love to see the two of these guys get together in a shop environment. I am amazed at the tenacity and effort that these two guys put into these projects....I promised to never bitch about an oil change or rear tire removal I do myself or any expense I incur at a shop. Thank you guys you have shown us all the endurance of the human spirit.
    2012 RTL 14 RTS , Pearl White @ Pearl White

  18. #118
    Active Member Rednaxs60's Avatar
    Join Date
    Mar 2021
    Location
    British Columbia
    Posts
    293
    Spyder Garage
    0

    Default

    Quote Originally Posted by davev1pa View Post
    Just a quick "kudos" to megagame and BertRemmington.....two members that have enriched the last two years of SPYDERLOVERS with their persistence and knowledge in repairing what seemingly would appear to most of us as "lost causes" in the revival of wrecked Spyders. I would love to see the two of these guys get together in a shop environment. I am amazed at the tenacity and effort that these two guys put into these projects....I promised to never bitch about an oil change or rear tire removal I do myself or any expense I incur at a shop. Thank you guys you have shown us all the endurance of the human spirit.
    Agree wholeheartedly. These gents and the other contributors have gone over an beyond what us mere mortals would do. I also hate throwing things away. My 1985 Honda Gold Wing FI model ECU replacement project pales in comparison. Do like the Arduino family though. Have liked following and will stay to the end.
    "When Writing the Story of Your Life, Don’t Let Anyone Else Hold the Pen"
    "Too many of us are not living our dreams because we are living our fears.” – Les Brown

    2014 Can-Am Spyder RT LE
    1985 Honda GL1200 Goldwing Limited Edition
    2021 Royal Enfield Himalayan

    Ernest

  19. #119
    Active Member
    Join Date
    Aug 2020
    Location
    Poland
    Posts
    81
    Spyder Garage
    0

    Default

    It is frustrating quite often when thing go wrong, many times multiple things in a row.
    But it makes me happy when I read such kind words . When I sometimes question this whole project, small things like that allow me to keep going.

    So, back to the topic .

    I've made some calls to spring producers and steel suppliers and found one company which sells high quality steel bars and tubes. It is around 2km from my hope, and they've had 16mm 40HM+QT in their warehouse. I've had to buy one whole bar (6m), but it was around 30 USD.
    Again, I've made same tests and I think I'm finally happy with the results. I've updated the image in my previous post with tests. Test 1 indicated around 3.5-3.7cm which is almost twice as strong as original. But there is an error for sure (explained also in previous post), and the bigger the difference in results there is, the more significant error is when calculating change 100%. For example, if 1cm of bending is due to error, then actual results are 5.5, 4.1 and 2,5. 2,5 is more than twice as strong as 5.5. Fortunately I was able to observe how everything is bending during tests and I don't thing there is so much additional bending due to material as test tool.

    There is another thing I'm changing which is ride height. I don't want to stiffen the front shocks but I am sometimes hitting road with front plate under the trunk when there are big holes. So, I've decided to add 4cm of additional height to the front.
    With FreeCad I've started to check where new lower mount for shock should be to add additional height. Having in mind that I don't want to destroy old mounting point, there are two possibilities - add mounting plate with hole lower and closed to frame, or move it up.
    Depending on new location differrent forces might appear.

    sily wygiecia.png

    This is my overview for left lower arm. When shock mount is placed further from arm (up direction), then separation of mount from arm might occur. When it's close to the arm, and loser to the frame, there is higher probability that arm will bent because shock will act at start of lever.
    Current original placement is almost perfect, because force from shock is directed to where force from wheel is applied.
    So, i've decided that I will choose this option which guarantees lowest distance of extension of fforce fro shock to point which acts as force from wheel (end of lower arm) - option number 2. But, I will extend the mount towards the frame to minimize possibility of cracking near the arm.

    Some calculations for this option in ca software:

    free cad spring.jpg

    Originally mounting hole is around 4.5cm from center of the arm. Now it should be 9cm.



    If, because of shape of current mount, welding and shaping of additional plates will be difficult, it's possible i will just add some simple plates to have additional hole in the mounting. There holes will not hold the shock in that scenarion, instead they will hold separate mounting adapter.



    This option would act as extension for the shock which would keep the forces in same place. And making new extension adapter would be fairly simple and would not require too much welding on the arm. I'm very much affraid of tearing and cracking and my welding skills are far from perfect. This is critical place so attention to details is really important here. There must be no doubts about rigidity of this modification.
    Last edited by megagame; 06-02-2023 at 02:47 AM.
    2011 Spyder RT with some work to do

    https://www.spyderlovers.com/forums/...from-graveyard

  20. #120
    Active Member sledge's Avatar
    Join Date
    Aug 2021
    Location
    Limestone Tn.
    Posts
    195
    Spyder Garage
    0

    Default

    Quote Originally Posted by megagame View Post
    I've moved photos to google. Don't know why but forum server probably rejected them. They were there at the beginning but disappeared. Now they are back.
    i save everything on a stick.... and i always have them.
    2011 RTS Spyder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •