Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Sergio1990 said:
elem said:
zappan said:
Hi, a few days ago Marcoq released the ver. 0.3.4 based on 0.18 and which gives the possibility to use the 0.19 casainho versions by checking the "last beta code" box.
The discussion on jobike
http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=20
the software
http://www.jobike.it/Public/data/marcoq/20194922331_TSDZ2_Controller_vM0.18.F_and_TSDZ2_Configurator_Beta_0.3.4.zip

thancks for information .

HI everyone,
I installed the newest version. But the Problem with the backwards resistance is still active. Does everyone have an idea how to fix it? Does everyone have a code witch fix the problem?

Thanks for the Help
Hello Sergio, did you select the box "Backwards Resistance Off" in the Java Configurator?
 
Has anyone tried to use the Throttle ?
I tried multiple qmarco's version and different Max/Min range values but the behavior is always the same - it works just like on/off switch without smooth speed increase.
 
grecoa said:
Sergio1990 said:
elem said:
zappan said:
Hi, a few days ago Marcoq released the ver. 0.3.4 based on 0.18 and which gives the possibility to use the 0.19 casainho versions by checking the "last beta code" box.
The discussion on jobike
http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=20
the software
http://www.jobike.it/Public/data/marcoq/20194922331_TSDZ2_Controller_vM0.18.F_and_TSDZ2_Configurator_Beta_0.3.4.zip

thancks for information .

HI everyone,
I installed the newest version. But the Problem with the backwards resistance is still active. Does everyone have an idea how to fix it? Does everyone have a code witch fix the problem?

Thanks for the Help
Hello Sergio, did you select the box "Backwards Resistance Off" in the Java Configurator?

Hi grecora

Thanks for the answer. Yes I select the box, but the resistance is still there. Not so much but it is still strong.
Do you don't have such problems with the newest version?
 
[/quote]

Hi grecora

Thanks for the answer. Yes I select the box, but the resistance is still there. Not so much but it is still strong.
Do you don't have such problems with the newest version?
[/quote]

Hi
I am using the latest version but I do not select (Last Beta Code) so still V18. When I select the "Backwards Resistance off" I have no resistance at all.
Other users also report that all backwards resistance is gone.
 
Hi all, great job on the development .

I'm new on this project but have programming experience and have been looking at the code for a few weeks now with a 48v tsdz2 with vlcd5 display and can confirm all the settings so far have been working well on the vlcd5 display.

As for the backwards resistance, it seems to have to do with the pwm signal staying active and the duty cycle being at zero when at standstill. This results in maximum braking resistance (regen) when running the wheel backwards. When running the wheel forward you wont feel this since the clutch on the small blue gear prevents rotation from going in but as it is a one way clutch it does transfer rotation to the motor in reverse.

I managed to stop this from happening by adding a "pwm_deinit_bipolar_4q" to "pwm.c" and calling it when the motor speed falls below 50ERPS.
Code:
void pwm_deinit_bipolar_4q (void)
{
  // verify if PWM N channels are active on option bytes, if so, disable
  FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD);
  if (FLASH_ReadOptionByte (0x4803) != 0x20)
  {
    FLASH_Unlock (FLASH_MEMTYPE_DATA);
    FLASH_EraseOptionByte(0x4803);
    FLASH_ProgramOptionByte(0x4803, 0x20);
    FLASH_Lock (FLASH_MEMTYPE_DATA);
  }

  TIM1_TimeBaseInit(0, // TIM1_Prescaler = 0
        TIM1_COUNTERMODE_CENTERALIGNED1,
        (512 - 1), // clock = 16MHz; counter period = 1024; PWM freq = 16MHz / 1024 = 15.625kHz;
        //(BUT PWM center aligned mode needs twice the frequency)
        1); // will fire the TIM1_IT_UPDATE at every PWM period cycle



  TIM1_OC1Init(TIM1_OCMODE_PWM1,
#if 1
         TIM1_OUTPUTSTATE_DISABLE,
         TIM1_OUTPUTNSTATE_DISABLE,

#else
         TIM1_OUTPUTSTATE_ENABLE,
         TIM1_OUTPUTNSTATE_ENABLE,
#endif
         255, // initial duty_cycle value
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCIDLESTATE_RESET,
         TIM1_OCNIDLESTATE_SET);

  TIM1_OC2Init(TIM1_OCMODE_PWM1,
         TIM1_OUTPUTSTATE_DISABLE,
         TIM1_OUTPUTNSTATE_DISABLE,
         255, // initial duty_cycle value
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCIDLESTATE_RESET,
         TIM1_OCIDLESTATE_SET);

  TIM1_OC3Init(TIM1_OCMODE_PWM1,
#if 1
         TIM1_OUTPUTSTATE_DISABLE,
         TIM1_OUTPUTNSTATE_DISABLE,
#else
         TIM1_OUTPUTSTATE_ENABLE,
         TIM1_OUTPUTNSTATE_ENABLE,
#endif
         255, // initial duty_cycle value
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCIDLESTATE_RESET,
         TIM1_OCNIDLESTATE_SET);

  // OC4 is being used only to fire interrupt at a specific time (middle of DC link current pulses)
  // OC4 is always syncronized with PWM
  TIM1_OC4Init(TIM1_OCMODE_PWM1,
         TIM1_OUTPUTSTATE_ENABLE,
         285, // timming for interrupt firing (hand adjusted)
         TIM1_OCPOLARITY_HIGH,
         TIM1_OCIDLESTATE_RESET);

  // break, dead time and lock configuration
  TIM1_BDTRConfig(TIM1_OSSISTATE_ENABLE,
      TIM1_LOCKLEVEL_OFF,
      // hardware nees a dead time of 1us
      16, // DTG = 0; dead time in 62.5 ns steps; 1us/62.5ns = 16
      TIM1_BREAK_DISABLE,
      TIM1_BREAKPOLARITY_LOW,
      TIM1_AUTOMATICOUTPUT_DISABLE);

  TIM1_ITConfig(TIM1_IT_CC4, ENABLE);
  TIM1_Cmd(ENABLE); // TIM1 counter enable
  TIM1_CtrlPWMOutputs(ENABLE);
}

It disables TIM1_OC1Init, TIM1_OC2Init and TIM1_OC3Init pwm outputs but keeps TIM4_OC1Init active so the interrupt that detects motor erps etc stays active. This is needed to detect PAS when starting to pedal again so we can call pwm_init_bipolar_4q () at that point to reactivate the motor.

An added bonus of disabling those pwm outputs is that the idle current at standstill drops from 0.1A(5W@50v) to 0.03A(1.4W@50v) keeping the controller cooler :D . This seems to be consistent with how the stock firmware works (it measured 0.03A at standstill).

What do you guys think, would this be a good way of implement it given some refactoring and prettying up the code snippet from above?
 
Also I could use some advice; when opening up the motor I might have put the pas sensor in wrong somehow and don't seem to get a signal anymore. I'm hoping to debug it by temporarily displaying the pass cadence on the vlcd6 instead of the bike speed but can't get it to work.

Has anyone tried use the display for debugging with success?

What I did for testing is putting in a fixed value in the function "uart_send_package" but the display keeps showing 0 where I would expect it to show the values.
Code:
			// wheel speed
			if(ui16_vlcd6_wheel_speed == 0)
			{
			//	ui8_tx_buffer[6] = 0x07; Stein - original value
			//	ui8_tx_buffer[7] = 0x07; Stein - original value
				ui8_tx_buffer[6] = 50; // Stein - value for testing screen output
				ui8_tx_buffer[7] = 20; // Stein - value for testing screen output
			}
 
stein said:
Also I could use some advice; when opening up the motor I might have put the pas sensor in wrong somehow and don't seem to get a signal anymore. I'm hoping to debug it by temporarily displaying the pass cadence on the vlcd6 instead of the bike speed but can't get it to work.

Has anyone tried use the display for debugging with success?

What I did for testing is putting in a fixed value in the function "uart_send_package" but the display keeps showing 0 where I would expect it to show the values.
Code:
			// wheel speed
			if(ui16_vlcd6_wheel_speed == 0)
			{
			//	ui8_tx_buffer[6] = 0x07; Stein - original value
			//	ui8_tx_buffer[7] = 0x07; Stein - original value
				ui8_tx_buffer[6] = 50; // Stein - value for testing screen output
				ui8_tx_buffer[7] = 20; // Stein - value for testing screen output
			}

Hi would need that function too, since my bike lags from time to time and i want to find out if its the torque sensor or the pas sensor....

maybe try setting ui16_oem_wheel_speed to eg 50... before if(ui16_vlcd6_wheel_speed == 0)

or try
Code:
uint16_t ui16_temp;
ui16_temp = (uint16_t) ui8_torque_sensor * (uint16_t) PEDAL_TORQUE_X100;

		ui8_tx_buffer[6] = (uint8_t) (ui16_temp & 0xFF);
		ui8_tx_buffer[7] = (uint8_t) (ui16_temp >> 8);
instead of
Code:
				ui8_tx_buffer[6] = 50; // Stein - value for testing screen output
				ui8_tx_buffer[7] = 20; // Stein - value for testing screen output
 
Thanks @vscope. I've tried
Code:
				uint16_t ui16_temp;
				ui16_temp = 505;

				ui8_tx_buffer[6] = (uint8_t) (ui16_temp & 0xFF);
				ui8_tx_buffer[7] = (uint8_t) (ui16_temp >> 8);
but still no luck (0.00 on screen). There seems to be more to it but so far I don't fully understand how the function "calc_wheel_speed" works. I'll keep digging.
 
Did you maybe disconnect the torque sensor?
There are 2 wires red-black coming from the drive side to be connected with a small white connector. In my case one was broken (not properly soldered to the torque sensor) since the beginning and the motor did not kick in.. walk assist worked.
 
It measures 2.5Ohms, so the wire is not broken. It might be shorted though; 2.5ohms looks fairly low at first glance but then I don't have any data on what it should be.

To use the display for debugging I'm wondering if there is some flag that needs to be set before the display to show the data from ui8_tx_buffer[6] and ui8_tx_buffer[7]
 
Very soon I will release the new firmware version and new java configurator ... the programs will be completely compatible with the VLCD5, VLCD6 and XH18 displays.
There will be important implementations and advanced features that will make the bike enjoyable to ride! :D :D :D
 
marcoq said:
Very soon I will release the new firmware version and new java configurator ... the programs will be completely compatible with the VLCD5, VLCD6 and XH18 displays.
There will be important implementations and advanced features that will make the bike enjoyable to ride! :D :D :D

:thumb:
 
marcoq said:
Very soon I will release the new firmware version and new java configurator ... the programs will be completely compatible with the VLCD5, VLCD6 and XH18 displays.
There will be important implementations and advanced features that will make the bike enjoyable to ride! :D :D :D

Awesome. Can’t wait to try out current version. My USB programmer will arrive in a few days. I hope there is a NoLCD option someday as I always ride my bike on turbo mode anyways(LCD5)Not sure if motor can technically run only using battery switch.
 
Hi, in the Italian forum the Beta vMO 0.18.I version and the related Java v configurator have been released. 3.5 of Marcoq, among other things the EMTB function is implemented, a gem that is not present in Casainho's Opensurce SW. :D
 
Hi, I downloaded and flashed version 3.5 by Marcoq yesterday. I have a 48v with VLCD5 and I had set the configurator K soft ramp to 20. It was not great as the assist was very slow to kick in and then almost had a wave effect and difficult to pedal with a lot of resistance starting off. It was the same for the eMTB setting. I reflashed the firmware again and set the soft ramp to 0 and I changed the magic byte to see if that would help to reinitialize the memory. I was much happier this time, the start is nice and smooth and the power increases steadily. However the top end speed was a bit lower than the previous version 3.3 I was using. This is not an issue as it is only by a few Km/h and overall the bike feels more balanced. The backwards resistance is gone for me even with the last beta ticked. The resistance was still there in 3.3 for me. Overall it is an excellent release and the walk assist also works with a speed of 4km/h which is perfect.

Unfortunately I cannot enjoy it or test it further as the crankshaft snapped and my chainring side pedal came off as I was cycling to work this morning. Luckily I managed to keep my balance and get to the pavement and retrieve my pedal from the middle of the road. Does anyone know if it is possible to replace the shaft? I haven’t looked at my bike properly as I had to just park it and run into the office but it seem I may still be able to slide the motor out without much hassle. I cant believe that it would snap after only 2000km done.
 
Excuse me minotauro but is your broken drive axle standard or stretched for Fat Bike?
As for the missing power, you can always increase the parameters of the PWM Duty Cycle
 
Hi Zappan, It is the standard axel on the motor for the 68-73mm bb. It snapped off at the base of the chainring. I was just wondering if it was replaceable or a new motor needed. I haven't had a chance to take the motor off the bike yet to see. I just threw my pedal and crank arm into my locker :) . I am happy with the software but just bad luck that it happened as I was looking forward to riding it home again this evening.
 
I'm sorry it is very strange that the standard one has broken, I guess it never happened ... certainly if you don't find the spare part, it might be better to buy the engine, but you can contact the Italian importer because they see the change in the workshop may have the original surplus trees.
 
Minatauro said:
Hi Zappan, It is the standard axel on the motor for the 68-73mm bb. It snapped off at the base of the chainring. I was just wondering if it was replaceable or a new motor needed. I haven't had a chance to take the motor off the bike yet to see. I just threw my pedal and crank arm into my locker :) . I am happy with the software but just bad luck that it happened as I was looking forward to riding it home again this evening.

The axle comes with the torque sensor, and it is a spare part (pswpower). Not sure if you can get the axle only though, anyway you need a bit of skills to disassemble the unit, in particular to put it back again the torque sensor.
 
Oh well, I knew it could not be that simple. It looks like I may now have to buy another motor as I don't know if I could do a good job at stripping it down and replacing it. I'm a bit wary of its reliability now though as it was very creaky and squeaky when I pedaled and there seemed to be a bit of play in the chainring. I tightened all the bolts on the chainring to see if it would help but it did not the squeak was still there. Maybe this bit of sideways play in the chainring increased the strain on the axel and was the cause of the break?? So if anyone else has a squeak or creak from around the chainring then be careful just incase the same thing happens especially if you are travelling at speed.
 
Minatauro said:
Oh well, I knew it could not be that simple. It looks like I may now have to buy another motor as I don't know if I could do a good job at stripping it down and replacing it. I'm a bit wary of its reliability now though as it was very creaky and squeaky when I pedaled and there seemed to be a bit of play in the chainring. I tightened all the bolts on the chainring to see if it would help but it did not the squeak was still there. Maybe this bit of sideways play in the chainring increased the strain on the axel and was the cause of the break?? So if anyone else has a squeak or creak from around the chainring then be careful just incase the same thing happens especially if you are travelling at speed.

Mine has been creaking really bad. Hope this doesn’t happen to mine. I will disassemble it in a bit to try to find the creaking. I think I may have crushed the plastic bb spacer I was using. I’m at about 2000km.
 
Attached images for reference
 

Attachments

  • ae_1559911195777.jpg
    ae_1559911195777.jpg
    106.3 KB · Views: 2,143
  • ae_1559911215240.jpg
    ae_1559911215240.jpg
    86.2 KB · Views: 2,143
  • ae_1559911315126.jpg
    ae_1559911315126.jpg
    44.9 KB · Views: 2,143
zappan said:
Hi, in the Italian forum the Beta vMO 0.18.I version and the related Java v configurator have been released. 3.5 of Marcoq, among other things the EMTB function is implemented, a gem that is not present in Casainho's Opensurce SW. :D

Hi. For a few days I am looking for a java configurator v.3.5 Can someone please help where to find it.
 
ji.ti@seznam.cz said:
zappan said:
Hi, in the Italian forum the Beta vMO 0.18.I version and the related Java v configurator have been released. 3.5 of Marcoq, among other things the EMTB function is implemented, a gem that is not present in Casainho's Opensurce SW. :D

Hi. For a few days I am looking for a java configurator v.3.5 Can someone please help where to find it.

Italian forum Jobike
http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=28
 
Is it possible for the torsion sensor to destroy the new firmware upload? Displey VLCD5 shows the RE 70, RE1 70 values even at pedal pressure. The first used java configurator v.3.4 and the second time v.3.5
 
Back
Top